Jump to content
  • Advertisement
Sign in to follow this  
ChenA

How to automatic set the parameters of the effect?

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

I want to create a effect form a fx file,then the application automatic set the parameters of the fx. Someone can give me some sample?Thanks.

Share this post


Link to post
Share on other sites
Advertisement
You can assign default values to your parameters in the effect file itself.
If you need to change the values at runtime, you need to somehow feed the values to the parameters from your host program (by using ID3DXEffect::Set* functions).

Share this post


Link to post
Share on other sites
i use a singleton class called constantManager for this. i assign some values to it with manager.addMatrix/Float/Texture and set those values for every effect with .setMatrix/Float/Texture. My material class tests on init which of the constants that are registered in the constantmanager are also available in the shader and stores those in vectors.


regards,
m4gnus

Share this post


Link to post
Share on other sites
Thanks for reply.
Quote:

You can assign default values to your parameters in the effect file itself.
If you need to change the values at runtime, you need to somehow feed the values to the parameters from your host program (by using ID3DXEffect::Set* functions).

Maybe I don't describe clearly,my meaning is "automatic",for example you create a effect from a file,and then you get the parameters the effect need,and then the host program automatic set the parameters(by a function like GetParameters(ParametersType) of the render object class),so I don't need to write any code for set parameters.
Somebody can give me some example or suggestion or articles?Thanks.

Quote:

My material class tests on init which of the constants that are registered in the constantmanager are also available in the shader and stores those in vectors.


regards,
m4gnus

I interested in this,can you detailed explain this?

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!