Skip to content

Custom Shading Attributes

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

Painting an Apple

To paint an apple, the method of ‘pulling focus’ was used, where the initial stages of the painting are blocked using large brush sizes with very little detail to using progressively smaller brush sizes to create more detail.

The easiest way to paint an apple is to actually obtain a real apple and study its surface properties. This allows you to think about the surface before starting to paint and allows you to get closer to a photorealistic image. To begin the painting, a new in document was created in Photoshop with dimensions 2048 by 2048. Then using a real apple as a reference, I started to sketch an outline of the apple which was going to be used as the template for the painting. This sketch was done using a ‘pencil’ brush with a light grey colour which acted like a real pencil.

appleTest_01

step_01 Outline sketch

After the outline of the apple was done, the details of the apple were also sketched in on a new layer as another guideline for where the paint will be applied. The sketch had to be quite accurate so that painting would be easier.

appleTest_02

step_02 Sketch details

appleTest_03

step_03 Stem sketch

A layer was then created above the sketch layer which was used for the underpainting of the apple. Using a ’round blunt medium stiff’ brush, the apple colours were blocked in. At this point in the painting, the placement of the colours had to be correct as they will set the foundation for the rest of the painting.

appleTest_04

step_04 Underpainting

The next step was to refine the blocking of the apple and begin to create the streaks of red and yellow that are apparent in the apple. To create this effect, the direction in which you are painting this scratchy texture is very important. You want to match the contours of the real apple, so therefore by paying attention to where the contours are and making a mental note of where they are, you will be able to easier follow that same contour in your painting. A new layer was created for this mid-pass, and using a ’round curve low bristle percent’ brush with a lower ‘bristle’ and ‘thickness’ value in the brush settings, the scratchy apple texture was painted. The ‘thickness’ of the brush was also increased in addition to using a 60% brush opacity with the ‘transfer’ attribute turned on in the brush settings. The brush pressure button was also turned on in the top toolbar of Photoshop with the brush selected.

appleTest_05

step_05 Mid-pass

A new layer was created after this for the refining pass of the painting. This was done using a ‘flat point medium stiff’ brush. The refining pass consisted of cleaning up the brush strokes on the apple and matching placement of colours better.

appleTest_06

step_06 Refining

After this, a new layer was created for details and texture such as the little yellow spots that overlap the red colour of the apple.  This was done using a spatter brush with various brush sizes from medium to small and a mid to low brush opacity.

appleTest_07

step_07 Details

The panting of the apple at this stage didn’t look much like the real apple I was referencing. To rectify this, the large solid colours of the apple in the painting were ‘broken’ up to create the randomness of the streaky pattern of yellow and red. This was done using a combination of small ‘hard round’ brushes and the eraser tool. Random patterns were scribbled to create a random apple texture, then a ‘spatter’ eraser with a mid to low opacity was used to break the pattern up even more.

appleTest_08

step_08 Creating more details

The apple at this point was fairly close to completion, however instead of merging all the layers, a new layer was created and on the new layer, the ‘apply image’ setting was used with the default settings from the ‘Image’ menu in Photoshop’s toolbar. This tool creates duplicates of all layers and then merges it and apply it to the new layer whilst still keeping all your old layers. However, the layers that I did not want in the merged layer had their layer visibility turned off. The layers with the initial apple sketch were hidden.

appleTest_applyImage

Using apply image

Then on this new layer, the apple was cleaned up around the edges using a ‘hard round’ eraser.

appleTest_09

step_09 Cleanup

A new layer was created above this layer where the darker red colours on the bottom of the apple were painted in in addition to painting in the apple stalk.

appleTest_10

step_10 Apple bottom details

appleTest_11

step_11 Stem overpaint

Then finally to finish the painting off, on a new layer, using a ‘soft round’ brush and a ‘spatter’ eraser, the highlight of the apple was painting in. The eraser was used to break the highlight up slightly.

appleTest_12

step_12 Highlight painting

Skin Texture

The process of painting skin in Photoshop is similar to the method used to paint fur. By slowly blocking in random brush strokes, the variations in skin can be produced. For this particular skin texture, the skin being painted is that of Caucasian skin.
To start this painting, a new document of 2048 by 2048 pixels with a 300 pixels/inch resolution was created. Using the ‘paint bucket tool’, the background layer was filled with a orange/brown base colour.

step_01

step_01 Fill background layer

Above this layer is where the subsurface skin was painted.  On the foreground colour swatch a darker value of the base colour was chosen, along with a slightly lighter value of the initial base colour for the background colour swatch. Then when painting the subsurface skin, the background and foreground colour were constantly switched whilst painting to provide more variation in the tone of the skin. The swapping of colour swatches was done by using the keyboard shortcut ‘x’. On a new layer, using a speckled brush with 23% opacity, a random skin texture was painted.

step_02

step_02 Subsurface skin painting

The next step in painting the skin texture was to add in the capillaries. On a new layer, using a speckled brush with some texture at an opacity of 23%, random brush strokes were painted using a darker version of the dark colour used for the subsurface skin layer. A variation of brush sizes were used to give the capillaries more variation. Then to add some depth to the texture, a ‘bevel and emboss’ and ‘contour’ was applied to the layer. This was done by double clicking on the layer to bring up the layer style menu. The following settings were used on the bevel and emboss:

step_03

step_03 Adding capillaries

capillaries bevel and emboss settings

capillaries bevel and emboss settings

skinTexture_contourSettings4All

capillaries bevel and emboss settings

On a new layer above the capillaries, the veins were painted in. The veins were painted using a ‘hard round’ brush at 50% opacity and with the pressure sensitivity button on. The size of this brush was roughly a medium sized brush, and using a bluish/greenish mid-tone colour, the veins were blocked in. The pressure put on the tablet pen was reduced as the brush stroke to make the vein was ending. This gives the impression that the vein ‘pops’ up in some areas and then blends back into the skin like real veins. Then by lowering the size of the same brush and using a slightly darker blue/green, the main area of the vein was painted in the middle of the blocking pass.

step_04

step_04 Painting veins

To make the veins have depth, the ‘bevel and emboss’ was used again with the following settings:

vein bevel and emboss settings

vein bevel and emboss settings

skinTexture_contourSettings4All

vein bevel and emboss settings

At the moment, the skin colour is too dark, and so to fix that, a new layer was created above the vein layer. On this layer, the canvas was filled with a milky pink/orange skin colour. Then the layer blend mode was set to ‘screen’. This is to make the skin colour pale as a screen blend mode is an add operation and thus creating a lighter result. The layer opacity was then lowered to 58% so that the layers underneath would come through the filled canvas.

step_05

step_05 Layer with screen blend mode

Above this layer is where the pores of the skin was painted. Using a spatter type brush with the ‘scatter’ brush setting on, and opacity pressure on, the pores were painted in a dabbing motion of the pen.

step_06

step_06 Painting pores

The layer then had a layer style of ‘bevel and emboss’ using the following settings:

pores bevel and emboss settings

pores bevel and emboss settings

skinTexture_contourSettings4All

pores bevel and emboss settings

The pores were too prominent, so the make them more subtle, the layer opacity was lowered to about 50%.

To make the skin texture more realistic, a new layer was created to paint the sun damage on the skin. Using a ‘soft round’ brush with a medium to low opacity, the opacity pressure button on, and a light saturated orange, random spots were made in a circular motion. Only a few brush strokes were made so that the skin was not completely covered with sun damage. The layer blend mode was set to multiply so that the layers beneath would come through and so that the paint went on the sun damage layer would be darker than the skin. However, the sun damage looked to obvious which made it look like it was paint and not realistic skin. Therefore the opacity was lowered to around 60% to make the texture subtle.

step_07

step_07 Sun damage

The final step in the skin texture was painting in freckles. The freckles were made using a brush that created random dots with various sizes. However, this same effect can be produced using a ‘soft round’ brush with a high ‘spacing’ value and using the ‘scatter’ setting on with ‘shape dynamics’ also on. Then using a light redish brown colour, a small section of freckles were painted in. The layer opacity was then lowered to around 60% to help blend the freckles in with the rest of the skin.

step_08

step_08 Freckles detailing

Study of Real World Surface Properties

To create realistic renders of real world objects in three dimensional programs such as Autodesk Maya, the surface of the object must be studied to understand the various properties of the surface and to understand how light affects the surface. By understanding these properties, the objects properties can be replicated in 3d to provide a realistic render. The surface properties of an object can be put in categories:

• colour
• diffuse
• refraction
• specularity
• gloss
• transparency
• translucency
• reflectivity
• surface

Colour simply means the overall colour of the object’s surface, that is, whether the surface is red, green, blue, etc.

Diffuse refers to how much light the surface absorbs. It is related to and affects colour. A high diffuse value means the surface absorbs a lot of light and is more matte. A high diffuse value will also mean the surface will have either a pure hue (colour) or close to one. A low diffuse value however, means the surface doesn’t absorb much light and therefore reflects it, which in turn means the surface has little or no colour. Any colour you see on the surface will actually be the reflections of the light and environment.

Refraction refers to how light bends when hitting a surface and passing through it. This can only occur on surfaces which are transparent.

Specularity refers to the highlights on a surface, its shape, size, colour etc.

Gloss is the roughness or softness of the specular highlight. That is how sharp or blurry the highlight is.

Transparency is whether the surface is see-through. Not opaque.

Translucency is whether light can pass through the surface but is opaque. For example if you put a piece of paper to a light and put your hand behind the paper on the side of the light. You cant see through the paper, but light can pass though it allowing you to see things behind it.

Reflectivity refers to how much of the environment is able to be seen on the surface. That is, how much light is being bounced back by the surface. Reflectivity is dependent on the angle of view.

Surface refers to the texture of the surface, how bumpy, rough, or smooth the surface is.

Surface type: Apple

Colour: The main colour of the apple is red with some dots and streaks of yellow. There are multiple values and of the red colour. A large amount of the apple is covered in the darker values of the red.

Diffuse: The apple has a fairly high diffuse value as most of the light hitting surface is being absorbed. However it is still reflecting some of the light.

Refraction: The apple has no refraction value as it is not transparent.

Specularity: The apple has specular. Its specular highlights on the main body of the apple is small to medium round. On the top of the apple, near the stem, the specularity is seen as horizontal streaks. The size and intensity of the specularity is dependent of the surrounding light source and angle of view. It has a white specularity.

Gloss: The glossiness of the specular highlight is slightly blurry. It is also quite noisy.

Transparency: The apple is not transparent and is completely solid.

Translucency: The apple has no translucency.

Reflectivity: The apple has a low reflectivity value as most of the light is being absorbed.

Surface: The apple is not completely smooth. It has a slight rough texture to it. The areas  that have yellow are slightly rougher than the areas with red.

DSC02014 DSC02015 DSC02016 DSC02018

 

Surface type: Banana

Colour: The banana has various shades of yellow and a slight amount of grey/brown and green. It also has brown coloured dots covering the sides.

Diffuse: The banana has a very high diffuse value. It has a very small amount of light being reflected in the stalk and body of the banana.

Refraction: The banana has no refraction as it is opaque.

Specularity: There is little to no specular on the banana. On the stalk there are small white horizontal specular highlights.

Gloss: The gloss on the stalk is quite blurry.

Transparency: The banana is opaque and therefore has no transparency.

Translucency: The banana is not translucent as no light is able to pass through it

Reflectivity: The banana has a very low reflectivity value. A large majority of the light is being absorbed by the surface.

Surface: The banana is very smooth, however areas where there has been oxidation and there are brown dots create a bumpy texture. The dots have created small indents in the skin of the banana.

DSC02021 DSC02022 DSC02025 DSC02024

Painting Fur

The process of painting fur in Photoshop utilized everything I have learnt from the last few painting exercises from creating and editing brushes to painting methods. This texture was created using a Wacom pen and tablet. Firstly, a new document was created with dimensions 1024 by 1024 pixels with a pixel resolution of 300. Using the ‘paint bucket tool’, I filled the background layer with a slightly darker than mid range grey colour. This will act as the base colour for the fur texture.

furTexture_step01

step 01

Next, a new layer was created above the background layer. On this layer I used the ‘flat blunt stiff’ brush from the calligraphic brush library in Photoshop to create the underpainting. However, the brush attributes were altered to make the brush create multiple strokes with different shades of grey to simulate the variations of texture in fur. In the ‘brush tip shape’ options in the brush menu (f5), the bristle qualities were changed to the following:

furBrushSettings_01

The ‘colour dynamics’ box and the ‘transfer’ was ticked on and the following settings were used:

furBrushSettings_02

furBrushSettings_03

furBrushTesting

Testing the fur brush

Then in the top toolbar of Photoshop where the brush properties are located, the ‘flow’ was set to 10% with ‘opacity’ at 100%, brush size of 48 pixels, and with the ‘opacity pressure’ button clicked on. The brush was then saved as a new brush preset for future use. The foreground brush colour was set to a dark grey and the background brush colour was set to a light grey. This was done so the colour dynamics of the brush would create a range of brush strokes between the two grey colours. Then whilst keeping the Wacom pen in an upright position, I began painting horizontally, in a random pattern whilst also applying different amounts of pressure on the pen to change the darkness and lightness of each stroke.

furTexture_step02

step 02

The first initial pass of the underpainting was too sharp and needed to be toned down in a way. So, to do this, a ‘motion blur’ filter was used on the layer with an angle of 0° and a distance of about 20 to 30. This allowed the fur to blend more and hide the brush strokes of the painting.

furTexture_step03

step 03

On a new layer, the mid-paint for the fur was created using the same brush just created, but with a few more attributes altered as shown below.

furMidPaintBrush_settings

This brush was also resaved as a new brush for future use. Then using this brush, following the same direction as the underpainting, I filled in some areas with some horizontal strokes to fill some gaps in the fur.

furTexture_step04

step 04

The next step was to start adding details to the texture by creating an individual hair stamp. The ‘hard round’ brush was selected from the brush library and in the brush menu, under the ‘brush tip shape’ options, change the hardness to around 80%, turn on ‘shape dynamics’ and set the ‘size jitter control’ to ‘pen pressure’ from the drop down menu. Change the flow of the brush to 80%, use 100% brush opacity, and change the size of the brush to 70 pixels. Hide all the layers, then change the fore colour of the brush to a dark grey and on a new layer, draw a slightly curved line that looks like a hair follicle. Try to get a nice even pressure throughout the stroke so there are no bumps in the stroke. This layer was only used for testing purposes and deleted after it was not needed.

singleHairBrushTesting

Brush stroke testing

Then when I was happy with a brush stroke, a large ‘soft round’ eraser with the opacity at 80% was used to make the ends of the stroke softer. Then the transparency of the layer was locked by clicking the ‘lock transparent pixels’ button on in the layers panel and using a ‘soft round’ brush, the tips were made slightly darker using a darker grey. Using a ‘hard round’ eraser at opacity 100%, the tips of the brush stroke were sharpened to get a tapered point. Then the brush stroke was selected using the ‘rectangular marquee tool’ and then defined as a new brush preset. On a new layer the hair follicle brush that was made was used to create individual hair strands. This was done by tapping the brush around the canvas instead of using consistent, long brush strokes.

furTexture_step05

step 05

The next step was to create another brush that would give continuous strands of hair. This was done by editing the attributes of the hair follicle brush in the brush menu. The following settings were used:

continuousHairBrush_settings01

continuousHairBrush_settings02

continuousHairBrush_settings03

In addition to the brush settings, the size of the brush was 174 pixels with a brush opacity of 78% and flow of 45%, and both pressure buttons on. The brush was then saved as another brush for future use. Then on a new layer, the continuous hair follicle brush was used in a random fashion to add more detail to the fur texture.

furTexture_step06

step 06

Rough Stone Texture

To create a rough stone texture, the same process of ‘pulling focus’ was used just like the marble texture. The texture was made using a Wacom pen and tablet. A 2048 by 2048, 300 pixels/inch resolution document was opened in Photoshop. On a new layer, I used the ‘paint bucket tool’ and filled the layer with a mid-tone, low saturation, neutral blue.

roughStone_01

step 01

When painting stone, it is best to use cool netural colours like blue. Then on a new layer, a darker value colour of the fill colour was selected, and using a brush that will create a random pattern, I did the underpainting for the texture. The underpainting was created by randomly blocking in shapes that represented the rough texture of stone.

step 02

step 02

Using the same brush but with a smaller size, cracks were painted in on a new layer.

step 03

step 03

On another layer, more details of cracks and crevices were painted in using variations of the colour chosen at the beginning of the painting.

roughStone_04

step 04

Then on the final layer, dark shadow areas of the stone were painted in.

roughStone_05

step 05

On the layer where the cracks and crevices were painted, I used a ‘layer style’ of ‘bevel and emboss’ with the bevel direction set to down to add some depth to the texture. This was done by double clicking on the layer with the cracks and selecting ‘bevel and emboss’ from the menu.

step 06

step 06

Marble Texture

The process for the marble texture was painted in Photoshop using the ‘pulling focus’ technique where big brushes are used to block in very rough colours and values, then progressively using smaller brushes to refine and add detail. Pulling focus comes from the idea that the painting in its initial stages is out of focus, then as detail is added using smaller brushes, the painting starts to come into focus revealing the complete image. This texture was made using a Wacom pen and tablet.

In a new document 2048 pixels by 2048 pixels, the first blocking stages of the marble texture was created. This was done using a large sized ‘soft round’ brush with the ‘texture’ attribute on in the brush menu. The texture pattern used in the brush was one created earlier from a traditional paint swatch. The texture pattern was tested until I was happy with the effect it was giving me.

patternTesting_02

Testing the pattern

The brush used for the blocking stage also had an opacity of 30% and flow of 70%. A neutral, low saturation blue colour was chosen for the blocking stages of the texture. Using the brush tool, I painted in a random pattern trying to simulate the look of marble.

marbleTexture_01

marble step 01

A new layer was then created and using the same brush but a smaller size, with an opacity of 50% the veins and cracks were painted.

marbleTexture_02

marble step 02

A new layer was created on top of the veins layer to create more texture using the brush with a low opacity and increased brush size.

marbleTexture_03

marble step 03

More details were painted by creating a new layer and using a darker blue colour with a small brush size to bring out some areas of the marble. The ‘smudge tool’ was used at the end to blend some of the areas which I thought needed to be toned down.

marbleTexture_04

marble step 04