Hallo,
I am having some problems getting shaders to work and was wondering if anyone could point out what I was doing wrong. The sprite is being rendered correctly, but the shader has no effect
Here is the draw code:
m_spriteEffect.Begin();
spriteBatch.Draw(texture, pos, getRect(), Color.White);
m_spriteEffect.End();
Here is the spriteEffect begin/end
public override void Begin()
{
m_effect.Begin();
m_effect.CurrentTechnique.Passes[0].Begin();
}
public override void End()
{
m_effect.CurrentTechnique.Passes[0].End();
m_effect.End();
}
Here is my shader code:
float4 PixelShaderFunction(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
{
float4 returnColor = float4(0,0,1,1);
return returnColor;
}
technique Default
{
pass p0
{
PixelShader = compile ps_3_0 PixelShaderFunction();
}
}
Other info:
The game is all 2d, no 3d meshes or vertexes.
The spritebatch is started with Begin()
Regards,