This code is working properly in XNA project.
sampler s0;
texture lightMask;
sampler lightSampler = sampler_state
{
Texture = <lightMask>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = Clamp;
AddressV = Clamp;
};
float4 PixelShaderFunction(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 PixelShaderFunction();
}
}
I want it run in monogame. But I made an error when I used the pipeline tool, and then I changed this code to
PixelShader = compile ps_5_0 PixelShaderFunction();
Compiled successfully. But it doesn’t work properly when the project is running.
Only the background color is shown on the screen. I don’t know why.
Please help me! Thanks a lot!