Reputation: 529
I am learning about GLSL in order to manage it in my IOS & android C++ engine. I get a lot of documentation about syntax and GLSL programming but I need some tutorials about how to manage it in a complete scene (How to apply a shader only on a specific object of the scene ? How combine several effects on an object ? )
Do you have some links or book reference to send me ?
Upvotes: 3
Views: 556
Reputation: 473437
How to apply a shader only on a specific object of the scene ?
It's the same way you apply a texture to a specific object. You call glUseProgram
with the program you want to use. Any subsequent rendering commands will use that program, until another glUseProgram
call is encountered.
How combine several effects on an object ?
In general, this means that you write a new shader. Shaders are not really things you can combine with the API. You can copy bits of them into other shaders. You can use the unique features of the OpenGL shader object paradigm to change program functionality based on which programs are linked to which.
But in the general case, if you want to combine several "effects", you have to write a new shader that has those effects in it.
Upvotes: 4