Camera response functions as a tonemapping option

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Re: Camera response functions as a tonemapping option

Postby Lord Crc » Fri Dec 17, 2010 7:41 pm

I have now tried several of the CRFs we have available. It seems that the 2.2 gamma hack is not good enough. The variations between the various CRFs are just too big. So, what to do.

One idea I had was to do a gamma curve fit (either during loading or preprocessing the files), and use this to normalize the files to a 2.2 gamma curve, essentially overriding any built-in gamma compensation. However I'm not sure how good this will work for CRFs which have bad fits... Can try it out and see how it goes.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Camera response functions as a tonemapping option

Postby Lord Crc » Thu Feb 10, 2011 8:09 pm

I'm pushing a change which tries to estimate any "built-in" gamma in the CRF and compensate for it.

I've attached two images which illustrates the old fixed-gamma hack and the new method in action. In each the leftmost has no CRF applied, the middle has "Advantix-400CD" and the rightmost has "agfachrome-rsx2-200CD". I think this illustrates that the new method works well. Image gamma is set to 2.2 in all cases.

Some CRFs have a more S like curve, which results in bad fits. However even with these the result seems to be better with the estimated gamma compensated for. At least better than nothing or the hack.

After a false start and some research I found that doing linear regression on log-log transformed data is a really bad idea. Thus the code uses Gauss-Newton algorithm for a non-linear fit. If anyone has any better method I'd love to hear about it.
Attachments
crf_old.png
Old hack
crf_new.png
New method
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Camera response functions as a tonemapping option

Postby ralvision » Thu Feb 10, 2011 8:27 pm

Lord Crc wrote:I'm pushing a change which tries to estimate any "built-in" gamma in the CRF and compensate for it.

I've attached two images which illustrates the old fixed-gamma hack and the new method in action. In each the leftmost has no CRF applied, the middle has "Advantix-400CD" and the rightmost has "agfachrome-rsx2-200CD". I think this illustrates that the new method works well. Image gamma is set to 2.2 in all cases....


Will gamma still be adjustable with this compensation fix in place? For some of the more extreme film responses, I would still want the option of tailoring the level of response by being able to adjust Gamma & other mapping to my taste. Sometimes, from an artistic perspective, the extreme, albeit with mild adjustment, is desired (the Kodachrome deep saturation, which is indicative of the original film stock, for example)
“Light glorifies everything. It transforms and ennobles the most commonplace and ordinary subjects. The object is nothing, light is everything.” – Leonard Missone
User avatar
ralvision
 
Posts: 21
Joined: Wed Aug 25, 2010 8:05 pm

Re: Camera response functions as a tonemapping option

Postby Lord Crc » Thu Feb 10, 2011 8:55 pm

ralvision wrote:Will gamma still be adjustable with this compensation fix in place?


Absolutely! It does not change the image gamma setting/slider at all.

The main point behind this change was that several CRFs already did gamma correction, while others did not or to a much lesser extent. LuxRender does gamma correction after applying the CRF's, so if the CRF was already gamma corrected the resulting image would be gamma corrected twice, leading to wrong results.

Thus this change was done to "normalize" the CRF files so that gamma correction is only done by LuxRender, based on the image gamma setting.

This should also make it easier to compare CRFs as you no longer have to individually tweak the gamma to get a matching overall brightness.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Camera response functions as a tonemapping option

Postby ralvision » Thu Feb 10, 2011 9:12 pm

Very nice! Looking forward to it. Is this also including the dropdown navigation of CRFs as part of the GUI?
“Light glorifies everything. It transforms and ennobles the most commonplace and ordinary subjects. The object is nothing, light is everything.” – Leonard Missone
User avatar
ralvision
 
Posts: 21
Joined: Wed Aug 25, 2010 8:05 pm

Re: Camera response functions as a tonemapping option

Postby Lord Crc » Thu Feb 10, 2011 9:28 pm

ralvision wrote:Very nice! Looking forward to it. Is this also including the dropdown navigation of CRFs as part of the GUI?


Thanks, and sadly no, this was just a change to core. Hopefully we can get the GUI sorted soon.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Camera response functions as a tonemapping option

Postby patro » Fri Feb 11, 2011 8:38 am

I thought there was something strange with some cfrs... some appeared a bit unrealistic.
great news... :)
I'm sure that there will be find a solution for smart loading of the cfrs files.

btw.... I'm sure that the info below aren't a news for you. but if the answer is no... you could use this tool to have another way to compare the response from the files.
video and application installer it's free.
http://www.motivacg.com/recursos/realca ... ni_en.html
User avatar
patro
 
Posts: 1801
Joined: Fri Feb 29, 2008 9:06 pm
Location: mount Etna

Re: Camera response functions as a tonemapping option

Postby Daniel90 » Sun Feb 20, 2011 2:35 pm

Sounds like a really nice improvement :)
Daniel90
 
Posts: 62
Joined: Sun Aug 23, 2009 8:42 am
Location: Germany

Re: Camera response functions as a tonemapping option

Postby vimax » Tue Feb 22, 2011 9:25 am

I spotted an issue with the camera response tonemapping option:

The vignetting should be applied before the camera response tonemapping because burnt lights instead of toning down to a regular lit light just turns grey.

The behaviour without camera response activated is correct.
User avatar
vimax
 
Posts: 192
Joined: Wed Jul 02, 2008 9:39 pm

Re: Camera response functions as a tonemapping option

Postby ralvision » Sun Mar 13, 2011 10:21 pm

Lord Crc wrote:I'm pushing a change which tries to estimate any "built-in" gamma in the CRF and compensate for it...(snip).

Lord Crc, any ideas on why black&white crfs other than the Kodachrome-25 now render in color in Lux 0.8RC1 & the latest Windows dev builds?
I've attached an image illustrating the issue. The agfapan b&w .crfs that I complied gave the appropriate response in earlier dev builds (08. 120710 & 121410 specifically), but not anymore.
Luxrender-black&white CRF differences 31311.jpg
Black & White Film Response Function files in the current & previous builds of 0.8

Could this have something to do with the gamma compensation you were working on committing?
“Light glorifies everything. It transforms and ennobles the most commonplace and ordinary subjects. The object is nothing, light is everything.” – Leonard Missone
User avatar
ralvision
 
Posts: 21
Joined: Wed Aug 25, 2010 8:05 pm

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest