Advertisement Jump to content
Sign in to follow this  
maxest

Are shader constants initialized to any value?

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

In order to save CPU I thought I could skip sending to shader constants which are zeroes. So if my shader uses values like "materialDiffuse" and "materialEmission", and some object's material emission is equal to (0, 0, 0), can I skip sending the emission value to the shader and be sure that this shader constant will be initialized to zero?

Share this post


Link to post
Share on other sites
Advertisement
According to the DirectX SDK (Registers - vs/ps index entries) defaults for constants are all 0|0|0|0.

Share this post


Link to post
Share on other sites
Great, thank you very much.
And what about OpenGL? To be more specific, how does it look like with ARB and GLSL shaders?

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.

GameDev.net 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!