Friday, February 22, 2008

Artefact Three - Object Lighting (Part 5)

Photon Mapping

3DSmax uses photon mapping when calculating caustics. This procedure allows max to trace rays from a light source until it hits an objects surface, it is then given a luminance value (a calculated amount of light that either passes through or emits from a surface). It is used to realistically simulate the interaction of light with objects. Photon mapping takes most of the time when rendering a scene, it calculates then simulates
A cheap way of creating caustics is max is by using a coloured shadow and a falloff map that creates the transparency that a glass objects possess. Thus the light that is refracted from it can be combined to create this ‘fake’ caustic effect. A scene made in 3DS Max was created with a glass cylinder in a room. Firstly the glass material has been given a blue diffuse colour (this could be any colour) so that later on the caustic effect can be seen over the blue colour.


Raytrace has been used for the refraction map, this gives the cylinder the transparency to make it look like a glass material.


Placing a spotlight into the scene directed at the glass object if the scene was rendered now it would not have a shadow because ‘shadow maps’ is currently assigned to the spotlight and they ignore transparency which is not what is needed when creating caustics. For this ‘raytrace shadows’ needs t be assigned to the spot light.
Below is the rendered scene, notice that the shadow is blue due to the shadow parameters of the light have been changed to blue. Otherwise it would be standard black/dull grey.


Now to create the fake caustic another light needs be placed into the scene and should be placed near the previous light. Below is where the light created has been placed.


The first light created has a blue shadow colour parameter – this to follow the colour that the glass tint has. The new light however needs a white colour shadow – this follows the normal caustic colour of white light. The other parameter that has been changed is the shadow density to a larger one. If left as the previous, the caustic effect will scatter to the whole refracted area and nothing would be seen. The resulted changes can be seen in the rendered scene below.



Notice that the density has been altered to a higher 2.5. The larger the density the stronger the white coloured caustic will be. However to overpowering will result in an unreal look as the white light would seem to pass straight through the glass cylinder and not been refracted at all!


The shadow density of the second (caustic making) light has been set to 10, this looks unrealistic as it does not look like the light has been refracted but has just simply passed through the cylinder.
Here, more objects with the same glass properties have been placed into the scene to see how the caustic simulation reacts to the differentiating shapes.


Finally to see how this fake caustic effect measures up to the previous experiment, the glass used previously will be placed into this scene. Below is the outcome of the experiment. Note that the light colour and the material colour has been issued a white colour to make the material look as close as possible to the previous experiment.


Evaluation
In 3DS Max the standard default renderer (Scanline Renderer) allows a scene various methods for simulating reflections and refractions. The most accurate methods are usually the most expensive time wise. In max the user controls the amount of highlights on a material using the specular controls such as glossiness and the amount of shine. Alongside this the material can also have a reflection map added to it, allowing the environment around the material to be reflected onto it from a light source. Using a raytrace material I found out that this method produces most accurate results, granted that the rendering time is partially slower the resulted renders output come out well. The output given does not always necessarily need to be accurate, for example the reflected light on the pool ball experiment and the results given suggest that real world simulation can be faked with 3DS max to achieve the same outcome. Not only does this save on render time and patience but also how people perceive or take for granted how light works on a simple surface. Compared with real world lighting we generally refer an objects specular characteristic as a simple reflection from a light source. The Scanline Renderers lighting is global and this means that this infinite light illuminates objects from every point. Real world lights however do not do this, the light comes from a source point such as a bulb and this can be adapted well in Max by using various lights such as spot or Omni lights.

Conclusion
Mental has certainly been experimented with in the past two artefacts on various tests, it does seem that this rendering system is of a higher standard than the default Scanline renderer. It can be seen why it is used in the industry today, and gives excellent results especially for realistic output. Another rendering system that is also used in the industry is Vray, a more costly option in terms of price I shall investigate what sort of output this creates as well as why this differs (if it does) to the mental ray.