GLSL equivalent of OpenGL texturing

Hi, Folks,

I'm new to shaders and to this forum, so forgive me if this topic has been discussed before. I would like to create a shader that does nothing more than turning the basic GL lighting into per pixel lighting, while preserving all other functionalities. Hence comes the question: my scene contains geometry loaded from files such as OpenFlight models, where different faces may use different lighting and texturing methods, which I assume I'll need to replicate in the shader. So, for each fragment I'll need knowledge of the following:

1. Is the fragment lit?
2. Does it use texture?
3. How is the texture and the material combined, GL_REPLACE, GL_MODULATE, or GL_DECAL?
4. Is it multi-textured?

I can live with the assumption that there's no multitexturing for now, I may even get away with assuming it's always GL_MODULATE when there's texture, but I must know 1 and 2. The various shader tutorials I have read all assume the user knows the texturing method to be used in advance, and it is not clear to me if there are any built-in constants or variables that tells if lighting is turned on for a fragment, if texture is used, and how it is combined with the base material.

Thanks!
   
Yefei

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.