## RE: [Algorithms] Dynamic Gamma / Tone Mapping

 RE: [Algorithms] Dynamic Gamma / Tone Mapping From: Peter-Pike Sloan - 2005-11-30 07:02:07 ```I know that the authors (at least Pete Shirley) were really surprised how well the "simple" operator worked, and felt the high level take home from the paper is that the simple operator works quite well (I've just talked with Pete about this, Erik might have a different opinion...) -Peter-Pike Sloan=20 -----Original Message----- From: gdalgorithms-list-admin@... [mailto:gdalgorithms-list-admin@...] On Behalf Of Rowan Wyborn Sent: Tuesday, November 29, 2005 2:19 PM To: gdalgorithms-list@... Subject: RE: [Algorithms] Dynamic Gamma / Tone Mapping Speaking of contrast and the Rheinhard approach... Has anyone implemented the contrast preserving "dodge and burn" operator in this paper? We are just using the basic operator, and its tempting to try to do the dodge and burn, but I'm not sure if it will make much difference in practice. rowan > -----Original Message----- > From: Wesley Hunt [mailto:weshunt@...] > Sent: Wednesday, 30 November 2005 8:04 AM > To: gdalgorithms-list@... > Subject: Re: [Algorithms] Dynamic Gamma / Tone Mapping >=20 > I'm not sure exactly what math you are using, but I'm more-or-less=20 > using the technique that Aras suggests (all GPU-based), and it works=20 > fine. There's not many calculations you can't do in the ALU with=20 > ps_2_0+. >=20 > As far as the tonemapping curve itself, if the popular Rheinhard=20 > approach doesn't fit your needs, you can pick whatever you want.=20 > Rheinhard doesn't do a great job preserving contrast when the scene=20 > has a fairly low dynamic range, so I've played with ways of tweaking=20 > it a bit to not flatten out the curve so much when there's not so much > range to play with. Obviously luminance min/max come into play here to > determine how much range there is. >=20 > If the calculation makes you too ALU-bound (unlikely), put some of it=20 > in a texture lookup function to shift the load a little. >=20 > -Wes >=20 > ----- Original Message ----- > From: "Aras Pranckevicius" > To: > Sent: Tuesday, November 29, 2005 2:21 PM > Subject: Re: [Algorithms] Dynamic Gamma / Tone Mapping >=20 >=20 > > Although it's possible to probably do this in a 2.0 pixel > shader.. I > > think... and output it as three components of a texel in a > 1x1 texture... > > the next steps are more difficult to figure out: >=20 > Seems to be doable. >=20 > > We have to keep track of a current min/max/average and then animate > moving > > from the current values to the new values over time (with a > smooth in/out > > curve). This part simulates the iris adjusting to light. =20 > Not exactly > sure > > how we'd do that on the GPU. >=20 > Maybe similar to the "traditional way" - have two small (1x1) > textures: one holds previous values, the other holds current values. > You compute current from the previous one and frame delta-time. Take a > look at HDRLighting sample in DX SDK or some other places. I'm not=20 > sure about the exact formulas you're using on the CPU, but it should=20 > be doable on the GPU as well. >=20 > > After this we have to create a look up texture that remaps > values in the > > 0-255 range to new color values in the 0-255 range (r,g & > b). We compute > > this from the min/max/average and then also a coefficient > that lets us > bump > > up the saturation/contrast. The result is a new gamma > curve we want the > > scene to have. Then process the scene against this in a > pixel shader (or > > use hardware gamma if in full screen mode). >=20 > Here you can probably skip this intermediate "calculate texture" step. > In the final scene processing pass, you have values of each pixel=20 > (coming from the main rendertarget), and currently adapted=20 > average/min/max values (all coming from the small 1x1 texture). For=20 > each pixel, just do the math. >=20 > > Does tone mapping achieve the same thing with just a single > luminance > > value? >=20 > Not really. What you're doing is some kind of "auto contrast stretch", > whereas now-popular Reinhard's tone mapping does not do that. What=20 > gives better results - well, that depends on a lot of factors ;) >=20 > -- > Aras 'NeARAZ' Pranckevicius > http://nesnausk.org/nearaz | http://nearaz.blogspot.com >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log > files for problems? Stop! Download the new AJAX search engine that=20 > makes searching your log files as easy as surfing the web. > DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > GDAlgorithms-list mailing list > GDAlgorithms-list@... > https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=3D6188 >=20 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dick _______________________________________________ GDAlgorithms-list mailing list GDAlgorithms-list@... https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list Archives: http://sourceforge.net/mailarchive/forum.php?forum_ida88 ```