Working in Non-Linear Space

@ 3ddesign,

All the things you describe is exactly what is called working in linear space. I don’t see a single difference. In the tutorial on my website I described two ways to work linear:

use gamma correction color mapping
use linear color mapping and assign a linear profile

IMO the last method is exacly what you are using. please indicate at what point do you think it differs, because I couldn’t find it :roll:

Not sure what you are doing here. Is this a scene or is it a BG image you’re rendering?

There are 3 ways of getting gamma correction:

1. use gamma color mapping as said
2. don’t use it and apply throbs curve to the vray frame buffer so your image looks correct in the VrayFB
3. don’t use vray frame buffer. The max frame buffer is gamma 2.2 corrected because of the display settings so your image will look correct(vray frame buffer isn’t affected by the display gamma settings!)

The difference between 1 vs 2 and 3 is that in 1 the gamma 2.2 is burned in. In 2 and 3 it is not and if you open that image in photoshop, you need to apply a correct profile to it otherwise it will look very dark.

This also means that in 2 and 3, the image isn’t gamma corrected at rendertime (it is done in the viewing system: throb curve, max display gamma, PS color profile). So it is in fact a pretty dark image. Vray will sample dark areas not so good, resulting in bad AA for example.

This image was created with option3:

This one is the same, but rendered with the vray vfb and gamma color mapping (1/0.455). (option 1)

Notice the difference in AA quality!

The first one rendered faster though, because vray didn’t sample that much. So if you use option 2 or 3, you need to increase the QMC sampler settings to get clean enough AA.

Looks good to me :slight_smile:
I think my problem is i always try LWF with exterior scenes that are already setup with standard lighting settings but with out lowering the sun/sky multi…

Sorry to hijack but i had a little play with a scene earlier and converted it to LWF and came up with this…

the same tree,2 angles. Vray mats on the tree.
If i put a HDRI in the enviro slot i get Black spots Every Where :?
Any idea why?

It is probably a semantic thing, a confusion of words rather than of technique. I was under the impression that Linear meant working with images that had a linear response vs. a curved or gamma response. If this isn’t the meaning of working in linear space, I guess you won’t find much difference.

I began this thread after becoming totally confused with all the discussion of LWF. Most of it didn’t make sense. I wanted to clarify for myself and others, who might also be confused, what this was all about.

For example, the AA effect in the post above at least raises questions about the effectiveness of using Gamma Correction in the workflow I outlined. From the responses on the LWF thread, I think too many people may have just accepted the information presented by the Vray Gurus (for whom I have nothing but total admiration, so don’t think I’m speaking negatively) without taking time to test the results. So I created a simple test and posted it as a way of moving the dialog further. I really hope I didn’t sound like I was being critical. I was just trying to understand.

Craig

So why don’t you output to 2.2 gamma as well then?

Then it is also burned in when you save, but is also a post effect. if you choose option 2 or 3 it is usually because you wan’t to keep working in linear space. So using 2/3 and then burn in the gamma when you save isn’t really usefull imo.

There’s a big quality difference between the two main options (gamma correction color mapping vs: vray framebuffer curves adjustment). In the sample I have (that has a lot of dark areas) I end up with a lot of ringing in the gray walls using the framebuffer curves method. Adjusting the gamma using the curves introduces splits in the histogram in Photoshop (so if you have a gray 21-21-21 next to a gray 22-22-22, after raising the curves it may seperate them to 22-22-22 and 26-26-26).

If you use the gamma correct mapping, you get a nice, smooth histogram in Photoshop (and in my test there’s no ringing, it’s a smooth transition into the more shadowed areas of the image).

I found this problem as well which is why I began to question the whole LWF thing. Have you tried rendering using Linear Multiply vs. Gamma Correction color mapping and comparing the histograms? My results showed a more uniform distribution with Linear than with Gamma Correction.

Craig

Well, you’ll get the split any time you make a gamma adjustment on the rendered image. So linear mapping --> Vray framebuffer gamma correction (or any post-render correction) would result in the histogram banding.

Using the Gamma color correction (dark = 1, bright = .4545) gets a smooth histogram. I think one of the problems with the images looking washed out is the histogram banding loses some color information and the spread in values lowers the contrast? Try one each way, bring it into Photoshop, and overlay them. Setting the layers to difference you can see the areas that have reduced color sampling.

Even flipping back and forth between each you can notice color saturation differences.

After rereading this - I guess my question is simply - what does ‘linear multiply’ really do? And how does this differ technically from 1.0/.45454 ‘gama correct’ colormapping?

Is it essentially the same thing or are we losing detail/accuray with ‘Linear Multiply?’ Anyone? Please don’t tell me all this time we could leave colormapping to 1.0/1.0 in ‘linear multiply’ and get the same results…

As for your printing issues - I think that’s a completely separate issue. What you see onscreen is what you see onscreen, and if you want to convert to 4-color, then convert ->CMYK. But this is nothing to do with LWF IMO - that’s just a side-result of ‘proper’ Max/Vray colorspace.

The main thing is that you let Vray work with linear data. What you do after that is dependant on your type of work. But indeed if you save a linear image as 8 bit and do the gamma correction afterwards, you get banding artifacts. If however you save that same image as 16 bit, then do the gamma correction and only in the very end convert to 8 bit, there will be no banding problems.

@ 3ddesign, you didn’t sound critical, I just wanted to be sure that I did not read over a critical part in your article :wink:

In fact the answer would be yes, more or less. The only difference is that when using gamma correction color mapping, you burn in the gamma correction during rendering AND Vray adjusts its importance sampling to it.
Ideally though, you keep your output in linear float and split the channels like Chris described in his compositing tutorial, which gives unsurpassed flexibility. If however you are rendering directly to final output, there is nothing wrong with using gamma correction colormapping.

Well, if you try them both in Photoshop you can see that using linear multiply vs. gamma correct 1 / .4545 the gamma correct produces a smooth histogram. Linear multiply produces banding after being re-corrected (be it in the Vray VFB, Max VFB, Photoshop, etc).

If you think about it this way - you render the image linear, it ends up being quite dark (before any gamma correction is applied). When you apply the gamma correction in 8-bit, it’s ‘stretching’ the histogram below the midpoint (so RGB values 0,0,0 - 128,128,128 end up being remapped to fit 0,0,0 - 186,186,186) while 'shrinking RGB values above the midpoint (so RGB 129,129,129 - 255,255,255 are remapped to fit 187,187,187 - 255,255,255).

You can prove it by making a large gradient (so each RGB value from 0-255 is represented) from black to white in Photoshop and determining where the midpoint is. Then go into the Levels and swing the gamma to 2.2. RGB 1,1,1 is now RGB 5,5,5. The next level of gray RGB 2,2,2 is now 9,9,9. There’s no way to determine the color values between the 1,1,1 and 2,2,2… so after the gamma correction there’s now a 4-level jump in the gray value. The image (after swinging the gamma to 2.2 in Photoshop similar to the Vrayframebuffer 0,.64 technique) now has NO information with R,G or B values of 1,2,3,4,6,7,8…

The transformation is applied linearly to the RGB values and the final decimal is rounded, resulting in the steps in the histogram. It appears that when Vray uses the gamma correct color mapping, it’s performing the transformation at a higher than 8-bit bit depth. (i don’t know what Vray internally calculates at - 32 bit float?)

On the Fusion group they discuss how linear workflow is really best for higher bit images like Cineon / DPX / EXR scans because in 8-bit the loss in possible RGB values results in banding. So the important part:

In order to work in linear color space without getting the resultant banding in the histogram you must either:

1. Use the Gamma Correct color mapping of dark = 1, bright = .4545. You can save out to high-bit depth or 8 bit and you won’t get histogram banding.

2. Use the Gamma Correct or Linear Mapping and save the file out to a high bitdepth image. I only have Photoshop CS, so I know for a fact OpenEXR works fine when you gamma correct at the time of loading the image in Photoshop.

*****IMPORTANT:

If you save from the Vray VFB using Linear Mapping… and you want to avoid the banding, you CANNOT use the internal frame buffer Curves corrector, as it performs an 8-bit gamma correction even though the image is higher bit depth (even on the Real RGB channels). So, using the curves correction (the 0,.64 thing) and saving in ANY format will result in banding.

Disabling the curves correction, saving to a high-bit depth format, and doing the gamma correction in Photoshop works fine (no banding).

Also, cloning the VFB with the curves off produces a correct high-bit depth gamma transformation to the Max VFB.

(note - all data is for Vray 1.46.15, i don’t know if the curves has been updated in any of the newer builds)

Gijs, I don’t think I’ve read your tutorial. Could you give me the URL?

Something that wasn’t mentioned is that using the gamma correct method to burn the info down to 8-bit means you lose info.
- by saving out to a higher bit depth you can play around with the image a lot more, exposure ect.

Personally I like having the input set to 2.2, just easier, the HDRI I just turn down to get the balance back. does any one know if this affects the HDRI in any way? (besides being brighter) my tests here seem fine but I’m wondering if the HDRIs is affected by the 2.2. or is it just lighter?

hahaha another nice long LWF thread..

woohoo.. it will never end will it.

Flipside:
What were the settings for that render? perhaps you could provide a test scene?
And i am to assume that was true LWF, no deviation of changing the dark or bright MP’s at all.
Just changing the MP’s of your lights right?

I hope i’m not being too thick about this, I never understood the linear
workflow thing, and i dont understand this either :cry: I just know it’s
something that i need to do to improve the quality of the images I
produce.

Daft question time, How/where can i find out what gamma my monitor is
set at, If i run the Adobe Gamma correct software, part way throught the
procedure it asks me to select gamma, which is set at windows default
2.2, But when i right click my desktop and check my settings in display
properties\Quadro FX1400\colour correction, it says my gamma is 1 and
when i turn it up to 2.2 my monitors just wash out.

Am i right in thinking that changing my gamma settings in max are best
done during a quiet period and not halfway through a job :?:

Will me changing my workflow to non-linear have any knock on effect
with other people that i work with, for instance people that maybe dont
have photoshop set to adobe rgb 1998, or dont have their desktops set
to gamma 2.2, things like that.

I really want to get in to this, but the LWF thread put me right off, it got
too long and eventually too confusing.

3Ddesign, your explaination seems a lot easier to understand and get
to grips with, so if i follow what you said in your first post in this thread
i’ll be up and running.

cheers for any help anyone can offer, i need it :wink:

steve

That’s what I was trying to say :slight_smile: Altough Gijs can explain it much better than me hehe. Dapeter, maybe you posted simultaneously with Gijs, but your answer is in Gijs’ post, you should do the gamma correction to 16 bit images and not to 8 bit.

Since I render to final output directly and only need minor tweaks in PS, I use the gamma color mapping. Then I don’t have the hassle of 16 bit images + vray’s sampling is better so I can stick to my old knowledge of settings.

Daforce, I can’t post that scene. But you have to understand that changing the dark multiplier (when using gamma correction) is exactly the same as changing all your lights. I tested it. If you have a sun with 1.0, and a sky with 0.25 and dark multi=1.0, and you want to double your lighting, you can do two things:
-change dark multi to 2.0
-change sun to 2.0 and sky to 0.5

The result is exactly the same! Somewhere in one of the LWF threads, Vlado also confirms this. When using gamma color mapping, the dark multiplier should actually be called ‘global light multiplier’.

In my image, the sun has 1.0 and the sky 0.25. Dark multi is 1.8 and bright is 0.455 (=1/2.2).

I’m doing the test again on my scene now with sun=1.8, sky=0.45 and dark=1.0.

I would like to clear one thing out. There are 3 things you can do to your workflow:
1. gamma correct your images and 3dsmax display
2. work in linear space
3. calibrate all your color tools (monitor, printer, scanner, …)

The first one is the most important one imo, and that is the difference between this render http://throb.net/media/linear/non\_linear.png and this render http://throb.net/media/linear/linear.png. The only difference here is the gamma correction. Wheter you apply it trough gamma color mapping or in post, doesn’t really matter here, the main thing is you are applying a gamma 2.2 correction. The reason why you set max to gamma 2.2 is because otherwise you will have a hard time adjusting your materials if the materrial editor is not gamma corrected. (then your mas will look ok, and in the render they will look washed out).

Working in linear space is like Gijs said, that you keep your image in gamma 1.0 but display it with the correct profile to look gamma corrected. Your image stays linear. But you need to work with 16 bit images otherwise you will get banding in the end.

Calibration is done to make sure you display colors correctly. Altough very important to make sure that your image will look correct on other calibrated monitors, it is not related directly to working in linear space! It is just a general side note that everyone who is serious about color should consider doing! The same with printers and scanners. This is to optimize your color accuracy, nothing more.

Oh dear god yes, unless you like the idea of potentially having to re-do all lighting and possibly textures because of it :slight_smile:

Basically to get into LWF you dont necessarily need to know what it works and what makes it work. you just need to know how to make it work. And the simplest way of doing that is to read Jujubee’s mini step by step in that uber LWF thread.. its near the end somewhere ( i think he mentioned what page it was in this thread somewhere) and then just try it out.

Personally I havnt bother to set my monitor to gamma 2.2 I just have it as it always been. I personally dont think changing the montor setup is all that necessary.

Yes true, that has been said in this thread several times already :slight_smile:
Even juju’s mini tutorial is quoted inside this thread. I don’t blame you for not reading the whole thing, I wouldn’t do it either :slight_smile:

Here’s my test:
edit: here is the result:
sun=1.0; sky=0.25; dark=1.8; bright=0.455
http://users.pandora.be/stor1/vray/gks\_01\_small.jpg

sun=1.8; sky=0.45; dark=1.0; bright=0.455
http://users.pandora.be/stor1/vray/gks\_02\_small.jpg

Difference:
http://users.pandora.be/stor1/vray/gks\_difference.jpg

So there is a difference, but that is not significant imo.