View Full Version : varying variables without vertex shader

04-11-2011, 06: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).

04-11-2011, 09: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)

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