Jump to content
  • Advertisement
Sign in to follow this  

ToneMapping disable possible

This topic is 2086 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


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

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

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 );
Edited by Alundra

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!