Jump to content
  • Advertisement
Sign in to follow this  
KaiserJohan

Tonemapping questions

This topic is 563 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

I am implementing tonemapping mainly based on this excellent article: https://mynameismjp.wordpress.com/2010/04/30/a-closer-look-at-tone-mapping/ and got a couple of questions.

 

1. The first step involves getting the global average luminance value, by outputting the luminance value per pixel into a texture and then generating mipmaps. However why is log/exp functions used when storing/retreiving the luma values?

2. I render my skybox (just a cube texture) after all lights but before tonemapping. After applying tonemapping it is noticably darker. Maybe this is OK but it looks abit wierd. Do I need to apply another technique to "light up" my skybox?

 

Cheers

Share this post


Link to post
Share on other sites
Advertisement

Regarding your skybox, you didn't provide details but remember that most are using HDR skyboxes now which are bright as hell. If you're using an LDR skybox, I would experiment with artificially expanding the DR (just scalar multiply and subtract) with noising to control banding.

Edited by Promit

Share this post


Link to post
Share on other sites

Like Krzysztof explained, the log and exp are used as part of computing the geometric mean of the image brightness. The idea of using geometric mean comes from Reinhard's original paper,and it was proposed as a way to reduce the effect of outliers when computing the average intensity. This can help give better results in the "extremely bright pixel" scenario that Krzysztof mentioned. So it's not strictly necessary to do it that way: you could use a simple average or any technique you want for computing an automatic exposure value. But you may run into issues with outliers depending on how you decide to do it.

Share this post


Link to post
Share on other sites
Just to expand on what MJP and and Krazy Nark (sorry man I can't spell your name) have stated about geometric mean, here is a (good?) example of what the results look like vs the arithmetic mean:

Arithmetic Mean - given n elements, sum up all elements and divide by n.
If our domain is {1,1,27} then the output of this function is (27+1+1)/3 = 9.6.

Geometric Mean - given n elements, multiply elements together and take the nth root. If our domain once again is {1,1,27} then the output of this function is pow( 27*1*1, 1/3 ) or 3.

As you can see, in this hyper simple example, which way the results lean. And like MJP and KN stated, the geometric Mean will not allow overly bright outlier pixels to dominate and overpower the calculations as the example shows.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!