Multiple Shaders

Hi,

I wonder how do you work with multiple shader programs at the same time? I have a scene where there is a box and in it there are balls bouncing. I want to apply a program to walls and one to balls separately. How can I do that?

Thanks,
elasolova

You create more than one program object. You call glUseProgram on the one for the box, then draw the box. Then call glUseProgram on the one for the balls, then draw the balls.

I exactly did that. But, somehow only one of the programs is working. I only get the texture for the walls and I do not see the lighting for the balls. Both programs are working fine when used individually.

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