Hi guys! I have been developing a game in XNA for a very long time now, and recently decided to upgrade to monogame to take advantage of pultiple platforms and portability. The only issue I’ve had so far is that my guassian blur effect does not work anymore. What used to result in a blurred image now results in a blank green screen. Below I will post my code and what the effect looks like in XNA and Monogame. Thanks!
Here is the .fx file that I use to do the effect:
#define RADIUS 2
#define KERNEL_SIZE (RADIUS * 2 + 1)
float weights[KERNEL_SIZE];
float2 offsets[KERNEL_SIZE];
sampler2D colorMap : register(s0);
float4 PS_GaussianBlur(float2 texCoord : TEXCOORD0) : COLOR0
{
float4 color = float4(0.0f, 0.0f, 0.0f, 0.0f);
for (int i = 0; i < KERNEL_SIZE; ++i)
color += tex2D(colorMap, texCoord + offsets[i]) * weights[i];
return color;
}
technique GaussianBlur
{
pass
{
PixelShader = compile ps_4_0_level_9_1 PS_GaussianBlur();
}
}
If you need any more info than feel free to ask! Thanks!