using sun and sky in mental ray_nice
TRANSCRIPT
![Page 1: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/1.jpg)
Using Sun and Sky in Mental Ray Written by Dzordz Sunday, 22 April 2007
Article IndexUsing Sun and Sky in Mental Ray Page 2
Page 1 of 2With Maya 8.5 Mental Ray got some new fancy options and modes. One of them is Sun and Sky system. I’m going to guide you through some of new features.
So create simple terrain, and some object on it. I created high tech tower, but you can make whatever you want, just add some small details, because I’m going to show you how to make them more obvious.
![Page 2: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/2.jpg)
So for start you’ll need to load Mental Ray. To do that go to window/settings preferences/plug in manager. Enable Mayatomr.mll
![Page 3: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/3.jpg)
In render globals choose Mental Ray. In Mental Ray globals, you can see environment tab. Hit Create Physical Sun and Sky.
![Page 4: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/4.jpg)
In attribute editor, mia_physicalsky1 will appear. There are menu options, I’m going to show you only few most important.
![Page 5: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/5.jpg)
Also there’s directional light in the scene. This light controls the direction of the sun and also the time.
![Page 6: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/6.jpg)
If you render, you’ll get something like this.
![Page 7: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/7.jpg)
In quality presets choose previewFinalGather. This will set sampling little higher than draft.
![Page 8: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/8.jpg)
On sunDirectionShape, in custom shaders tab, you’ll se that light has light shader, and photon emitter connected.
![Page 9: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/9.jpg)
Mia_physicalsun defines the sun itself. Samples define the number of rays used for shadows. Increase this number if there’s noise in shadows.
![Page 10: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/10.jpg)
In hypershade, you can see all shaders used in Sun and Sky system. There’s mia_exposure_simple1 applied as lens shader on camera. This node remaps colors to the way human eye sees. In Mental Ray all intensities are in linear space. Human brain sees color in different way. Basically it’s logarithmic function. That’s why gamma is 2.2. That’s the way we see, same thing for all photographs. So if you apply texture to objects you will get something like this:
![Page 11: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/11.jpg)
![Page 12: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/12.jpg)
![Page 13: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/13.jpg)
Using Sun and Sky in Mental Ray Written by Dzordz Sunday, 22 April 2007
Article IndexUsing Sun and Sky in Mental Ray Page 2
Page 2 of 2
It’s washed. Why? Because texture has gamma 2.2. The way we see it. So Mental Ray uses texture with gamma 2.2 in linear calculations of light intensity and then it converts it to gamma 2.2 so we can see it right. So gamma 2.2 is applied twice. That’s why texture is washed. How to fix it? Simple use gammaCorrect node. Apply gamma 0.454 to image. In that way it gets linear. Then renderer applies gamma 2.2, and it looks good.
![Page 14: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/14.jpg)
In new mental ray, there’s also new shader called mia_material. It’s shader with lots of options,
![Page 15: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/15.jpg)
like glossy reflections, built in ambient occlusion, interpolation optimizations…
Apply that material to the tower.
Apply texture with gamma correction
![Page 16: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/16.jpg)
Also set reflectivity to 0. We are not going to use it in this tutorial.
![Page 17: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/17.jpg)
Also one important thing about new Mental Ray. Final Gather has new options, now it works pretty fine with low accuracy settings (same as rays in earlier versions), point density defines how big will be Final Gather radius. With 50, 0.1 results can be pretty nice and fast.
![Page 18: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/18.jpg)
![Page 19: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/19.jpg)
The thing I wanted to show about mia_material is built in ambient occlusion. So now final gather is used to get overall ambient lighting and ambient occlusion will darken corners, so details will appear. Ambient occlusion has few options. Rays define accuracy; raise it if you have noise. Distance defines how far ray will try to find occluding geometry.
![Page 20: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/20.jpg)
So without ambient occlusion
![Page 21: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/21.jpg)
And with ambient occlusion
![Page 22: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/22.jpg)
Also in mia_physicalsky, there’s haze attribute. Raise it to get foggy diffuse lighting.
![Page 23: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/23.jpg)
Red/Blue shift attribute controls the balance between blues and reds. Negative values mean more blue and positive more red.
![Page 24: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/24.jpg)
![Page 25: Using Sun and Sky in Mental Ray_nice](https://reader035.vdocuments.mx/reader035/viewer/2022081507/55258a984a7959a7488b4bd5/html5/thumbnails/25.jpg)