PDA

View Full Version : linear workflow help


misterwolfy
11-24-2009, 11:12 AM
I think i am getting a little closer to understanding the linear 3d rendering work flow. Please comment on the following assumptions if you notice that I am on the wrong track.

1. A render from of a 3d program (without texture maps) is linear by default. Therefore a properly lit render, before it is tone mapped, will appear dark.

2. A preview of a properly lit 3d rendered image, using a tone mapper set with the gamma correction at 2.2, will give you a good idea of how the image will look after it is properly tone mapped by your compositing software. The tone mapper should be removed before the final render is made.

3. Texture maps should be tone mapped to look good on your properly calibrated monitor, ie given a gamma correction of 2.2. Then, the gamma should be reversed in the 3d package by applying a .45 gamma to the image before rendering, making it "linear". Now it will be darker and in the same gamma space as the rest of the 3d scene.

5. The linear images should be rendered to a 32 bit format like hdr, exr, or fpTif.

Thanks for reading!

hulud
11-25-2009, 12:33 AM
I think everything is right.

I would just add that a color that looks good in your color picker should also going through a gamma .45 before to be used in your shaders.

You probably already know this, but just in case :

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html

Cyril

misterwolfy
11-25-2009, 02:52 AM
No I did not know that. You mean to say that if I choose a color, or build a color texture that "looks good" in the 3D app's swatches and interface, I am actually creating a texture with a gamma of 2.2 (Monitor gamma). So I need to reverse gamma on those textures too. That makes sense, if I am getting it right.

misterwolfy
11-25-2009, 02:53 AM
Someone pointed out to me that tone mapping and gamma correction are different things. I was mixing terminology. Tone mapping is the term for converting HDR images to LDR images.

soulburn3d
11-25-2009, 05:06 PM
Tone mapping is the term for converting HDR images to LDR images.

That's only one use of tone mapping. Tone mapping is a more general terms for taking one set of colors/values and mapping it to another set of colors/values. It can be used as a special effect, not just to reduce the size of your color palette as is the case with converting an HDR to a LDR image.

- Neil

rendermaniac
11-25-2009, 05:41 PM
No I did not know that. You mean to say that if I choose a color, or build a color texture that "looks good" in the 3D app's swatches and interface, I am actually creating a texture with a gamma of 2.2 (Monitor gamma). So I need to reverse gamma on those textures too. That makes sense, if I am getting it right.

I think 3ds max has the option of linearising colour swatches too, but it is the only application I know of that does this. Maya certainly doesn't (unfortunately).

Simon

DaJuice
11-26-2009, 04:44 PM
I think 3ds max has the option of linearising colour swatches too, but it is the only application I know of that does this. Maya certainly doesn't (unfortunately).

Simon

Houdini will let you do this as well. You can apply gamma-correction or LUTs to your color swatches, renders, compositor etc.

TheKYKid
11-30-2009, 07:11 AM
I've been trying to figure out Linear Lighting/rendering workflow too, someone mentioned it in passing to me a little while back...and it didn't make sense.

Is it any easier to create images with this technique?
or does it give you a more photorealistic effect by giving you access to a wider range of tones that are stored by this technique in a 32bit image?


So here's what I've understood from this thread (or not) ;)

I'd be using Mental Ray for Maya and Nuke for this

Step 1:

in MentalRay (for maya) I would apply a "tonemapper" by using a "mia_exposure_simple/photographic" lens shader on my shot camera

Step 2:
adjust its Gamma to 2.2 (default)

Step 3:

Light my scene without textures (this part seems odd to me)
the lighting here will be affected by the lens shader (tonemapper) ...so I get what you mean by
" Therefore a properly lit render, before it is tone mapped, will appear dark."

Step 4:

import my textures and apply as usual to my shaders (but this is wrong)...

so I have to gamma correct each texture either "procedurally" in Maya (or whatever) OR in my texture painting software of choice (photoshop)?

and I would have to adjust the gamma to 2.2 as well to match the tonemapper?

Step 5:

then once my renders look right...

disable the tonemapper (lens shader)

and apply a .45 gamma to all texture nodes

Step 6:

I presume that I'll have a really dark render at this point....
So I would apply an
what process do you apply to your images in post to get the same results as the tonemapped ones in Mentalray/maya?


Does this sound right?

my appologies for sounding noob

misterwolfy
11-30-2009, 08:06 AM
Hey KY, looks like we are in the same boat, but I am either one paddle ahead or behind you.


Is it any easier to create images with this technique?
or does it give you a more photorealistic effect by giving you access to a wider range of tones that are stored by this technique in a 32bit image?

I think that is all correct, but I think that the main reason to do it is that rendering calculations are not correct in 3d rendering unless you have your linear workflow set up properly.

The work flow you describe looks pretty close to what I understand, but maybe there are a few thing backwards? I think that the work flow is basically as follows:

1. make sure that all textures are linear. There are several ways to do that. The method I have heard most often is to reverse the 2.2 gamma correct, assigned by digital cameras or graphics apps, by assigning a .45 gamma in Maya (this makes the gamma 1 linear). You can use a global gamma adjustment on all textures, or add a gamma node at each texture connection.

2. Set your frame buffer data type to render 32 bit float.

3. Add an exposure lens shader to your render camera, with a gamma adjust of 2.2. to give the render a preview gamma adjust ( just for preview purposes ) . This allows the computer to calculate everything in linear space, but allows you to preview the render in gamma corrected color space, which is closer to your final output.

4. Remove the lens shader (or set it's gamma to 1?) before final render. This will allow the renderer to produce the final render in linear space.

Like I said, I am still trying to get this down, so any comments from experts are more than welcome.

Thanks.

hulud
11-30-2009, 08:07 PM
Hi guys,

IMO, taking care of the gamma of your inputs/outputs become really important when you start using GI and ambient occlusion because you will have a result too dark if you do nothing.

If you don't use GI/AO, and you are using only shadow maps, fake ambient lights, it is less important. Ok the lambert result is not the correct one, but who cares : you will tweak your lighting yourself and it will look good on your monitor anyway..

Cyril

d4wn0fF473
12-09-2009, 03:43 PM
From personal experience working with Rman for maya, you have to remap the gamma in your textures to .45, and the pass gamma output of hte individual rman passes to 2.2 before you should ever start lighting. I've also been messing with contrast setting as well to see if I can find a nice balance between gamma and contrast. Another thing that helps is quadratic fall off on your lights, but thats more of a personal setting in my opinion. While the fall off is more realistic, sometimes realism is not the target.

I have found that if I remap the textures to .45 and run the gamma at 1.75 and the contrast at 1.5 I get a nicer look than with just the gamma bumped to 2.2.

Anyone have an Rman specific workflow they would like to share. I'm trying to find something I can work with consistently instead of on a per scene basis.

Also are there any tools for maya that can expediate the process of gamma correcting shaders. Basically just dropping in a gamma node between what needs to be altered? Another thing that I was wondering about was, the only thing that should be gamma corrected are the textures that display color right? Or should the bumps and displacements be corrected as well?

Trauco
12-11-2009, 04:17 AM
"Remove the lens shader (or set it's gamma to 1?) before final render."

I would remove it, because it will create banding in your image once you start playing with the exposure settings in your comp app, because it compresses highlights besides doing the gamma correction (this doesn't matter if you are doing 16-bit integer though, because you are not trying to capture the over-brights most of the time, and you can save a lot of disk space when doing animations).

"I have found that if I remap the textures to .45 and run the gamma at 1.75 and the contrast at 1.5 I get a nicer look than with just the gamma bumped to 2.2."

I like to gamma correct it to 1.8 and leave contrast alone most of the time :-) (if you are doing catalog prints for example)

Wiro
12-17-2009, 05:02 PM
There's a huge thread in GD on exactly this. It's pretty informative so have a look here:
Linear Workflow (http://forums.cgsociety.org/showthread.php?f=2&t=610790&highlight=linear+workflow)

TheKYKid:
A linear pipeline has nothing to do with making it easier (rather the opposite) or giving you a wider range. I has to do with feeding your renderer accurate colours for it's calculations. What the renderer "sees" and what our screens show us are two different things.

Step 3:
Light my scene without textures (this part seems odd to me)

No need for that, you just misunderstood misterwolfy. As long as your textures are linearized you can go ahead and light as usual. The render is linear whether it has textures on or not.

Step 4:
import my textures and apply as usual to my shaders (but this is wrong)...
so I have to gamma correct each texture either "procedurally" in Maya (or whatever) OR in my texture painting software of choice (photoshop)?
and I would have to adjust the gamma to 2.2 as well to match the tonemapper?

It's best not to linearize your textures in photoshop unless you're saving to EXR (which will give you larger file sizes but thats up to you) and instead insert a gamma correct node before each input in Maya. You can script this so it's not really as much work as you think.
But you have to do an INVERSE gamma. So no, not to 2.2 but to 0.454 (1/2.2) so your textures now appear darker. The lens shader set to 2.2 will then brighten it up again.
Then you remove the lens shader again for final renders and save to a float EXR

Step 6:
I presume that I'll have a really dark render at this point....
So I would apply an
what process do you apply to your images in post to get the same results as the tonemapped ones in Mentalray/maya?

That's right, it'll look dark to us but when you now do stuff in shade/fusion/nuke like lens blurs, blooms etc they too will behave correctly, just like the renderer.
Then at the end of your comp script you add in your gamma 2.2 node

Wiro

misterwolfy
12-18-2009, 05:29 AM
what about an explanation of gamma and color management in a simple, visual format, like a children's book for visual artists?

Maybe this could be a humorous and informative blog post? The story could be the journey of Mr. Image from his initial capture to his arrival at Mr. Eyeball. Don't laugh... OK, go ahead and laugh.
w

musashidan
12-18-2009, 10:50 AM
what about an explanation of gamma and color management in a simple, visual format, like a children's book for visual artists?

w

Once upon a time,in a land filled with plastic teapots.When expensive ray traced reflections where cast into a dungeon by the evil specular highlights....................oh no ,the writers block is kicking in.........:scream:

CGTalk Moderation
12-18-2009, 10:50 AM
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.