How to automatic set the parameters of the effect?

Started by
2 comments, last by ChenA 17 years, 11 months ago
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.
hehe.
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).

Niko Suni

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
"There are 10 types of people in the world... those who understand binary and those who don't."
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?
hehe.

This topic is closed to new replies.

Advertisement