Jump to content
  • Advertisement
Sign in to follow this  
beebs1

Uniform Buffer Query

This topic is 2170 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya,

I have a quick question about uniform buffers I was hoping someone could answer.

I have 3 'types' of UBOs in my application:
Camera Parameters - Global camera parameters for the scene (updated once per frame).
Object Parameters - Per-object transform (updated once per object).
Material Parameters - Updated once for each material used in a frame.

I believe this is the correct way of using UBOs.

The question is regarding the binding point I should specify in [font=courier new,courier,monospace]glUniformBlockBinding()[/font]. The camera parameters will be shared between all objects (and therefore programs), and so it can always be set to binding point 0.

I'm not sure what to do about the per-object and per-material UBOs. Should I be using successive binding points for each UBO - 1, 2, 3 etc?

Thanks for any help! Edited by Telios

Share this post


Link to post
Share on other sites
Advertisement

The question is regarding the binding point I should specify in glUniformBlockBinding(). The camera parameters will be shared between all objects (and therefore programs), and so it can always be set to binding point 0.

I'm not sure what to do about the per-object and per-material UBOs. Should I be using successive binding points for each UBO - 1, 2, 3 etc?


Yes. That way you only have to call glUniformBlockBinding() once for every program, in the initialization phase.

I had a problem for thjis with AMD, but not NVIDIA. The binding got lost now and then, and I had to call it again. I found that a call of glDeleteBuffers() for buffer 0 destroyed the binding point 0 for UBO:s. That should not be related, but I think it is a bug in the AMD driver.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!