Maya 8.5 Sun/Sky Rendering Bad


#221

For a situation where I want to use the mia_materials or physical sun & sky shaders with my own custom textures that I’ve made it photoshop, but I just need my final output to be 8bit or 16bit rendered tiffs (not float) would it be correct to do the following:

  • set Render globals >> Framebuffer >> Gamma to 0.455

  • for 8bit textures >> leave as is, no gamma correction

  • for 16bit textues >> leave as is, no gamma correction

  • make sure my render camera has a mia_exposure_simple or photograhic a leave the gamma set to 1

From reading this thread it seems as though this should work for any frame buffer output (8bit, 16bit, and 32bit float)?

Thanks!


#222

Yes, this workflow works in Maya, and relies on mental ray’s “own” gamma workflow, (which has some quirks that one need to be aware of, i.e. gamma is applied to 8 and 16 bit files but not float files, both in and out)

The drawback is that color swatches aren’t gamma corrected, so you don’t get the colors you “see”.

I’m inching closer to the Ultimate Unified Cross-App Gamma Tutorial, but the keyword is inching. It’ll be at LinearWorkFlow.com when I find the time… (right now that goes nowhere, so don’t even try… :wink: )

/Z


#223

Thanks for the reply MasterZap.

Yes, this workflow works in Maya, and relies on mental ray’s “own” gamma workflow, (which has some quirks that one need to be aware of, i.e. gamma is applied to 8 and 16 bit files but not float files, both in and out)

So for float files, this should be fine a long as your desired rendered ouput is float (exr, hdr, etc…), since like mentioned before, the rendered wants linear data, correct?

But if you don’t want your output to be float, but you are using float files in your shader networks for some reason then one should apply a gamma correct node of 2.2 to these float files? Does this apply to HDRI images used for Image Based Lighting?


#224

No, as Zap wrote, float textures are linear anyway (or at least they should be) and are therefore not being touched by the Framebuffer Gamma, which is correct.
Setting the framebuffer to .45 only de-gammas non-float textures and this is correct.

Same for output when setting framebuffer gamma to .45: when you render 8 or 16bit the output files will have the correct 2.2 gamma and for 32bit float they will be kept linear which is correct as well.
When rendering 32bit in the viewport this is slightly more tricky, but that’s described in the thread…


#225

Do I have to gamma correct also my normal maps?

And how can I plug in the gamma node into the bump2d node? I guess i have to use the luminance node because the bump2d node uses the outAlpha of the file texture node.

file(the Normalmap) --> gamma Correct --> luminance --> bump2d --> misss_set_normal. This would be my workflow.


#226

I finally understood all about this gamma thing, although I find it excessive to plug a gamma node for every little thing.

Isnt the same just setting the framebuffer to .455? or as Zap said I wont get gamma corrected color swatches? coz If so I should plug a gamma node for specular, ambient, transparency (…). And do I need to plug to one value (integer) parameters too, like Diffuse, Eccentricity, translucence, etc.? (16 bit Displacement doesnt need it right?)

There should be some kind of script or something to deal with this…

As a tip to some comments I read before, to control all the gamma nodes at once, I create a new gamma node calling it GammaCtrl and connect its Gamma Attribute to all others gamma nodes Gamma Attribute, hope that can help in case it hasnt been noted yet.


#227

Well if you’re using 8.5 (as per title), then you can use my mia_material_rg phenomenon (from page 9), it automatically “ungammas” all the colors, color swatches display correctly and does not affect bump/transparency maps.


#228

No one has any idea to that question? :sad:


#229

Do not gamma correct normal/bump/displacement/transparency/etc maps. Only colormaps.


#230

Ah, thanks. :wip:


#231

Firstly I’d like to thank everyone here in their contribution in making me feel really stupid! :slight_smile:

Anychance of someone summerizing this thread (i did read it)because I am now thoughly confused and unsure about the whole thing…now don’t go blaming yourselves, its my fault for having an old, dustbin of a brain. :wink:

Am I right in thinking that if I want to use an external program to adjust the final image, then I should set the framebuffer to 0.45 (for the textures) and Maya’s tonemapper to a gamma of 1.

And if so, with regards to getting the best representation of the lighting setup in this final render within Maya’s viewport, before outputting to an external package, I should have the tonemapper’s gamma to 2.2?

When answering, think of me as a small child who needs it all explaining all over again…maybe with small words. :slight_smile:


#232

well i get all the reasons why i have to put in a gammacorrector… but how???

i see you guys saying you link it on color or on default but that does not wrok for me.
Im not realy a star with making these shaders and conecting nodes.

but ill explain what i have so far.

i have a normal sphere with a texture ( just a simple .jpg)
I go to hypergraph and select at materials my blinn1. then i make sure i see the nodes conected to it.

i see:

place2dTexture ----> file1—> blin—>blins1SG

so the texture file is linked to the color of blin. ( i understood from some posts that i needed to conect the gamma to the blinn1 color node but it is taken)

so when i see this in front of me and i ad an gamma node where do i have to link it to? and with what? ( what conection i mean ) and please dont say default cause if i choose that i need to select the connection.

and how do i need to do it when i dont have a texture?
( btw im working on autodesk® Maya® 2008 Extension 2 )

*** EDIT**
well tryed to link the texture as a value to gamma and then the gamma to the blin as a color. but then i get a total grey render.


2x EDIT :slight_smile:

well the last thing worked but my renderbuffer was stil on wrong gamma. lolz…

but can some one confirm that i now have made the right connection?


#233

Connect file1.outColor to gammaCorrect1.value

Then connect gammaCorrect1.outValue to blinn.color

It should look like this:

place2dTexture ----> file1—> gammaCorrect—>blin—>blins1SG

Then change the three Gamma numbers on the gammaCorrect1 node to 0.454, 0.454, 0.454.

I can send a screen shot if needed.

Hope this helps.


#234

THnx for the reply!

but i just found out how it worked :wink:


#235

There is still something I do not understand. Maybe one of the techies can enlighten me:

[ol]
[li]Render with FB gamma set to 0.455 and mia_simple_exposure set to gamma 1[/li][li]Render with FB gamma set to 1 and mia_simple_exposure set to gamma 2.2[/li][/ol]Now compare both images … there seems to be a difference in sampling or something. The edges of the objects look different. (even if you set the compression in the tonemapper to 0)

So to me it looks as if the FB gamma is applied before sampling and the mia_simple_exposure gamma is applied after sampling.

Might that be true? Or what else might be the reason?

Well, actually this ain’t a problem since you can change the color profile of your textures to anything you want - so if you want be 100% sure of the color correctness of your textures, just apply the sRGB profile to your textures in Photoshop, do your color corrections and save - there you go. Your texture’s now got a gamma of 2.2.


#236

what about the color swatches of light? or photon colors? do those have to be corrected too? I did a couple of tests and it seems they do need to, but want to make sure from someone who knows. If they do, are we talking ALL color swatches??


#237

It’s the other way around, but yes.

Sampling is defined by “whatever is returned by the lens shader”. So when using mia_exposure_* or any other lens-shader-that-does-gamma, the gamma correction occurs prior to the samplers measurements. This yeilds a different result to havinga linear lens shader, and applying the gamma before storing the final pixel in the framebuffer.

Which is “better” is debatable and may depend on a lot of factors.

/Z


#238

Sorry to bring this up again but I still didn’t get it completely.

I am trying to develop a linear workflow with HDR lighting in MentalRay for Maya. This is what is bugging me:

[ul]
[li]The “correct” way of viewing an HDR in Photshop is to check if the exposure value is set to 0 and the gamma to 1 in the 32Bit Preview Options in the View menu? Now the HDR is shown in Photoshop exactly how mentalray will “see” it. Is that right?[/li] When this is set correctly I can adjust the exposure of the HDR (in Image > Adjustments > Exposure …) while having a proper representation of the light situation later in Maya.
[/ul]
[ul]
[li]What exactly needs to be gamma corrected in Maya??[/li][list]
[li]Either you set the FB gamme to 0.455 or you set the gamma value in the mia_exposure_simple to 2.2[/li][li]Every file node needs to be gamma corrected with 0.455 as long as it is not a 32bit texture.[/li][li]Since somebody said that 32bit images ALWAYS are in linear space, I assume that the HDR does NOT need to be gamma corrected in Maya.[/li][li]Do I also need to gamma correct ALL color swatches in Maya?? i.e. diffuse color, light color, photon color, specular color, etc[/li]Since I tested the mia_material with a gamma corrected diffuse color and without correction and the corrected one looked right.
[/ul]
[li]When rendering in 32bit the image shown in the RenderView differs drastically from the one that I command line render and view in Photoshop. Why? Is there an option that makes RenderView look that same as Photoshop?[/li][/list]Thanks in advance for any help!
tom 8)


#239

[/ul]Yeah, kind of. The exposure value doesn’t need to be at 0 - do whatever you want with it - it does the same as if you tweak it in Maya - if it is a .hdr file.

Photoshop at the moment only seems to handle half float for .exr files.

(It opens 32bit exr files alright but I get the feeling it only uses 16bit of it, while it uses the full range from .hdr images - maybe somebody can confirm this?)

What has maybe more influence than the gamma of your IBL Sphere is how the renderer samples it…

[quote=“Throbberwocky”]

[ul]
[li]What exactly needs to be gamma corrected in Maya??[/li][list]
[li]Either you set the FB gamme to 0.455 or you set the gamma value in the mia_exposure_simple to 2.2[/li][li]Every file node needs to be gamma corrected with 0.455 as long as it is not a 32bit texture.[/li][li]Since somebody said that 32bit images ALWAYS are in linear space, I assume that the HDR does NOT need to be gamma corrected in Maya.[/li][/quote]

[/ul]Yes
[/list]

I think I kind of explained that issue here:

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

Don’t worry if this whole issue seems a bloody mess to you - it is!

Cheers - Christoph


#240

“If you use the mia Gamma, the swatches will be correct”

No, that’s not correct, you still have to un-gamma your colour swatches.