I am a complete noob with shaders in both XNA and Monogame and shader programming in general. I am trying to follow this tutorial: http://www.xnahub.com/simple-2d-lighting-system-in-c-and-monogame/ . When trying to compile the lighteffect.fx shader in the Monogame Pipline I get “Unexpected token ‘l’ found. Expected LessThan or OpenParenthesis.
Unexpected token ‘;’ found. Expected GreaterThan or CloseParenthesis.” this is at (4,61) which is weird because there is no “I” in it.
Here is the Shader code:
sampler s0;
texture lightMask;
sampler lightSampler = sampler_state{Texture = lightMask;};
float4 PixelShaderLight(float2 coords: TEXCOORD0) : COLOR0
{
float4 color = tex2D(s0, coords);
float4 lightColor = tex2D(lightSampler, coords);
return color * lightColor;
}
technique Technique1
{
pass Pass1
{
PixelShader = compile ps_2_0 PixelShaderLight();
}
}
Thank you for anyone willing to help!