Contrast Loss in LINEAR WORKFLOW


#7

Hey dannyboy374, thnx for the tip.

CG TALK is awesome for this, I get tips that I don’t find in tutorials !! will do that .exr conversion in NUKE…saves time. However Since I started texturing in Mari, I can output exr directly from it, so no worries.

Anyways, When I un-check the LINEAR WORKFLOW button, I get extremely “blown out” results, on a simple “matte grey” v-ray Shader.

I did post a thread about LINEAR WORKFLOW switch on Chaos Group, but didn’t get any help so far.

Here’s the link:-

http://www.chaosgroup.com/forums/vbulletin/showthread.php?70055-Linear-Workflow-switch&p=561535#post561535


#8

I know why we check Affect bg, Don’t affect colors, affect swatches but why do we check sub-pixel mapping?

I tried switching off and on, the LINEAR workflow button and got these result :argh: :banghead: http://imageshack.us/a/img594/769/newde.jpg

And the “affect swatches” switch, seems to add 2.2 to the shader if checked on and keeps in LINEAR if un-checked…!! I can be wrong but here is an image, just to be more clear to what I mean http://imageshack.us/a/img594/7205/neweq.jpg
However it doesn’t seem to make any difference in the final render, I rendered with it on and off, but the render remained same. the render is affected only when I turn the L.W.F switch on & off.

Here is a little HI-REZ image with settings :argh: . (the images are directly screen grabbed from Maya) - http://imageshack.us/a/img821/6766/compilec.png

THIS is what is given on V-Ray for Maya’s manual in Spot3D:-

Linear workflow - when this option is checked V-Ray will automatically apply the inverse of the Gamma correction that you have set in the Gamma field to all VRayMtl materials in your scene. “Note that this option is intended to be used only for quickly converting old scenes which are not set up with proper linear workflow in mind. This option is not a replacement for proper linear workflow.”
http://www.spot3d.com/vray/help/maya/150R1/render_params_colormapping.htm


#9

Turn off the linear workflow option, set the gamma back to 1, render to EXR and then turn on the sRGB button in the VRay render buffer.

In Nuke, leave the colourspace setting on the read node as linear, set the viewer lut to sRGB. If you compare the Vray render buffer and the Nuke viewer both should match.

You don’t say what your output format is. But assuming you just want a JPG image sequence, all you need to do is set the colourspace on the write node to sRGB and hit render.

I avoid gamma nodes in Maya and pre-linearize my textures in Nuke.

I hope that helps. Best to keep things simple when working in linear.


#10

My out format is going to be exr…!! Used to that from Mental Ray Linear Workflow

I would love to keep it simple, however, different tutorials says different things.
I wanted one that would match, so I can stick to it.

Some say switch on LWF switch with 2.2 gamma (v-ray will automatically inverse everything to .454)…!! :hmm:

Then I read Spot3D and came to know that LWF switch is merely there for legacy purposes.

Expereinced artist like Robert Nederhorst, check’s the LWF switch with Gamma 2.2 and seems to work fine. (in his Archetype tutorial in Maya from Gnomon). :surprised

I understood what Linear Workflow is, but how to do it inside V-Ray properly is what I am trying to figure out.

[B]
EDIT:-

I made a mistake, R.Nederhorst on Archetype does not use LINEAR WORKFLOW button, got confused with his V-Ray Primer documented in which he has turned on LINEAR WORKFLOW button[/B]


#11

Well, legacy or not, if you know what it’s doing, then it’s in your hand to exploit it :slight_smile: I leave mine off and add Vray gamma attribute to textures myself.

My usual settings are

Adaptive DMC
gamma 2.2
tick - don’t affect colours.

You can also tick “affect backgrounds” if you like, but the other 2 I usually leave them off. The reason to do it this way, if you noticed, vray doesn’t clear the noises in darker area much. It pays much more attention to the brighter area. Now, if you look at “Don’t affect colours” you’ll also see (adaptation only.) That means, Vray will use the brighter image only to compute noises. You can really notice the difference if you have soft shadows in your render.


#12

I use the settings you must mentioned, however I used to use it with LWF switch on.

Now I don’t and I apply a 0.454 gamma node to my color swatches (of no textures), and it seemed fine.

Thnx!!


#13

You don’t need gamma node if you’re using Vray.

Simply select your file node, open attribute editor (ctrl+A if it isn’t already opened)
choose Attributes > Vray > tick “Texture input gamma”


#14

Even for plain swatches?!


#15

Setting the gamma to 2.2 in the Colour Mapping options* is only for when your outputting to a non-linear format such as JPG. If your rendering to EXR then you want to leave it at 1.

*Exception given to having the “don’t affect colours” option on - which doesn’t apply any colour mapping to the final image. But I don’t use that option and I don’t know enough about what it’s doing to comment on it.

If you leave the gamma at 2.2 and bring it into Nuke as a linear EXR then all you are doing is doubling up your colour transforms (which is bad for the image) and your confusing what should be a very simple workflow.

Here is a simple setup between Vray and Nuke using a constant shader set to 0.18 (mid-grey). Both the Vray and Nuke viewers are set to an sRGB lut and I’m rendering to an linear EXR. It’s simple, easy to understand and is technically correct. If you pre-linearize or add the extra attributes to your file nodes - as Panupat suggested - in order to linearize the texture during rendering then you don’t need any gamma nodes (or mention of gamma) in your scene whatsoever.


#16

My god!! So many Methods…!!

I am going to copy paste something from an other thread:-

[B]In Mental Ray -
(1) You change the setting under color management,
(2) and under texture file node (depending on what you have set as input under color management),
(3) render window for viewing properly
(4) add .454 gamma node to swatches…!!
(5) rendering in 16 bit or 32 bit exr or similar linear supported format…DONE!! (hope I didn’t miss anything)

In V-Ray-
(1) Turning on affect BG, don’t affect colors under color mapping and setting Gamma to 2.2
(2) Adding a texture and selecting the bit map input gamma under Vray extra node for 8-bit files
(3)sRGB button for V-Ray Frame Buffer
(4) Adding .454 gamma node to swatches
(5)rendering in 16 bit or 32 bit exr or similar linear supported format[/B]

So according to EarlyWorm, tthe above mentioned method’s are for jpeg and other 8bit formats…!! For .exr or .hdr we should keep it to GAMMA 1
So all this while even in Mental Ray, I was doing it wrong then.


#17

Basically the rule of the thumb is if it’s not an hdri and a color or texture looks “correct” on your monitor. You need to ungamma it before rendertime (.454). This applys to any colors whether it’s diffuse/specular file or a swatch on a material or light.

-Dan


#18

OH!! You have to color correct the swatch on a CG LIGHT? :surprised
There is so much I need to learn regarding the technical part of LWF :banghead:


#19

Its simple really. If your sampler looks at the image at 1.0 and samples it accordingly - when you apply a sRGB LUT to your image in nuke or the VFB - your image will not have appropriately or sufficient sampling - espeically in darker areas. Setting color mapping to 2.2 but choosing dont affect colors makes sampling take place with a brightened picture - but still outputs an linear image.

Do note guys that sRGB and gamma 2.2 is not the same thing. Be careful of this. From an eyeballing point of view you can’t tell the diff… but sRGB has darker blacks.


#20

Thanks, that makes some sense - I’ll give it a try. But wouldn’t you want less samples (relatively speaking) in those darker areas anyway? A little bit of sampling noise in the shadows does help mimic grain/noise.


#21

Mmm perhaps but remember a dark value of 0.2 turns to 0.5 with a sRGB LUT. Now you have issues in your midtones.

It all really depends really too - linear can also have contrasting affects - and may result in oversampling when not needed. Sampling is intended to be adaptive in relation to our perception to achieve quality/speed where needed. The image should really be sampled in relation to as how we will see it :slight_smile:


#22

EarlyWorm one more aspect of that “do not affect color,” is that if you do not turn in on then it bakes in the gamma value you have set into the image. In your method however, I reckon, turning that switch off doesn’t do anything much as you set your Gamma Value to 1.0

After doing a couple of test with different lighting scenario (1 simple rect light, dome light with a black & white ramp, HDR images, etc)…

I feel this workflow suits me better, kinda inclined to what revilo3D & majority of others suggested:- :beer:
(1) Setting Gamma to 2.2, with do not affect color turned on
(2) Adding a texture and selecting the bit map input gamma under Vray extra node for 8-bit files & adding .454 gamma node to color swatches
(3)sRGB button for V-Ray Frame Buffer to view my images properly
(4)Rendering in 16 bit or 32 bit exr or similar linear supported format

However it does lack a lot of contrast which I am still trying to figure out, why?
In some situations I am getting good results with sRGB button turned off. So I think I will un-gamma those images with 0.454 or similar value inside Nuke to get it back. It better to do that, rather than working on non-linear and getting wrong maths.

**And I am also wondering if it is really necessary to add 0.454 gamma node to CG Light (vray light) swatches, like kanooshka suggested. If that’s what he meant, I might have understood it wrong.

Here is an image with few of my settings for LWF tests, that I think I will stick with:-

http://imageshack.us/a/img705/7158/10796679.jpg

One interesting observation I made during this test is that - WHEN I applied an HDR images to my dome light and rendered it, without adding “bitmap input gamma,” I got a renderTime of 4min on a 800 by 600 rez
by adding “bitmap input gamma,” and setting it to 1.0 I got the same result, no change whatsoever in quality or noise but the renderTime went down by 1 min, I got a 3min…

http://imageshack.us/a/img803/7006/87178601.jpg


#23

The lack of contrast gives you a lot more information to work with in the darker area. Feel free to adjust it in post to have the desire contrast. It’s way better than have an image without enough data.


#24

Precisely Panupat!! :thumbsup:
I thought I was doing something wrong, that’s why I was loosing contrast.
But continuous tests made me realize that its better to work on post rather than fiddling around with Maya and waiting each time for render to complete.


#25

Interesting observation there :slight_smile: Will keep an eye on that. Do note - HDR is a linear file format and will not be required to be corrected. I think by applying the a correction attribute but not changing it - it’s coverting the HDR file into vrays internal format and may be more efficent. Have a look at your memory usage and see if you spot any changes there. This may also be a +1 for apply attributes rather than linear workflow checkbox option.


#26

Never had problems with my mid-tones before. :slight_smile:

Interesting I would have assumed the opposite, that normalizing the values that your sampling (with a gamma of 2.2) would result in a higher number of and a more uniform distribution of samples.

As I say, I’ll try it out sometime.