Jump to content
  • Advertisement
Sign in to follow this  
racarate

HDR tonemapping without render-to-texture?

This topic is 1121 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 was looking at some terrain renderers on shadertoy, and noticed a lot of them were using gamma correction and a few were using tonemapping.  I haven't yet implemented HDR tonemapping, but I was curious -- why the need for the extra buffer?  Is it only there in case you need to blend in transparent fragments?  If you are just rendering opaque geometry, why not just compute the tonemapped fragment color "on the fly"?

 

 

 

Share this post


Link to post
Share on other sites
Advertisement


If you are just rendering opaque geometry, why not just compute the tonemapped fragment color "on the fly"?

To compute the tonemapping, you need to know some information about the final image (luminance). So, it is hard to determine the luminance of the scene without first rendering it, thought you could try to only use the history of the last rendered images. But for evaluating the image average lumi you would need to downsample the rendered images several times and these would involve render-to-texture too.

 

It would be a really good idea to support RTT due all the post-processing stuff you could add then (eg. SSAO ).

Share this post


Link to post
Share on other sites

Hmm, so the operator I'm reading about right now is:

 

texColor = texColor/(1+texColor);

 

If I'm only rendering opaque geometry... don't I know the luminance because I am about to write it to the framebuffer?  That is, these operators work at a local level right?  Or are they using some whole-image global data that I am not seeing?

Share this post


Link to post
Share on other sites
You only need the average scene luminance if you're doing adaptive tonemapping.

The formula you've posted is a basic Reinhardt operator, which is a very simple way to map an arbitrary HDR value down to an LDR value.

Games usually use a HDR render target for lighting, followed by a separate tonemapping pass because games typically perform lighting in multiple passes, and also perform alpha-blending/etc, which have to be done before tonemapping.

Share this post


Link to post
Share on other sites

Cool got it, I was just wondering about things like raymarchers in shader toy where you only write each fragment once.  Thanks!

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!