Bill Reiss

I have a Vertex Shader in an fx file that I created in NVIDIA FX Composer, and it contains a timer parameter as follows:

float Timer : TIME < string UIWidget = "None"; >;

I then use the Timer variable in my shader.

In FX Composer I get the result I want, with the shader varying over time. In XNA, I just get the same deformation all of the time, like the timer is set to a constant value. Is there something special I need to set up to enable this

Thanks,
Bill




Re: XNA Framework FX effect varying by time?

X-Tatic

This is a parameter semantic. It tells FX Composers to send the time to that shader parameter.

XNA does not have built in functionality to do this for you. You have to send the time to  your effect yourself.

Edit - You might want to look into DXSAS.






Re: XNA Framework FX effect varying by time?

Bill Reiss

Thanks that helped a lot, I tried doing this but had a problem, it turns out I was using ElapsedGameTime instead of TotalGameTime so I was getting strange results.