I followed up creating a blur material from this
Here is the image of the material anyway:
const float2 ScreenMult = View.ViewSizeAndInvSize.xy * View.BufferSizeAndInvSize.zw;
const int TexIndex = 14;
const float Samples[11] = {-0.08,-0.05,-0.03,-0.02,-0.01,0,0.01,0.02,0.03,0.05,0.08};
float2 dir = float2(0.5,0.5) - ScreenUV;
float4 sum = float4(0.0, 0.0, 0.0, 0.0);
for(int i = 0; i<11; i++)
{
float2 pos = ScreenUV + dir * Samples[i] * BlurDist;
pos = clamp(pos, float2(0.0,0.0), float2(1.0, 1.0) );
sum += SceneTextureLookup(pos * ScreenMult, TexIndex, false);
}
return sum / 11.0;
I’m trying to apply this effect on multiple player controller’s cameras through split screen, the screen for first player works correctly, but for the rest, it just turns to black. My guess is I’m getting the wrong screen texture for the other players (which is passed to the HLSL code), but I just have no idea how to do this.
How do you use custom post process materials with individual screen info and textures?