float g_fMiddleGrey = 0.3f;
float g_fMaxLuminance = 16.0f;
static const float3 LUM_CONVERT = float3(0.299f, 0.587f, 0.114f);
float3 ToneMap(float3 vColor)
{
// Get the calculated average luminance
float fLumAvg = SourceTexture1.Sample(PointSampler, float2(0.5f, 0.5f)).r;
// 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;
}
I've tried adjusting the constants, nothing seemed to change really. Ive also looked at the code from the DX sample and from this site: http://filmicgames.com/archives/75 but I have no idea how to adapt it to work with what I have