Hi,
I have this simple shader
// Effect dynamically changes color saturation.
sampler TextureSampler : register(s0);
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
// Look up the texture color.
float4 tex = tex2D(TextureSampler, texCoord);
// Convert it to greyscale. The constants 0.3, 0.59, and 0.11 are because
// the human eye is more sensitive to green light, and less to blue.
float greyscale = dot(tex.rgb, float3(0.3, 0.59, 0.11));
// The input color alpha controls saturation level.
tex.rgb = lerp(greyscale, tex.rgb, color.a * 4);
return tex;
}
technique Desaturate
{
pass Pass1
{
PixelShader = compile ps_4_0_level_9_1 main();
}
}
I compile it with
2MGFX.exe desaturate.fx desaturate.xnb /Profile_DirectX_11
no error
I copy the file desaturate.xnb to content and load with
greyshader = Content.Load(“desaturate”);
I give this error "‘Microsoft.Xna.Framework.Content.ContentLoadException’ in MonoGame.Framework.dll
Could not load desaturate asset as a non-content file!
in XNA all work well
please help me!
Predator