Note that without the HDR postprocess everyone looks just fine. In my code, I am using HdrBlendable surface formats for my Color and Lightmaps, which are then combined into a final RenderTarget, also with HdrBlendable as its surface type, before being passed off to the HDR postprocessor
My results can be seen in the below video (where a single directional light is being used at an intensity of 5). You can see the bloom effect is very "spotty", changing drastically when the camera angle changes. You can also see near the roof of each house a super-dark area, that almost looks like noise. Note that the super-dark areas appear even if I pull bloom out of the equation altogether.
http://img341.imageshack.us/img341/5366/rxtfsmkqvrfuypnechfltu.mp4
I think my problem is most likely due to changing a majority of the samplers from MJPs project to use Point sampling, since XNA doesnt allow linear filtering of HdrBlendable RenderTargets, however I tried implementing some manual linear filtering in my shaders, and not only did they slow things down terribly, they didn't seem to solve the problem.
Anyone have an idea of what is causing these visual glitches? I can provide any code necessary, but here is the ToneMapping PS:
\
float3 ToneMap(float3 vColor)
{
// Get the calculated average luminance
float fLumAvg = tex2D(PointSampler1, float2(0.5f, 0.5f)).r;
//return float3(fLumAvg, fLumAvg, fLumAvg);
// Calculate the luminance of the current pixel
float fLumPixel = dot(vColor, LUM_CONVERT);
// Apply the modified operator (Eq. 4)
float fLumScaled = (fLumPixel * g_fMiddleGrey) / fLumAvg;
float fLumCompressed = (fLumScaled * (1 + (fLumScaled / (g_fMaxLuminance * g_fMaxLuminance)))) / (1 + fLumScaled);
return fLumCompressed * vColor;
}
float4 ToneMapPS ( in float2 in_vTexCoord : TEXCOORD0,
uniform bool bEncodeLogLuv ) : COLOR0
{
// Sample the original HDR image
float4 vSample = tex2D(PointSampler0, in_vTexCoord);
float3 vHDRColor;
if (bEncodeLogLuv)
vHDRColor = LogLuvDecode(vSample);
else
vHDRColor = vSample.rgb;
// Do the tone-mapping
float3 vToneMapped = ToneMap(vHDRColor);
// Add in the bloom component
float3 vColor = vToneMapped + tex2D(LinearSampler2, in_vTexCoord).rgb * g_fBloomMultiplier;
return float4(vColor, 1.0f);
}







