How can i pass Texture to shader file.

Started by
0 comments, last by gsamour 12 years, 7 months ago
I need to pass texture in shader file, but it is giving me error "Invalid call". Please help to tell where i am doing wrong ?
Follow is code which is i have written. I am able to set all the parameter except Texture.

/
float progress;
float4 colBack;
float reverse;

sampler input : register(s0);
sampler Texture2 : register(s1);

//Code to get the parameterhandle
progressHandle = transitionEffect.GetParameter(null, "progress"));
reverseHandle= transitionEffect.GetParameter(null, "Reverse"));
Texture2Handle= transitionEffect.GetParameter(null, "Texture2"));
//Code to set the value
transitionEffect.SetValue(progressHandle, progress);

transitionEffect.SetValue(reverseHandle, Reverse);
transitionEffect.SetValue(Texture2Handle, smapleTexture);

Advertisement
I think you need to use GetParameterByName() instead of GetParameter() to get your handles. GetParameter takes an index instead of a string:

GetParameter:

http://msdn.microsof...5(v=VS.85).aspx



GetParameterByName:

http://msdn.microsof...6(v=VS.85).aspx

This topic is closed to new replies.

Advertisement