Use the shader constant in HLSL (see introduction ). Here is a sample HLSL code that uses timeInSeconds to change the texture coordinate:
float4x4 view_proj_matrix;
float4x4 texture_matrix0;
float timeInSeconds;
struct VS_OUTPUT
{
float4 Pos : POSITION;
float3 Pshade : TEXCOORD0;
};
VS_OUTPUT main (float4 vPosition : POSITION)
{
VS_OUTPUT Out = (VS_OUTPUT) 0;
Out.Pos = mul (view_proj_matrix, vPosition);
Out.Pshade = mul (texture_matrix0, vPosition);
Out.Pshade = MyFunctionOfTime( Out.Pshade, timeInSeconds );
return Out;
}
(), Begin() , :
myLightSourceTime = GetTime();
m_pEffect->SetFloat ("timeInSeconds ", &myLightSourceTime);
, PDF. HLSL (, bool, float, float4, float4x4 ).