In this tutorial we are going to look at an additional method to achieve indirect illumination with mental ray.
Global Illumination with Photon Emission
What is the difference between final gather and global illumination?
Actually you do not really want to use global illumination without using final gather as well. Global illumination is simply a more efficient way to spread the light around a scene. Final gather is still required to smooth out the final result.
- Go to file>Open Scene and choose the cornell_GI.ma file. (This will be in the mentalRay project provided in the first mental ray tutorial)
- You should see a scene that looks a lot like the cornelBox from the final gather exercises. However this time we have an area light over the hole in the ceiling and no spotLight or pointLight.
If we render this scene as is, this is what we get. (see image below)
As you can see, the direct illumination from our area ligt more evenly spreads through the cornell box, but it creates a really hot spot on our sphere. Let's setup some GI to see what we get?
You should see a scene that looks a lot like the cornelBox from the final gather exercises. However this time we have an area light over the hole in the ceiling and no spotLight or pointLight.
- Open your render settings. In the Indirect Illumination tab scroll down to the Global Illumination section. Enable Global Illumination.
- Select the area light and open the attribute editor.
- Scroll down to the mental ray section of the attribute editor and swing it open. Enable the following check boxes.
This makes the area light a mental ray area light (more efficient)
This enables the emission of photons for global illumination calculation
This removes the effect of the original direct illumination from the area light.
- Do a quick render to see what we get. (see below)
I don't know about you, but I think I need to find some bell bottoms and platforms to get this disco party started!!!!
Ok, all weirdness aside you can atleast see what is happening. There are some photons that are picking up energy from the green wall, red wall and white walls and carrying those colors onto other objects. Aside from the crazy splotchiness it is atleast doing what we want. Lets adjust some settings and get this working better.
- Open your render settings and make the following changes to the global illumination section.
* What this does is increases the accuracy of the photon emission and increases the radius of each photon to 2. This smooths out the GI pass significantly.
- Select the area light and scroll down to the mental ray section. Make the following changes to the caustics and global illumination section.
* Our innitial intensity of 8000 was a bit too bright for this small space. By decreasing the intensity of the photons to 2000 it tones that down a bit.
* We also increased the Global Illum Photons to 100000 from the 10000 it was. This is the overall amount of photons that get emitted during render time.
- Render it and see what we have.
* Ah, much better looking, but somehow it is just not as 'funky' :-)
* This is pretty good spread from the GI. Like I stated above, the GI is simply the means to spread the light around a scene. We still need final gather to smooth it all out, and introduce the sampling of our white environment.
- Open your render settings and go to the mental ray tab.
- Scroll down to "Final Gathering" and enable it with ab accuracy of 100.
- Do another render and lets see what happens.
* Muuuch smoother. However it looks a little dark, and the bleed is a bit intense. Lets fix that shall we?
- First let's brighten things up. Open the attribute editor for the areaLight and scroll down to the caustics and global illumination section.
- Increase the photon intensity to 4000.
- Next we need to tone down the bleed effect of the GI from the colored shaders.
- Open the hypershade and select the blue lambert shader.
- In the attribute editor for the blue shader, scroll down to the mental ray section and swing it open.
- In the photon attributes section uncheck the "derive from Maya" box.
- Then click the "Take Settings from Maya" button.
Notice how the attributes here change to match that of the shader. Specifically that the color is now blue.
- Adjust the new Blue color channel to be more of a light bluish gray.
- Repeat steps 14-18 for the Red and Green lambert shaders as well.
- Now lets do a render to see how our increased photon intensity and lessening of the color bleed looks.
Not too bad. Some more work could still be done to lessen the bleeding and make it a bit less splotchy, but overall a good GI pass.
What I want you to do now is create your own room that has a sky light and an open window. (These can be just holes in the model like our cornell box). Either create a new simple model or import one of your models from a previous chapter and place it in the room. (You can do more than one if you wish). Create and assign some different shaders on walls and objects. Then follow the steps outlined in this tutorial to create your own renders that use GI and final gather for overall global illumination lighting.
I Again want to see good looking renders here.
You must include the following settings/elements in your render
- Atleast 2 photon emitting lights.
- Enough photons to adequately fill the room, but still efficient.
- The final gather should eliminate all splotchyness, if there are splotches I will count points off.
- Your shaders should have their color bleeding adjusted to lessen the effect.
- Render your final image to 1280x720