n a t u r e    m o r t


This page shows the results of applying a custom surface shader, written in the RenderMan Shading Language, to a Maya scene in order to create the illusion of decay and rotting.



Reference footage

CG banana




For all practical purposes, I could have used a cylindrical UV mapping technique since a banana's geometry is pretty simple.

However I wanted to explore pelting techniques so that I would have some more experience when it came to unwrapping

more complicated models. It used to take me hours to unwrap a model. With this tool, it now takes a few mouse clicks and just

a few minutes (minus the tweaking done afterwards, but that's minor.) This concept of evolving digital techniques in regards to speed

(days-to-hours-to-minutes) will be addressed in my thesis. After modeling the banana, I used a free pelting tool developed by

Sunit K. Parekh. He has a pretty impressive demo reel and has worked on feature films like Hellboy, Blade Trinity, LXG, and

Matrix Reloaded. The tool is available at http://sunitparekh.com/pelting/ and I recommend taking a look at the work he's done.

 

			
			


In regards to pelt mapping, the first step was to decide where you want to cut your mesh for the initial unwrapping.

 

			
			


 

 

 

 

 

 

 

 

 

 

 

 


 

 

 

 

 

 

 

 

 

 

After that I used Parekh's plugin that pulls at the mesh as if it were cloth. The movie above shows just how easy it is,

and you get no UV distortion.

 

			
			


As you can see, the initial UV unwrapping creates a lot of wasted texture space in the 0 to 1 coordinate system.

Wasted space means you aren't getting the most detail possible out of your texture. Opinions vary, but I know

gaming companies frown upon this.

 

			
			


It's often difficult to manipulate your UV's into a perfect square, but for the basic banana geometry, it was relatively simple.

Maya 8's new UV features make the process easier. The UV mapping is now done, and the whole process took roughly

5 minutes to get a very clean result.

 

			
			
Banana Diffuse Map Napkin Texture

The banana diffuse map and napkin texture can be seen above.

 

			
			
Rot Map Comparison

I used ZBrush to paint the texture maps which determine where the banana will rot. As you can see, the black (rot) areas

start off small and then quickly grow. My shader is actually written so that white areas allow the cell-noise (rot) to be seen,

but when painting objects black in ZBrush, you loose all sense of geometry depth. One solution is to invert these maps in

Photoshop after they are painted.

 

			
			
Tif Channels

The image above shows the rot texture maps placed into the channels of a .tif image.

Smoothstep() is used to transition from one channel to the next so that the rotting

occurs at different places at different times.

 

The code below shows how I accessed the various .tif channels.

if(time <= 0.20) 
      decay_area = mix(0, texture(rotmap[0]), 
      smoothstep(0,0.20,time));      
else if(time > 0.20 && time <= 0.4)          
      decay_area = mix(texture(rotmap[0]),                     
      texture(rotmap[1]), smoothstep(0.2,0.4,time));      
else if(time > 0.4 && time <= 0.6)          
      decay_area = mix(texture(rotmap[1]),                     
      texture(rotmap[2]), smoothstep(0.4,0.6,time));      
else if(time > 0.6 && time <= 0.8)         
      decay_area = mix(texture(rotmap[2]),                 
      texture(rotmap[3]), smoothstep(0.6,0.8,time));     
else if(time > 0.8)          
      decay_area = mix(texture(rotmap[3]),                 
      texture(rotmap[4]), smoothstep(0.8,1.0,time));
			
Tif Channels

When writing my shader, I created a linear progression that moves through the .tif channels, but the banana hardly rots at the beginning

and then quickly rots at the end. As a result, I used the Maya animation graph editor to control the rate of rot. This image depicts the

progression of the rot area, rot spot radius, and displacement amount versus time.

 

			
			
Shader Palette

Here's my slim palette and my banana shader.

 

 

The function [mattr "(meshname).(attributename)" $F] allowed me to

use Maya's keyframing tools. Very handy.





The code below creates a dual-layer cell-noise effect.


blend1 = (1 - smoothstep(rad-blur,rad+blur,d)) * decay_area;
blend2 = (1 - smoothstep(rad-blur-rotdelay,rad+blur-rotdelay,d)) * decay_area;
intermediatecolor = mix(Cs, rotcolor, blend1);
surfcolor = mix(intermediatecolor, darkrotcolor, blend2);
Maya Workspace

Last is a screenshot of my Maya workspace. Although I'm satisfied with the results, given the choice, I would reapproach this project

using only texture maps to make the rotting more realistic. The cell-noise was definitely worth exploring, but I would prefer to have

more exact control over the appearance of the rotting.