HDR tone mapping using nodes.

Hi - HG1 sent me some GLSL shaders for HDR tonemapping, I tried to implement one of them in nodes, but…


float4 ps_main( float2 texCoord  : TEXCOORD0 ) : COLOR
{
   float3 texColor = tex2D(Texture0, texCoord );
   texColor *= 16.0;  // Hardcoded Exposure Adjustment
   float3 retColor = pow(texColor,1.0/2.2);
   return float4(retColor,1.0);
}

I have a color output from reflections which I am trying to filter through this, I use HDR image(.hdr). When I set up this node setup:



But what I get is ultra-bright, almost single color metals(which consists of only reflections) and all the reflection of the surface is brightened, not just theese bright parts as sky. I wanna achieve the same as setting this node(with HDR image) in BI render where it outputs very correct results.

Basically everything correct. But the shaders that I sent you are sub function you must multiply the color output with the original image. Look at the last shader, which is full fragment shader. Image sampling output nodes is basically the same as gl_FragColor in the shader.
You can also use a color multiply node to multiply all colors with a certain value.


Thank you. This still isn’t the same as the render results in BI, but the effect look amazing. I can’t belive it really works like this:)