Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


shader constants

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

hi, 2 things: when a shader is set via SetShader , are all the constant registers cleared, or reloaded to the previous state (or something else)? if i remember correctly any constants specified with the def operation in the shader will overwrite other values. Also, has anyone come up with a nice system for automatically loading shader constants for an arbitrary shader? cheers Marc

Share this post

Link to post
Share on other sites
My advice is start using effect files. Imagine instead of having separate shader and state managers, it’s all rolled into one. Under one hood you can support vertex shaders, pixel shaders, high level shaders, the fixed function pipeline - and the render states that are often tied to these. If your engine is set up right, you''ll be able to support any or all of these - changing and adding rendering methods with out recompiling .

One nicety is effect parameter pools, where parameters (which can be used as shader constants) are shared between effects. I use one ''global'' pool for simplicities sake in my engine.

ATI/Nvidia also covered some of this at the last GDC (you can find the proceedings at both of their websites). They tie it together with HLSL but you need not use HLSL to reap the benefits of using effect files. Also read the latest article about driving directx at msdn.com.

Sorry for not directly answering your questions, but having dealt with your same issues before, I thought I''d point the way.


Share this post

Link to post
Share on other sites

  • 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!