Jump to content
  • Advertisement
Sign in to follow this  
Shaarigan

Become Shader values resetted on every mesh?

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

im experimenting with shaders at the moment and had a question about this. If i define a value in my shader that i
count up every time my main will be called, would it be resetted when calling an other mesh or will my value still hold the
count of times the main was called? Edited by Shaarigan

Share this post


Link to post
Share on other sites
Advertisement
It won't even work inside a single draw call. Each instance of the shader program gets its own set of variables. There are features like atomic writes in very recent hardware, but they aren't exactely performance friendly. Also since the shaders get executed in massively parallel manner one shouldn't think in terms of classic cpu programs anyway.

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!