Sign in to follow this  
BroderickCalpe

Shaders question

Recommended Posts

I have 32 spheres all using the same Shaders.

 

I select one of the spheres and would like to change the color of that particular sphere now. How can I do this the way I have setup my project?

 

Is the procedure to load another shader at runtime for a particular shader or how are the shaders used?

 

Thanks

Share this post


Link to post
Share on other sites
In the simplest case you would probably just change the uniform which controls the color the spheres have.

In such a trivial case setting a different shader which behaves as desired would work too but such an approach does not scale well to more interesting scenarios. Uniforms are there for these reasons. Learn to use them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this