Original Post
After reading Orange book (OpenGL 2.0), some doubts are there in my mind.
In order to render a scene, a single program object (with one vertex/fragment shader) or multiple program objects can be used.
i.e. all the objects with one program object or every object can define its own program object.
i went through other threads on this forum and got to know about different techniques. But some doubts came to my mind regarding how global states of the scene like lightning, fog will work if every object use its own shader. This will imply setting up of all the global states to each new program object that's being created by objects in the scene.
What would be a better approach for this or its the only way?
In order to render a scene, a single program object (with one vertex/fragment shader) or multiple program objects can be used.
i.e. all the objects with one program object or every object can define its own program object.
i went through other threads on this forum and got to know about different techniques. But some doubts came to my mind regarding how global states of the scene like lightning, fog will work if every object use its own shader. This will imply setting up of all the global states to each new program object that's being created by objects in the scene.
What would be a better approach for this or its the only way?