Jump to content
  • Advertisement
Sign in to follow this  
howie_007

Is information lost between shader switching?

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

Say for example I have two or more effects files (*.fx). Each with it's own set of global variables and default values set when initially loaded. Is the information lost when switching between effects files?

Share this post


Link to post
Share on other sites
Advertisement
I assume you're creating a different effect object with each .fx file... or are you merging the .fx files to create a single effect object? If they're two different effect objects then you need to set the variables on each, separately.

EDIT: which version of Direct3D are you using? and maybe you can post the code for loading the .fx files...

Share this post


Link to post
Share on other sites
Here's an example of what I'm saying...

Say I have an effects file called "lights.fx. I have another effects file called "post_process.fx". D3DXCreateEffectFromFile is called for each of these effect files. After each effect file is loaded, some of the global variables in the effects file are initialized to default values that don't change. As my game runs, it flips between using one effect vs the other.

I'm assuming the initialized default values will not have to be reset. Would that be correct?

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!