Jump to content
  • Advertisement
Sign in to follow this  
maxest

Are shader constants initialized to any value?

This topic is 2346 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.

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!