I'm just starting to learn OpenGL. With all the tutorials I've seen, they demonstrate the use of the fragment shader to set the color of all the objects in question. What I have not yet found is how to use the fragment shader on only one of the objects, giving different objects different colors. How do you do this?
To present the background, I draw a simple scene with a house and a road in 2d. I discovered how to set the colors of each of my objects (the main part of the house, windows, etc.) Using a fixed graphics pipeline, I just donβt understand how to set the colors using flash shaders.
Any clarifications would be very helpful, including a fix if I don't understand something.
source share