ToneMapping disable possible

Started by
1 comment, last by Alundra 10 years, 2 months ago

Hi,

My question is quite simple, It's to be sure of the good drive.

Each tone mapping effect can be enabled or disabled, but tonemapping as a tonemapping should always be enabled ?

This mean a RGBA16 (or 32) target should always be used to render the scene ?

Thanks to say your point of view

Advertisement

If you disable tone-mapping completely (so you're just displaying a 16-bit image to the screen, or copying it to an 8-bit image), then what you're actually doing is using a linear tone-mapper that remaps 0.0f to black and 1.0f to white.

For most real HDR images, this kind of tone-mapper will not produce good results tongue.png

Ok, so better to always have it enabled and don't have an option to disable it.

Filmic Tonemapping still the best ?


struct PS_INPUT
{
  float4 Position : SV_POSITION;
  float2 TexCoord : TEXCOORD0;
};


Texture2D DiffuseMap : register( t0 );
SamplerState LinearSampler : register( s0 );


float3 HableTonemap( in float3 x )
{
  float A = 0.22f; // Shoulder Strength.
  float B = 0.30f; // Linear Strength.
  float C = 0.10f; // Linear Angle.
  float D = 0.20f; // Toe Strength.
  float E = 0.01f; // Toe Numerator.
  float F = 0.30f; // Toe Denominator.
  return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F)) - E/F;
}


float4 main( in PS_INPUT Input ) : SV_TARGET
{
  // Get the diffuse data.
  float3 DiffuseData = DiffuseMap.Sample( LinearSampler, Input.TexCoord ).rgb;
  
  // Compute the current color.
  float ExposureBias = 2.0f;
  float3 CurrentColor = HableTonemap( ExposureBias * DiffuseData );
  
  // Compute the white scale.
  float3 WhitePoint = float3( 11.2f, 11.2f, 11.2f );
  float3 WhiteScale = 1.0f / HableTonemap( WhitePoint );
  
  // Return the final color.
  return float4( CurrentColor * WhiteScale, 1.0f );
}

This topic is closed to new replies.

Advertisement