Dummy question, I guess. I have a custom shader that looks like this:
sampler2D InputTexture;
float parameter1, parameter2 etc
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 result = blah-blah-blah some calculations using parameter1, parameter2 etc.
return result;
}
I'm trying to use it via wrapper that looks like this:
class MyShaderEffect : ShaderEffect
{
private PixelShader _pixelShader = new PixelShader();
public readonly DependencyProperty InputProperty = ShaderEffect.RegisterPixelShaderSamplerProperty("Input", typeof(MyShaderEffect), 0);
public MyShaderEffect()
{
_pixelShader.UriSource = new Uri("MyShader.ps", UriKind.Relative);
this.PixelShader = _pixelShader;
this.UpdateShaderValue(InputProperty);
}
public Brush Input
{
get { return (Brush)this.GetValue(InputProperty); }
set { this.SetValue(InputProperty, value); }
}
}
So, my question is: how do I set those shader parameters from C# program?