Friday, February 22, 2008

Artefact Three - Object Lighting (Part 4)

CAUSTICS

Caustics are produced by rays of light that are reflected or refracted by a curved surface or an object, or the projection of that envelop of rays on another surface. (Wikipedia Caustic - Optics). The example to show this below is a glass with some wine stored inside. Note that the light present in the room casts a shadow of the glass onto the surfaces behind it. There are also bright streaks of light that pierces the shadow and these are the caustics created from the glass and wine.




The next stage of the artefact is to assess how to create caustics within 3DS Max, the reason being that it can be used in my future projects so that my scenes can follow real world lighting. After reading extracts from ‘Rendering with Mental Ray & 3DS Max’ by Joep Van Der Steen, the best way to create caustics is to use the Mental Ray rendering engine. The reason being is that it calculates distributed photons, global illumination and this analyses where caustics should be projected.


The scene that I will be creating to experiment with caustics will be a glass on a plane. The glass material for the glass will simply be a Raytrace material on the refraction map (for photon mapping).


The object properties are vital for caustics. The user must assign what object will generate caustics (the glass) and what object will receive them (the table). To find these settings, the object should be right clicked – object properties – mental ray. From here the appropriate checkbox should be enabled or disabled.


The image below shows where the objects and lights have been placed for the scene.


The final amendment that is needed for the scene before caustics can be created are the settings in the rendering setup. As the mental ray renderer has been enabled there is a ‘Caustic and Global Illumination’ area in the ‘Indirect Illumination’ tab. This is where it all happens. Enabling caustics here will then render them in the scene.


Below is the rendered scene. Note that the light has cast a shadow of the glass onto the plane and the bright caustic areas have also been projected.


The next stage was to enable global illumination (the check box in the rendering setup). This intensified the caustic areas and some scattering has also occurred.


A simple box has been placed behind to see what effect this would have on the caustic projected from the glass. We know that in the real world that shadows will hit an object like it does in this scene. We can also see that the caustic follows this pattern of the shadow, however it can be seen that the caustic has intensified on the box.


The next part was to see how changing parts of the scene can affect caustics. The first change that was tried was to add some liquid into the glass. Below you can see the glass is just over half full and the caustic has been altered to a specific area to the far right of the picture. Also the light has also reflected back toward where the light source has come from, to the left of the picture there is a small arc of light that can be seen.



The next change was to alter the light source, throughout the experiment so far the light source has been an Omni light. The amended light has been placed in the same area as the previous lighting to remain consistent.



The image above on the top has a spotlight light source facing the glass. The caustic has spread out and is dotted to the right of the scene. The image on the bottom has a skylight and the only caustic is the reflected one to the left of the image however it has increased in size from the Omni light earlier in the experiment.

My final change to this scene is to see how caustics are affected by using a different shaped glass. Using a more traditional shaped wineglass the image below is of the newly rendered scene. Note : the lighting was exchanged back to the original Omni setup.