woensdag 5 januari 2011

Maya's Physical Sun and Sky, Issues

Welcome back, third post already!

This post will talk about nog only using Maya's Physical Sun and Sky Generator, but also understanding it, and knowing what it does. If later you run into rendering issues as I did, it will be a lot easier to tweak the system, and know what changes are causing what chain reactions. If you find this helpfull, feel free to leave me a comment :D

First of all, The super easy part: Creating the Physical Sun And Sky.

Simply open up your Render Settings Dialog, and go to the "Indirect Lighting" Tab. Here you'll find a big "Create" Button next to "Physical Sun and Sky". Press it. Don't be Shy, press it.
That's it ... you got it. That really is all it takes to create the entire setup. We're done!

now for the next step, in order to allow the setup to really do its thing, we will have to enable either Global Illumination or Final Gathering, or both if that's the way you roll.

For my setup here, I enabled Final Gathering, and because I don't like waiting, lowered accuracy(so less rays get calculated) and upped the point interpolation, so the graininess of having lower accuracy is smoothed out. This speeds up my render times noticeably. 

Next, I'd like to take a minute to explain what exactly the Create button did. 


First of all, if you take a look in your outliner window, you see that a SunDirection Directional light is added. This will be our main controller for the entire setup. Mainly the direction you point this light in will affect stuff throughout the entire network, like colors, intensity, etc ... all in order to simulate the time of day the sun would be at that height. 

But where is all this stuff? Have no fear, it is all in your scene, and all tweak-able. Going back to your render settings to where you created the sky, you can click the button to show the outputs:

If you click this, it will take your Attribute Editor to the mia_physicalsky1 node. Let me just open this up in the HyperShade. (It's under the Utilities Tab)
You can see the PhysicalSky has 2 inputs. First of all, he'll get his exposure settings from the mia_exposure_simple node. Also the sunDirection (Our Directional Light) passes on its data to the Physical sky Sun settings. 
We can also see that these Sun settings coming from our Directional light, are put through to our Physical Sun Node. This node will make sure there is a disk of lava in the sky right where it is supposed to be, according to your Directional Light.

This info is then given to the SunShape, where the lightshader and photon emmiter are set up.

That's the basic setup of it all. These are all the nodes you'll need to tinker about with all the settings, if you need to at all. The default settings already give you a pretty decent render, and most of the time you won't need to change a thing, besides the direction of your directional light. 

However (there always seems to be a 'however' ....) I was noticing something different in my renders compared to when I build sunshine setup. Everything looked a bit washed out, pale, and in overall, not much color saturation was coming out of my textures. It wasn't a material issue, because rendering in another scene with the same materials did give me proper results. 



You can see everything is looking rather pale and uninteresting. In the end, I figured out why:
Gamma Correction.

Turns out, Mental ray assumes your texture files are Gamma neutral, but as most computer images are, they are at a gamma setting of 2.2, which is the standard for computer screens. As mental ray makes the wrong assumption, he will try to correct the gamma neutral images, and multiply the gamma by 2.2, so the output will have proper gamma. But they aren't. What happens now is that a texture image with gamma 2.2 gets an extra gamma correction on top of 2.2. So in order to fix this, we'll have to tell mental ray not to correct gamma, as there is nothing to correct.

Head back over to the mia_exposure_simple node, and open your attribute editor.
Here you can see the Gamma is set to 2.2. Correct this to 1, or whatever is needed to properly correct your texture files, and the colors will start to feel like colors again:


This of course means a darker image, but much more saturated colors in the final image. From here on out, I can continue tweaking my final gathering settings, lighting settings and materials until I get my desired lighting effect.

I hope this was helpful, and might save some people some time looking for the cause of their annoyances.

See you next time!

5 opmerkingen:

  1. How to create these step in Maya 2008 pls help
    Physical Sun and sky.

    BeantwoordenVerwijderen
  2. I don't have 2008 right here to test with, can you tell me where you get stuck?

    BeantwoordenVerwijderen
  3. When I try to render with physical sun and sky, wherever the sky is visible, though it shows up in preview renders as a blue sky, when I render to PNG, TGA or JPEG the sky doesn't show up. and areas where the blue sky should be are just transparent sections of the image, is there something I am missing?

    BeantwoordenVerwijderen
  4. I have an issue where after adding mr physical sun an sky, any oda light I add to d scene isn't rendering out with my sun. Is that a bug or am I missing something

    BeantwoordenVerwijderen