Advertisement Jump to content
Sign in to follow this  

OpenGL UBOs and looong shaders compiling times

This topic is 2492 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

A question about UBO's in combination with Cg. As usual, the nVidia forums remain silent, so I was hoping if someone here could help.

UBO's work fine, but increase the compiling time BIG time. I'm using quite big arrays of data, and it seems they get unwrapped completely. Is there a way to prevent this? The compiled code shows stuff like

#semantic shUBO_Lights._shUBO_Lights : BUFFER[0]

#var float4 _shUBO_Lights.csm[0].posRange : : buffer[0][0] : -1 : 0
#var float4 _shUBO_Lights.csm[0].dirFoV : : buffer[0][16] : -1 : 0
#var float4 _shUBO_Lights.csm[0].splits : : buffer[0][32] : -1 : 0

Instead of re-compiling, I tried to use pre-compiled shaders instead. That also works fine and speeds up loading quite a lot. One thing though... I can't find my UBO parameters anymore! Cg function "cgGetNamedProgramUniformBuffer( uboName )" doesn't find anything anymore. So how to get my handles?

Isn't it possible to workaround it by just binding an UBO (buffer[0], buffer[1], ...) with raw OpenGL commands, like you can bind a texture to a specific unit, without having to use Cg textures to pass a texture to a cg parameter?


Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!