Wednesday 4 June 2008

technical: Sun and Sky test complete

I finally got the test to work and understand why it does!

I began with a few indistinct cubes to act as the 'buildings' or objects within the scene.


I then applied different coloured lamberts to the cubes, added a directional light source and set up the 'physical sun and sky' in Maya's mental ray globals. The file mia_physicalsky1 is added to the attribute editor. When renders are completed at this stage Maya has set up a horizon line and skyline automatically. The attribute Mia_physicalsun represents the sun and within that attribute, samples define the number of rays used for shadows. There is also options to play around with photons, colour and shadows amongst other things at this stage. The attribute mia_exposure_simple1 is automatically added to the camera to make the camera look the way the human eye sees.

By applying the shader mia_material to the cubes it is possible to experiment and create various combinations for render effects. This shader also has ambient occlusion built in (usually reserved for render layers to my knowledge). Ambient occlusion darkers corners and helps to exaggerate details in the geometry. These cubes do not have a lot of detail but they are quite close together so the shadows inbetween them would be quite dark if ambient occlusion is added. I decided to bump up the reflectivity of my cubes so they would mirror their surroundings slightly - making them look more plastic.


Here's a close up of the reflection of the red cube in the blue.


Mia_physicalsky has a built in haze attribute that when raised can achieve a foggy effect by diffusing the lighting of the scene.

By applying a high integer to the haze attribute there is a drastic red shift (above) in the light spectrum - making everything more yellow, red and orange.


By applying a high negative integer to the haze attribute there is a drastic blue shift (above) in the light spectrum - making everything more blue and purple.


Combining the effects of the sun and sky system in a render with a separate render of the scene's occlusion pass, a fantastic time effect can be created to show the passage of time passing either for sunrise or sunset depending on colours used in the background. This first video shows the first experiment and the second below it shows the same experiment with the sun and sky skyline in the background.






This system is definately worth using when animating scenes that have high quality environment or character models that have lots of detail in the geometry. Simple shapes like these cubes work for tests but the best results can be acheived using highly detailed models.

Using the sunlight on one of the Wunderland models, the following tests show how simply manipulating the main sun directional light can create easy to use shadows. The first test shows the light simply turning (erratically) and the second shows it turning up - obscuring the model from the light and simulating a sunset.

Shadow manipulation


'Sunset'

No comments: