Sign in to follow this  
sprite_hound

shaders and uniforms

Recommended Posts

Noobish shader question I'm afraid, but I've not seen anything explicit as to the correct way of doing things. Should I be: a) creating one instance of a shader for each object that uses the shader type, and leaving the uniforms set for that shader? b) creating one instance of a shader for all objects that use the shader type, and setting all the uniforms (or at least the ones that change) every time I render an object? c) something else?

Share this post


Link to post
Share on other sites
a) no
b) yes
c) for better performance group uniforms that change together (per-frame, per-object, per-world) and use bindable uniform buffer extension (in GL3 it is in core).

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