Skip to content

Custom Shading Attributes

April 27, 2014

Using the information obtained from the study of real world surface properties of the apple and banana, the next task was to apply the surface knowledge to a 3D model of an apple and banana in Maya using the Mental Ray renderer. To effectively test the shader and lighting of the fruits, a studio lighting setup was used. However, before any lighting or texturing was done, colour management was enabled in the render global settings and in the render view so that the colours of the renders are consistent from PC monitor to PC monitor.This scene used linear workflow which included setting lights to a quadratic decay rate, enabling colour management, and gamma correcting colours that were not a pure hue. The first step in replicating the properties of the apple and banana was to set up the lighting. Before placing lights in the scene, a new ‘mia_material_x’ shader was applied to both the apple and banana models. The mia material was used as it is an energy conservative material designed to work with the Mental Ray renderer. To be able to light the scene efficiently and judge its effectiveness, the subjects that were being lighted had to have a flat colour on them with no reflections. Therefore, the reflectivity of the mia shader was put to zero, all other settings at default, and the colour of the shader set to the default grey. Working with one model at a time, I hid the banana model on a layer and worked with lighting the apple first.

In lighting the apple, a total of five lights were used. This included a key light for direct illumination, two rim lights to create an artistic halo effect, and two back lights to bring the apple out from the background. However, this same key light was also used to light the banana and background. The key light was placed at an angle to the left of the camera to create interesting shadows and to prevent the model from looking flat. Due to the shape of the apple model, I found it necessary to use two back and rim lights to get nice lighting around and behind the apple. The type of light used for the key light was an ‘Area Light’, whereas the rest of the lights used were ‘Spotlights’. Because the key light was an area light, ‘use light shape’ was turned on in the area light attributes to make the light a Mental Ray light. The key light intensity was 35, both rim lights had an intensity of 10, the left most back light had an intensity of 50, and the middle back light had an intensity of 40.

Apple lighting setup

Apple lighting setup

The rim and back lights had their shadows turned off and were also light linked to the apple model. When I was happy with the lighting of the apple, I moved on to the banana. I used the same method of hiding the apple its lights on a layer and worked solely with the key light, banana model, and background.

FG off, unified sampling quality at 0.25

No FG, unified sampling quality at 0.25

For lighting the banana, I used three back lights and the same key light used to light the apple and background. The three back lights that were used were spotlights and were light linked to the banana model and had shadows off. The back light closest to the banana had an intensity of 5 and the other two back lights an intensity of 20. Instead of creating a light specifically to act as a ‘fill light’, the ‘Final Gathering’ (FG) indirect illumination system was used. The size of the scene was quite small so there was no need to use ‘Global Illumination’ (GI).

Banana lighting setup

Banana lighting setup

FG off, unified sampling at 0.25

No FG, unified sampling at 0.25

FG off, unified sampling at 0.25

No FG unified sampling at 0.25

shaderPortfolio_016

FG on default settings, unified sampling at 0.25

shaderPortfolio_017

FG on default settings, unified sampling at 0.25, ambient occlusion on

Using ‘Ambient Occlusion’ created the effect that the apple and banana are sitting on the ground, this is because ambient occlusion uses distance to create shadow and works independently from lights. With the scene lit, the next step was to move onto texturing the models. For both the apple and banana I used procedural textures which were also gamma corrected using a gamma correct node so as to work with linear workflow. In regards to the mia shaders applied to each model, I used the information from my observations of a real apple and banana and applied it to the shader’s attributes.

Shading network for apple

Shading network for apple

Shading network for banana

Shading network for banana

I used the following settings for the apple stem mia_material_x shader:

Mia_material_x attributes for apple stem

Mia_material_x attributes for apple stem

The apple stem had most of the light being absorbed but still had some specularity present resulting in a weight of 0.9. The roughness was increased to give the material of the apple stem a more porous surface. Although most of the light of the apple stem was being absorbed, there was some reflectivity resulting in a 0.1 reflectivity value. To create a blurry refection, the glossiness was lowered to 0.45.

The following settings were used for the apple mia_material_x shader:

Mia_material_x attributes for apple

Mia_material_x attributes for apple

Using my study of a real apple as a guide, the weight was lowered to 0.8 as most but not all of the light was being absorbed. The roughness was increased slightly to accommodate the small amounts roughness of an apple. The apple does not have a completely sharp specular highlight unless it is polished, and therefore, the glossiness was lowered to simulate this.

The following settings were used for the banana mia_material_x shader:

Mia_material_x attributes for banana

Mia_material_x attributes for banana

The banana had a very high diffuse value resulting in a high weight value. The banana was not very reflective and had quite blurry soft reflections, therefore the reflectivity was lowered significantly and the glossiness at half.

With the textures applied to my shaders, the render then began to have colour bleeding occur from using Final Gather. In the render, the colour bleeding effect was too strong, however, because Global Illumination wasn’t being used, I could not simply lower the photon count. Instead, lowering the ‘Primary Diffuse Scale’ attribute under ‘Final Gathering’ in the ‘Indirect Lighting’ tab in the render globals resulted in a less harsh bleeding effect. This attribute was set to 50% or a mid grey which lowered the total amount of indirect illumination caused by Final Gather.

The colour bleeding effect too strong giving a glowing effect. FG on, unified sampling at 1.00, FG quality filter at 1,

The colour bleeding effect too strong giving a glowing effect. FG on, unified sampling at 1.00, FG quality filter at 1, ambient occlusion on

Final Render. FG on, unified sampling at 1.00, FG quality filter at 1, primary diffuse scale 50%

Final Render. FG on, unified sampling at 1.00, FG quality filter at 1, primary diffuse scale 50%, ambient occlusion on

The Final Gathering options I used for my final render is as follows:

shaderPortfolio_006

Final Gathering final render settings

To get a smoother anti-aliasing result, I used the ‘Gauss’ sampling option. Using a ‘Filter’ of 1 removed white spots which was occurring in the renders.

Unified Sampling settings for final render

Unified Sampling settings for final render

 

 

Advertisements

From → Rendering

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: