Ward tone mapping back
Board:
Home
Board index
Raytracing
General Development
(L) [2012/11/25] [tby tuomlarsen] [Ward tone mapping] Wayback!Hello,
I'm trying to implement a tone mapping operator and as I was searching for a simple algorithm I found "A Contrast-Based Scalefactor for Luminance Display" by Greg Ward published in Graphic Gems IV.
The main idea is that the scale factor equals to:
Code: [LINK # Select all]Lda = Ldmax / 2
sf = (1 / Ldmax) * ( (1.219 + Lda^0.4) / (1.219 + Lwa^0.4) )^2.5
The problem is, when I was looking at various implementations out there I found several different ways how to calculate of Ldmax and Lda. For Ldmax, I found values ranging from 3.5 to 200, and Lda was Ldmax / 2 or Ldmax / 4.
Ward writes that "for a modern CRT display" Ldmax is 100 cd/m^2. However, modern displays can easily reach more than 400 cd/m^2. And I couldn't find how Lda was derived.
Please, does anyone know how to derive these two values? And why? Also, as I basically stumbled upon this particular algorithm, I'm more than open to suggestions for another (simple) operators.
(L) [2012/11/26] [tby matt] [Ward tone mapping] Wayback!Hi,
IMO, simpler and without any "magic", you can look at the widely adopted Erik Reinhard ("Photographic tone reproduction for digital images", pdf with source code online) tone mapping operator.
My 2 cents...
Matt
(L) [2012/11/26] [tby tuomlarsen] [Ward tone mapping] Wayback!Thanks for the suggestion!
Unfortunately, I have the same problem with the algorithm by Reinhard - each of the implementation I saw is very different.
This seems to be very close to the paper:
[LINK https://github.com/krisher/Path-Tracer/blob/master/src/main/java/edu/rit/krisher/raytracer/image/ImageUtil.java]
even if I don't understand the scaling of squared maximum luminance:
[LINK https://github.com/krisher/Path-Tracer/blob/master/src/main/java/edu/rit/krisher/raytracer/image/ImageUtil.java#L174]
Then there is Luxrender which has all those "prescale", "postscale" and "burn" not mentioned in the paper. Also, it calculates the squared maximum luminance very differently, as it doesn not even includes the luminance ("invY2"):
[LINK http://src.luxrender.net/lux/file/fca1cc05d063/tonemaps/reinhard.cpp#l66]
Do you perhaps know where they got those "pScale", "invY2", "burn", ... from?
(L) [2012/11/27] [tby matt] [Ward tone mapping] Wayback!Hi,
when I started implementing the Reinhard tone mapping operator, I just read the article source code provided here: [LINK http://www.cs.utah.edu/~reinhard/cdrom/]
It's clear, simple and directly related to the paper. The only thing left up to the reader is how to compute the maximum image luminance robustly (from what I remember, they take the pixel having the maximum luminance, but if your images are noisy, you may have false candidates).
Cheers,
Matt
(L) [2012/11/27] [tby mpeterson] [Ward tone mapping] Wayback!in practice (having a rt, interactive etc. renderer) use the avg. luminance from the last frame.
all local tm operators need some kind of "global" luminance values to adjust too. for me the avg.
is the most stable and the workload can be easily distributed over all threads.
mp
(L) [2012/11/27] [tby ypoissant] [Ward tone mapping] Wayback!A common practice is to blur the image to avoid having false high and low luminances not only from noise but also from highlights and caustics. In my experience, this works better than trying to do fancy elimination with the luminance histogram.
(L) [2012/11/28] [tby matt] [Ward tone mapping] Wayback!Yes, but blurring works only if you tone map your image once it is done, not during rendering!
(L) [2012/11/28] [tby tuomlarsen] [Ward tone mapping] Wayback!I think I have the equation 4 from Reinhard's paper working, thanks for the pointer.
But I'm still wondering - Luxrender, Sfera, probably Indigo as well, all use a slightly different method originally written for "Violet" tone-mapper by Nick Chapman. I tried to contact him, so far without luck. I'm interested in this method because it seems to give nicer results and also because I cannot find any source on how to arrive to such a method.
So if anyone knows, please let me know where do "pre_scale", "post_scale" and "burn" come from and why is "Y_white" not equal to Lmax^2?
More here:
[LINK http://src.luxrender.net/lux/rev/f48943145d29#l3.77]
(L) [2012/11/28] [tby ypoissant] [Ward tone mapping] Wayback!It is possible to blur the currently rendered image as soon as there are enough samples to be worth it. It saves blur time if the tone map reference render is smaller than the real image.
back