PDA

View Full Version : gamma correct node value


royter
09-25-2007, 09:34 PM
if the MR render globals gamma has the default value of 1.
and if the mia_simple_exposure has a value of 1.

then what should be the value of the gamma correct node for file textures?

Emil3d
09-26-2007, 12:10 AM
Your textures should be 0.45

Think of the gamma nodes and the framebuffer gamma as two different mutually exclusive controls (ways) to correct non linear textures for linear processing, so that you use either one or the other when creating floating point images.

The gamma from mia_exposure_simple has nothing to do with the above process. Think of it as a control that affects the entire final rendered image (not just textures). Its purpose it to make the image that comes out of the renderer with a linier gama of 1 to a nonlinear gamma so that it looks good on our non linear monitors. In most cases when the image looks good on a properly working non linear monitor this value becomes around 2.2. If you leave the gamma at 1, mia_exposure_simple has no effect on the linear gamma of the rendered image and if the other controls are set to make no difference you can as well just delete the mia_exposure_simple node from your set up and tone map the rendered image in some other programs like Photoshop.

royter
09-26-2007, 12:45 AM
If you leave the gamma at 1, mia_exposure_simple has no effect on the linear gamma of the rendered image and if the other controls are set to make no difference you can as well just delete the mia_exposure_simple node from your set up and tone map the rendered image in some other programs like Photoshop.


so if the gamma value of the mia_exposure_simple node is 1, i don't even hace to use a gamme node since it has no effect, right?

Emil3d
09-26-2007, 01:30 AM
Wrong, you have to use either a gamma node with 0.45 or framebuffer gamma with 0.45 to linearize (digamma) all your 8 bit per channel textures regardless of how you treat the resulting image after the rendering process.
It is regardless whether you will change it with mia_exposure, something else, or not change it at all. These are all after the rendering processes changes that are like a new beginning of a newborn image that has nothing to do with some previous life:). A new image is born and everybody can start changing and treating it without any need or considerations about how it was created:).

royter
09-26-2007, 02:38 AM
thanks alot man

i did some test and i can see what you mean.

but i have one more question:

previous to maya 8.5, i always rendered file textures with no problem, with a default framebuffer gamma value of 1 and i never had washy textures.

if i am not using the mia_exposure_node, then why shoud i degamma all my 8 bit per channel textures? isn't the situation here identical to the one before just like in previous maya versions? does it have something to do with the mia_sky?

MasterZap
09-26-2007, 05:59 AM
if the MR render globals gamma has the default value of 1.
and if the mia_simple_exposure has a value of 1.

then what should be the value of the gamma correct node for file textures?

This can't be answered without more info. What are you doing with the output? Writing to some float format and plan to gamma correct in post?

The thing is, with the settings you have, you are not apply any gamma at all in your renderer (renderglobals gamma = 1 && exposure gamma = 1 means "no gamma correction done")

If this is how you want your final output to be, then you probably shouldn't do any de-gamma to your textures either, but you won't be rendering in anything physcially correct (you'll be rendering in the old cartoon universe of gamma=1 rendering)

But if you are outputting to float with the plan to fix your gamma in post, or you are outputting to something else that really expects linear light input (whatever that may be, some argon laser show device perhaps ;) ) then yes, you should de-gamma your textures.


But in a sense, your question is like saying "If I neither use a hammer, nor a nail gun, what type of nail should I buy" ;)

/Z

royter
09-26-2007, 06:45 AM
This can't be answered without more info. What are you doing with the output? Writing to some float format and plan to gamma correct in post?

The thing is, with the settings you have, you are not apply any gamma at all in your renderer (renderglobals gamma = 1 && exposure gamma = 1 means "no gamma correction done")

If this is how you want your final output to be, then you probably shouldn't do any de-gamma to your textures either, but you won't be rendering in anything physcially correct (you'll be rendering in the old cartoon universe of gamma=1 rendering)

But if you are outputting to float with the plan to fix your gamma in post, or you are outputting to something else that really expects linear light input (whatever that may be, some argon laser show device perhaps ;) ) then yes, you should de-gamma your textures.


But in a sense, your question is like saying "If I neither use a hammer, nor a nail gun, what type of nail should I buy" ;)

/Z

hehe.....if only things in MR4Maya were that simple and intuitive ;)

actually i asked my question becose i completed a scene 3 month ago in Maya 8.5, at the time i didn't know why my textures were washy and i hade no info at all regarding the gamma issue.
Now, in that scene i chose 1 for the mia_simple_exposure gamma for some lighting reasons.
but even if i am not palnning to tonemap in post neither rendering to some float format, i noticed that introducing a gamma node to my textures fixed the washy effect. (of course i had to ajust the diffuse values since they were darkened a little bit by the gamma node).

regarding the usage of the mia_exposure_node, if i get you right : you only use it when you are rendering to some float format and doing some gamma correction (either on the spot with some maya correction nodes or later in comp) other wise using the mia_exposure_node is usless.right?

or the mia_exposure_node can be useful for calibarating light in a scene even if you are not planing to fix your gamma in post?

MasterZap
09-26-2007, 07:12 AM
actually i asked my question becose i completed a scene 3 month ago in Maya 8.5, at the time i didn't know why my textures were washy and i hade no info at all regarding the gamma issue.
Now, in that scene i chose 1 for the mia_simple_exposure gamma for some lighting reasons.


Could you elaborate:

a) What are you settings? What is your knee and compression set to?
b) What are those "lighting reasons"?
c) How heavily are you pushing colors into the knee/compressed region?



but even if i am not palnning to tonemap in post neither rendering to some float format, i noticed that introducing a gamma node to my textures fixed the washy effect. (of course i had to ajust the diffuse values since they were darkened a little bit by the gamma node).


If you get a "wasahed out" effect, it sounds like you are pushing heavily into the knee region, perhaps using a very low knee setting?

regarding the usage of the mia_exposure_node, if i get you right : you only use it when you are rendering to some float format and doing some gamma correction (either on the spot with some maya correction nodes or later in comp) other wise using the mia_exposure_node is usless.right?


No quite on the contrary actually. You would only use it with gamma=1.0 if you apply a proper gamma somewhere else. If you don't apply a gamma correction somewhere else, you should use it with gamma=2.2(ish).

What you are most likely doing is using the compression feature of mia_exposure_simple and not the gamma correction. This can be useful (even for float renders, to keep their levels in check, and get better anti-aliasing). Still, gamma has to happen somewhere or it'll be "wrong".

However, note that a low knee, and pushing colors deep into the knee region, is also a nonlinear compression (like a gamma), so maybe it's your knee settings that is causing a "pseudo-gamma" effect, which explains your "need" to de-gamma your textures.

or the mia_exposure_node can be useful for calibarating light in a scene even if you are not planing to fix your gamma in post?

mia_exposure does three things:

1. Scales your colors from whichever HDR range they have into a 0-1 range to "fit" the display
2. Applies a nice "overbright compression" to keep highlights from simply clipping harshly into white (which looks ugly)
3. Applies gamma correction.

Either of these steps are "optional", in the sense that there are parameters that turn that feature off. (pedestal=0 and gain=1.0) turns off step 1, "compression=0" turns off step 2, and "gamma=1" turns off step 3.

You may not need step 1, 2 or 3 for whichever reason, for example:

- "I don't need step 1 coz my scene is lit to already return colors in the range 0-1"
- "I don't need step 2 coz my scene doesn't contain anything overbright"
- "I don't need step 3 coz I plan to apply my gamma correction somewhere else in the pipeline, or my final output is an actually light-linear device ... or in some other way (whichever it may be) I will make sure that the mapping from scene-reffered linear light data in the output file is properly displayed when it hits the end users eyeballs"




Since you are not doing 3, but not knowingly applying Gamma elsewhere, I am guessing your situation is either of:

a) "I have my knee set so low the compression feature of mia_exposure_simple approximates a gamma for the light level I picked"

or

b) "I am actually a gamma=1 render, and 'want' that 'look' (even though nonphysical), but something somewhere for whatever reason is causing my textures to appear 'washed out' and I want to compensate that somehow, and in the past I've noticed that applying a reverse gamma gives them more 'punch'"


So far I don't know which one, but my answer would be:

Answer for a: Sure, de-gamma, since you are applying a "de-facto gamma-ish" compensation with the aggressive knee.

Answer for b: You are out dancing outside any meaningful physics, so there is no longer any "right answer", do what "looks neat to you", because that's all you can do in a an inherently nonphysical render.


/Z

sixbysixx
09-26-2007, 02:39 PM
but i have one more question:

previous to maya 8.5, i always rendered file textures with no problem, with a default framebuffer gamma value of 1 and i never had washy textures.


This is because in the old days you were not de-gammaing your texture, meaning you fed 2.2gamma textures AND you weren't applying a lens shader gamma of 2.2, meaning your textures were after the render still with the correct 2.2 gamma (not washy), but all the rest of the shading in your rendering was using the wrong (ie non-physical) gamma, so you probably corected this by eye with your light sources and shaders.


I updated my gamma 'quick start guide' a little bit. I hope it makes sense and doesn't have any errors.

http://farmhousepost.com/weblinks/GammaWorkflow.jpg

Emil3d
09-26-2007, 04:21 PM
sixbysixx, in Photoshop go to View > Proof Set Up and change to Monitor RGB or your platform and the gamma display will be removed.


By default it is CMYK which applies the gamma. This also confused me for quite some time because I still do mostly 2D for print with Photoshop and haven't change for ages this option that affects only floating point images.

sixbysixx
09-26-2007, 04:38 PM
sixbysixx, in Photoshop go to View > Proof Set Up and change to Monitor RGB or your platform and the gamma display will be removed.


By default it is CMYK which applies the gamma. This also confused me for quite some time because I still do mostly 2D for print with Photoshop and haven't change for ages this option that affects only floating point images.

Nice one mate:thumbsup:
I never realized this option was there - it basically turns Photoshop into an application that is not colorspace aware. Also good for checking images that are supposed to be for web, always assuming of course that you have a decent monitor profile...

Thanks!

royter
09-26-2007, 09:42 PM
Could you elaborate:

a) What are you settings? What is your knee and compression set to?
b) What are those "lighting reasons"?
c) How heavily are you pushing colors into the knee/compressed region?

a) i have an indoor scene with a phusicalsky/sun setup with a value of 50 ( i know this is insanse....but this is how i lit myscene at the time with fg nultibounce)
b) i just wanted objects far away from my window to be realatively clear and not dark and objects near the window not burned out.
c)mia_exposure_simple values: gain:0.2 / Knee: 0.01 / compression: 3 / gamma:1




If you get a "wasahed out" effect, it sounds like you are pushing heavily into the knee region, perhaps using a very low knee setting?

yes, i am it's 0.01



No quite on the contrary actually. You would only use it with gamma=1.0 if you apply a proper gamma somewhere else. If you don't apply a gamma correction somewhere else, you should use it with gamma=2.2(ish).

What you are most likely doing is using the compression feature of mia_exposure_simple and not the gamma correction. This can be useful (even for float renders, to keep their levels in check, and get better anti-aliasing). Still, gamma has to happen somewhere or it'll be "wrong".

However, note that a low knee, and pushing colors deep into the knee region, is also a nonlinear compression (like a gamma), so maybe it's your knee settings that is causing a "pseudo-gamma" effect, which explains your "need" to de-gamma your textures.



mia_exposure does three things:

1. Scales your colors from whichever HDR range they have into a 0-1 range to "fit" the display
2. Applies a nice "overbright compression" to keep highlights from simply clipping harshly into white (which looks ugly)
3. Applies gamma correction.

Either of these steps are "optional", in the sense that there are parameters that turn that feature off. (pedestal=0 and gain=1.0) turns off step 1, "compression=0" turns off step 2, and "gamma=1" turns off step 3.

You may not need step 1, 2 or 3 for whichever reason, for example:

- "I don't need step 1 coz my scene is lit to already return colors in the range 0-1"
- "I don't need step 2 coz my scene doesn't contain anything overbright"
- "I don't need step 3 coz I plan to apply my gamma correction somewhere else in the pipeline, or my final output is an actually light-linear device ... or in some other wayI will make sure that the mapping from scene-reffered linear light data in the output file is properly displayed when it hits the end users eyeballs"

actually all i wanted to do at the time was step 2.




Since you are not doing 3, but not knowingly applying Gamma elsewhere, I am guessing your situation is either of:

a) "I have my knee set so low the compression feature of mia_exposure_simple approximates a gamma for the light level I picked"

or

b) "I am actually a gamma=1 render, and 'want' that 'look' (even though nonphysical), but something somewhere for whatever reason is causing my textures to appear 'washed out' and I want to compensate that somehow, and in the past I've noticed that applying a reverse gamma gives them more 'punch'"


So far I don't know which one, but my answer would be:

Answer for a: Sure, de-gamma, since you are applying a "de-facto gamma-ish" compensation with the aggressive knee.

Answer for b: You are out dancing outside any meaningful physics, so there is no longer any "right answer", do what "looks neat to you", because that's all you can do in a an inherently nonphysical render.

danethomas
10-23-2007, 04:21 AM
I'm only fairly knew to the maya rendering side of things and have read extensively on the mia_physical sky/sun setup in relation to washed out renders.

I'm now aware that on all my textures I need to drop in a gammaCorrect node and set all the values to 0.454.

I was just wondering if anyone has a workflow in terms f apply this to all textures in a scene or automating this somehow? Or do I need to go through on every single texture and manually drop the gammaCorrect node in?

I see the aove comment about going to View - Proof in photoshop - this is just a viewing setting right? Is there a way to apply a gamma of 0.454 in photoshop and then I could just create an action once I save my textures so I don't have to do it manually in Maya?

Thanks

sixbysixx
10-23-2007, 09:57 AM
Yeah, I guess you could do that in Photoshop: Image>Adjust>Exposure

Or probably better, since being done in float: set the MR Framebuffer Gamma to 0.45, that way Mental expects all your input textures to have a gamma of 2.2 and corrects accordingly, leaving just the color swatches to deal with...
(see my little workflow guide above)

tfritzsche
10-23-2007, 04:28 PM
I'm only fairly knew to the maya rendering side of things and have read extensively on the mia_physical sky/sun setup in relation to washed out renders.

I'm now aware that on all my textures I need to drop in a gammaCorrect node and set all the values to 0.454.

I was just wondering if anyone has a workflow in terms f apply this to all textures in a scene or automating this somehow? Or do I need to go through on every single texture and manually drop the gammaCorrect node in?

I see the aove comment about going to View - Proof in photoshop - this is just a viewing setting right? Is there a way to apply a gamma of 0.454 in photoshop and then I could just create an action once I save my textures so I don't have to do it manually in Maya?

Thanks


Yes you can de-gamma your textures in photoshop.

what the gamma node of .454 in Maya is trying to achieve is a linear (1.0) gamma in your texture files (presumed to be gamma 2.2 which both AdobeRGB and sRGB have). So your 2.2 gamma file gets a maya gamma correct of .454 will result in gamma 1.0 (2.2 * .454 = 1.0),

OR
in Photoshop go into convert to profile -> Cutom RGB and change the gamma to 1.0, and save this file as a linear version. now you do not need the gamma corrct node in Maya for these linear files.


thomas

floze
10-23-2007, 05:34 PM
[...] in Photoshop go into convert to profile -> Cutom RGB and change the gamma to 1.0, and save this file as a linear version. now you do not need the gamma corrct node in Maya for these linear files.


thomas
..this will most likely cause banding and dithering artifacts on 8bit files, doesnt it?

MasterZap
10-23-2007, 06:30 PM
Yes you can de-gamma your textures in photoshop.

Avoid that - unless you are saving to OpenEXR or at least 16 bits. There is a reason 8 bit files have a gamma. The resolution doesn't suffice for linear data.

/Z

tfritzsche
10-24-2007, 09:11 PM
thanks floze and MasterZap for pointing out those limitations, I have been working with 16+ bit files so long I forgot about them.

thomas

CGTalk Moderation
10-24-2007, 09:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.