• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Alundra

Filmic ToneMapping is DARK

6 posts in this topic

Hi all,

I have a render target RGBA16F where I render the scene with lighting.

When the rendering of the scene is finished I send this texture in the Filmic ToneMapping pixel shader.

The problem is I got a very dark image, you can see the image "With" on the right and "Without" on the left:

http://uppix.com/f-Screenshot_2014_53d910de0017208f.png

Here the pixel shader code :

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

Texture2D< float4 > DiffuseMap : register( t0 );
SamplerState LinearSampler : register( s0 );

float3 FilmicTonemap( 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
{
  if(Input.TexCoord.x > 0.5f)
  {
    // Get the diffuse data.
    float3 DiffuseData = DiffuseMap.Sample( LinearSampler, Input.TexCoord ).rgb;
    
    // Compute the current color and the white scale.
    float3 CurrentColor = FilmicTonemap( DiffuseData );
    float3 WhiteScale = FilmicTonemap( float3( 11.2f, 11.2f, 11.2f ) );
    
    // Return the final color.
    return float4( CurrentColor / WhiteScale, 1.0f );
  }
  else
  {
    return DiffuseMap.Sample( LinearSampler, Input.TexCoord );
  }
}

Thanks for the help

0

Share this post


Link to post
Share on other sites

Have you played around the with the constants A, B, C, D, E, F and the 11.2 used to calculate WhiteScale? You probably have to tweak them to achieve the look you want... 

Edited by TiagoCosta
0

Share this post


Link to post
Share on other sites

11.2 is the level in the input image that should be mapped to 1.0 in the output image (i.e. the "white point"). If the input image's mean luminance lies noticeably below this 11.2, then the output image will look overall darker.

0

Share this post


Link to post
Share on other sites

Good catch, using this value :

float3 CurrentColor = FilmicTonemap( DiffuseData );
float3 WhiteScale = FilmicTonemap( float3( 1.0f, 1.0f, 1.0f ) );

I have this result (Left = orifinal HDR, Right = Filmic Tonemapping) :

http://uppix.com/f-Screenshot_2014_53d94e230017212f.png

Is it better to set one fixed value or have one value by scene ?

Edited by Alundra
0

Share this post


Link to post
Share on other sites


Is it better to set one fixed value or have one value by scene ?

I'm not familiar with HDR, but AFAIS the white point depends on the current snapshot of the scene. I mean, it would not make sense in general to have a constant white point, because it would result in typical LDR images since you would need to foresee a value for all circumstances. Someone with experience in HDR may confirm or contradict this...

 

However, the demo scene you are showing us with the screenshots does not look like a typical HDR scene. The brightness of highlights seems relative low, and the fact that 1.0 can be used as white point supports this. In such a scene a constant white point may perhaps be used.

0

Share this post


Link to post
Share on other sites


Is it better to set one fixed value or have one value by scene ?

When using the common reinhard tonemapping, you use the scene brightness as variation for the exposure level of the tonemapping operator. You can use something similar for the filimic tonemapping, eg by adding variation to the white scale (or modify other parameters).

 

To determine the brightness of your scene, render it first (HDR), then sample the image down (eg from 1024x1024=>256=>64=>16=>4=>1) while caluclating the average birghtness/light intensity of the HDR image. Then use the pixel value of the last rendered 1x1 pixel as input (modify by a scalar) for the white space. Utilising the GPU hardware filtering capacities and taking multiple samples per step will result in just a few rendering steps.

 

Advanced:

Instead of the using only the light intensity of the current scene, take the average of the last X frames.

1

Share this post


Link to post
Share on other sites

Unreal Engine has a param for camera component named "Dynamic Range" :

Dynamic Range -> This controls the amount of dynamic range before the tone-mapping curve starts to clip. A setting of 1 would be no dynamic range. Eye adaption happens before the input to Film post so dynamic range is the range after adaption.

So, we end to the answer that it's needed to allow the user to set it.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0