PDA

View Full Version : varying variables without vertex shader



Inventor3D
04-11-2011, 07:23 AM
I'm wondering if it's possible to pass a varying variable into a fragment shader without having to write a vertex shader to pass that variable along. I know how to pass information into gl_Color (a pre-defined variable). But I'd like to have a variable for normals in my fragment shader.

BTW: I don't want to create a vertex shader because my understanding (from my own tests) is that vertex shaders can't implement fixed functionality without serious performance costs (given my Intel graphics card/drivers).

McLeary
04-11-2011, 10:18 AM
As far as I know, GLSL spec tells that varying qualifier is only for communication between vertex and fragment shaders and do not make sense having varying variables only in fragment shader, I don't even know if this compiles without errors.

For more information read this post (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=295360#Post2953 60)

Inventor3D
04-11-2011, 11:32 AM
McLeary, thanks.