Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualHodgman

Posted 31 May 2013 - 02:22 AM

tl;dr: I'm playing with tone-mapping ideas at the moment, and I'm looking for ideas/links/etc to read biggrin.png
 
I've been using a few variations of Reinhard, Hable's curve, and some piecewise linear gradients.
Lately I've been implementing realistic light intensity and falloff values, which has caused extreme amounts of contrast in the lighting levels compared to that I had before. I'm pretty sure that this extreme contrast is physically correct though, compared to what I used to have.
In this new situation, I'm having a hard time tweaking my current tone-mapping code to produce good results, but I made up a new one that's working well for me -- I'm guessing that there's probably existing algorithms that look pretty similar to mine, so share a link if you have one wink.png
 
Looking at film response charts like the one below (from this page), the recurring theme is that the horizontal axis is logarithmic, and the shape is an S-curve.
crvFilmSmall.gif
 
So, I quickly hacked together something with these features (and also a small negative offset to crush the blacks):
float crush = 0.05;
float frange = 10;
float exposure = 10;
 
output.rgb = smoothstep(crush, frange + crush, log2(1+input.rgb*exposure));
//final.rgb = ToOutputGamma(output.rgb);
Log2 basically converts to "f-stops", like at the bottom of that chart, and then smoothstep creates the S-shape. Smoothstep and log aren't cheap, but it's a pretty cheap function compared to some of the other tone-mappers I've tried.
With this curve, I'm getting better results in my current scenes than with my previous code, but I'd like a better understanding of what I'm doing...
Ideally, what I'd like is to simply be using the same curves (and auto exposure programming) as my DSLR, so that I can use realistic lighting values and have everything just look good biggrin.png
 
While I'm at it, I'm also trying to track down some reference values for physical light values -- typical incandescent bulbs, fluorescent tubes, floodlights, the midday sky, direct sunlight, the overcast sky, moonlight, etc... And also values about the typical range of different camera or the human eye. e.g. the above chart depicts 10 stops, or a factor of 1024 between the dark and light end of the response curve. I've seen references that say that the human eye can perceive in a range of 2^20, but is this in the same scene, or can it, e.g. only see an adaptive slice that's 2^10 wide, out of the 2^20 range?

#1Hodgman

Posted 31 May 2013 - 02:12 AM

tl;dr: I'm playing with tone-mapping ideas at the moment, and I'm looking for ideas/links/etc to read biggrin.png
 
I've been using a few variations of Reinhard, Hable's curve, and some piecewise linear gradients.
Lately I've been implementing realistic light intensity and falloff values, which has caused extreme amounts of contrast in the lighting levels compared to that I had before. I'm pretty sure that this extreme contrast is physically correct though, compared to what I used to have.
In this new situation, I'm having a hard time tweaking my current tone-mapping code to produce good results, but I made up a new one that's working well for me -- I'm guessing that there's probably existing algorithms that look pretty similar to mine, so share a link if you have one wink.png
 
Looking at film response charts like the one below (from this page), the recurring theme is that the horizontal axis is logarithmic, and the shape is an S-curve.
crvFilmSmall.gif
 
So, I quickly hacked together something with these features (and also a small negative offset to crush the blacks):
float crush = 0.05;
float frange = 10;
float exposure = 10;
 
output.rgb = smoothstep(crush, frange + crush, log2(1+input.rgb*exposure));
//final.rgb = ToOutputGamma(output.rgb);
With this curve, I'm getting better results in my current scenes than with my previous code, but I'd like a better understanding of what I'm doing...
Ideally, what I'd like is to simply be using the same curves (and auto exposure programming) as my DSLR, so that I can use realistic lighting values and have everything just look good biggrin.png

PARTNERS