TITLE: Catastrophe in the Morning
NAME: Richard Sutherland
COUNTRY: Unites States
EMAIL: rich@brickbots.com
WEBPAGE: http://SuperMegaMult.com
TOPIC: Catastrophe
COPYRIGHT: I SUBMIT TO THE STANDARD RAYTRACING COMPETITION COPYRIGHT.
JPGFILE: rrs_cat_.jpg
RENDERER USED: 
    Mental Ray 3.4

TOOLS USED: 
    Maya, Photoshop, Mental Ray, Digital Camera

RENDER TIME: 
    Approx 13 hours

HARDWARE USED: 
    Pentium 4 1.5ghz, 2gb ram

IMAGE DESCRIPTION: 


A light-hearted approach to Catastrophe.  The coffee is gone, in case anyone
missed the catastrophic part of the image.  
I really wanted to enter this round, but I am not a big fan of disaster, so I
took this route. Hopefully, this is the 
worst catastrophe any of us will face. 



DESCRIPTION OF HOW THIS IMAGE WAS CREATED: 


MODELING
Pretty basic stuff as far as modeling goes.  Let's see now:

Coffee Can - Several Nurbs surfaces.  A cylinder deformed for the can portion,
with a duplicate on the inside. Nurbs torus for the metal ring around the top
and bottom of the can.  A revolved surface for the bottom, which you can not
even see in the final composition I choose

Spoon - subdivision surface, box-modeled.  

Coffee Pot - Several different nurbs/sub-d surfaces. 

Coffee Maker - Mostly sub-d's box modeled.  Some nurbs primitives for the switch
and water indicator.

Table, walls - Nurbs Planes.

Coffee Grains - I used an animated particle emitter with a gravity and wind
field to scatter the grains around.  The particle type is set to 'Blobs' and
are very small.  Once I ran the simulation and got the scatter I liked, I
cached the state and deleted the forces. 

The whole thing sits in a big polygon cube textures with the same material as
the walls, just for the reflections.

TEXTURES
Coffee Can - Cut the label off of some coffee I had, altered it to reflect my
name, and wrapped it around.  The inside is an anisotropic shader with very low
diffuse color and a good amount of reflectivity and specular.  Same material is
used for the little metal rims

Coffee Pot - Blinn shaders with refraction enabled textured with a complex
network of procedural shaders.  A fractal shader that produces circular
patterns that look like dried water spots, fed into another fractal to make the
pattern of water spots blotchy.  The whole effect is controlled with a gradient
to make the pot get dirtier towards the bottom.  The white parts are a blinn
shader with the same water-spot procedural system, sans the gradient.

Spoon - An Anisotropic shader with a fractal bump map (very small scale, very
low strength) and Mental Ray blurred reflections.  The specular color is set
above white (HSV, H=0,S=0,V=1.1), the diffuse component is set very low.  This
usually works for a metallic effect, but it got somewhat overwhelmed by the
strong lighting.

Coffee Maker - Basically the same shader I used on the white parts of the coffee
pot.  The black portions (the warmer, and the basket/valve) are just basic
Lambert shaders set to very dark grey.  There is a texture map with lines and
numbers for the water level indicator.  A red blinn shader was used for the
switch, and the water level indicator ball

Walls - I took a picture of my walls with a low angle light to get a bump map. 
I used the Highpass filter in Photoshop to even out the illumination and used
this as a bump map.  Texture is just solid white, actually more of a creamy
white.

Table - I took a picture of the actual table my coffee maker sits on, used a
little Highpass to even out the illumination and then used this as the texture.
 

Coffee Grains - Not the simplest shader, but I think a simple one would have
done.  I used a series of fractals to control the transparency, and surface
normals.  Up close it has sort of a hairy effect, but from afar it helps the
grains have an irregular shape.  I think at the scale they appear this effect
is negligible and I probably could have just used a dark,dark brown Lambert
shader and been a-okay.

LIGHTING

For this image I did not want to use any ambient light.  I wanted to tightly
control all the light in the scene, and use a warm key light combined with cool
secondary lights.
The primary light is an area light with soft shadows enabled and a shadow mask
made with the grid procedural texture.  I ended up using this at 1.1 intensity.
 I put it low to the scene to simulate early light coming in through a window. 
This is the warm light and is slightly yellow/white.  Originally this was a
much more intense orange color, but thanks to some great feedback from some
IRTC folks, I ended up going with a much less saturated yellow.

I used several lights to fill the rest of the scene.  One behind each wall,
facing out towards the scene, to simulate bounce off of the wall.  Similarly, I
used one light below the table to simulate bounce from the table.  The wall
lights were set at around .5 intensity, and the table light at .2.  There was
also a light that just illuminated the inside of the can (set at .4) to help
highlight the emptiness.  All of these lights are the complement of the main
light (a blue color) with a saturation of .2 

Originally the image had a lot more form shadow on all of the objects, but the
dark mood worked against the morning idea.  I did very much enjoy controlling
the light in this way, and I will probably avoid any sort of global ambient
light in the future if the scene allows.

I guess I will mention the ambient occlusion shader here as well.  Ambient
occlusion is a short-hand way of faking global illumination (diffuse light
bouncing).  For each point in the scene, rays are sent out to see how many of
them intersect other object (are occluded).  This percentage occlusion is
stored as a black/white image or as vertex colors in the scene.  Since I was
doing a still, I just rendered out the scene with the ambient occlusion shader
on all objects to get a b/w image showing the occlusion of each pixel.  As a
general rule, the more occluded a pixel is, the less 'ambient' light it will
received.  I used this image in my compo siting to make occluded areas of the
image darker.  See my compo siting section below.

RENDERING

General:  
I used the Maya DOF on the main render camera for all passes.  Mental Ray is my
renderer of choice and was used for this project.  I set the sampling levels
above 'production'.  Basically as high as I could afford render time-wise. 
There are still some artifacts from the DOF (still not enough samples!), but it
is not too noticeable.


Passes:
To save time, and cater to my urge to constantly tweak the slightest aspect of
my image, I rendered the scene as a series of passes.  I used the fantastic
render pass plugin for Maya.  Maya has some rudimentary render pass capability
(color/shadow/specular/etc), but I wanted to render each light as a separate
pass, and sometimes individual objects as well.  For this the render-pass
plugin was key.  You can define a script to be run at the start of each pass to
hide objects, alter lights, basically anything you can do with MEL Script
(which in Maya is practically anything).  The passes I rendered are described
below:

Key Light - All the objects, illuminated with the single warm key light.  No
shadows.  Includes reflections.  I thought of doing a reflection pass, but I
would need to do one for the key lights, fill lights, and shadow... so it got
to be too complex for the slight control I could apply on the reflection
strength.  I rendered this pass at 1.1 intensity for the light, with a pure
white color.

Fill Lights - All the fill lights, except the can light.  Rendered with all
objects, except the coffee grains. There was no real need for the grains as I
basically wanted them to be black anyway, and I was going to render them as a
separate pass.  Includes Reflections.  No shadows on any of these lights
anyway.  This was rendered at a 1 intensity, with a pure white color

Can Light - Just the can light, since it only illuminates the inside of the can,
that is all I rendered on this pass.  1 intensity, pure white

Main Ambient Occlusion -  All the objects, except the glass portion of the
coffee pot.  Since it was glass, it should not occlude the table under it as
much as the opaque objects.  Using the render-pass plugin I wrote a script to
apply the ambient occlusion shader to all objects for this render pass.  No
lights needed, as the pixel value comes directly from the percentage occlusion
(fully occluded = black, no occlusion=white).

Glass ambient occlusion - I then rendered an occlusion pass with just the table
and the glass part of the pot.  Since the occlusion attributed to the glass
portion was separated this way, I could be sure it had much less effect than
the main occlusion pass.

Shadows - The soft area light shadows from the key light.  This is basically a
b/w image showing the intensity of shadows.  Well, not quite, in Maya it turns
out a black images with an alpha map indicating intensity of shadows.  I just
use the alpha map inverted to form the shadow map.

Coffee Grains - The grains were not coming out black enough for my taste, so I
rendered them separately so they could be mixed in on top of all the other
passes.

COM POSITING

This may be a bit controversial, but I used Photoshop to composite all the
render passes together.  I could have produced a shader network in Maya to
multiple/screen/combine/etc all the layers and then mapped this shader network
to a self-illuminating plane which I rendered for my final image to be
absolutely sure I was in the rules, but that just seemed silly.  Since the
mathematical operations would have been nearly identical, the image would have
turned out the same after all of that hassle.  After asking the IRTC list, I
felt the reason for the non-Photoshop rule was to assure rendered images.  My
image is completely rendered (no painting or filtering in Photoshop), so I
think I am okay here.  Additionally, since brightness and contrast adjustments
can be done in post, and can easily be attained in the renderer, why not
compositing?

Anyway, here is the layer order as best as I can describe it here in text.  A
set is a collection of Photoshop layers, which are evaluated together before
the set effect other layers/sets below it.  Sets can be nested.  The notation I
will use is 'Layer Description/Composite Mode/Opacity'.  Photoshop evaluates
layers from bottom to top (imagine using clear sheets of acetate layered on top
of one another).  So layers above, affect the layer below, and so on.


Coffee Grains pass, multiply, 70%

Glass occlusion pass, multiply, 20%

Occlusion pass, multiply, 50%

Can Light set, screen, 40%:
-Complement color set, color, 20%:
--hue/saturation adjustment layer with hue set to 180 (just outputs the
complementary color of the layer below), 100%
--filled all pixels pure yellow, normal, 100%
-Can pass, normal, 100%

Cool Light set, screen, 50% :
-Complement color set, color, 20%:
--hue/saturation adjustment layer with hue set to 180 (just outputs the
complementary color of the layer below), 100%
--filled all pixels pure yellow, normal, 100%
-Fill lights pass, normal, 100%

Shadow Layer, Multiply, 90%

Warm Light Set:
-Filled All pixels pure yellow, color, 20%
-The warm light pass, normal, 100%

Whew!  Some of the order here is critical.  The shadows need to be applied
before the fill lights.  That way the complementary color from the fill lights
affects the shadows, rather than the shadows dimming the fill lights.  The
shadow is from the key light, so it should not affect the fill lights.  The
occlusion passes need to be after the color/light passes (to dim them), but
they could be in either order. The coffee grains needed to be on top to get the
dark color I wanted.

Hmm.. a little explanation on the composite modes:

Normal: well.. normal.  A pixel completely overlays the pixel below.

Multiply:  The value of the pixel below is multiplied by the value of the pixel
above.  So if the pixel below is pure white (1) and the one above is pure black
(0) then the result is 0 (1x0=0).  Likewise a mid-grey (0.5) pixel over a white
pixel (1) will yield mid grey (1 x .5 = .5).  Multiply layers can only darken
the layer below, never make it brighter.

Color: The hue of the pixel below is pushed towards the hue of the pixel above. 
At 100% strength, the hue of the result will be the hue of the color layer.  At
less than 100% the effect scales.  Does not affect saturation or value.

Screen:  I am not sure what the exact math is here, but basically the
value/color/saturation is added to the layer below.  So an all black image on
top of an all white image will yield white (1+0=1).  A white image, screened
over a mid-grey, will yield white at 100% opacity (.5+1=1.5, but the max is 1).
 Screen layers can only lighten the layer below, never darken it.


I guess that is about it.  If anyone is interested in render passes/compositing,
email me or the list and I will try to put together a tutorial with examples of
all the passes/compositing steps, and how to replicate this in a node-based
system (like Maya shading networks, Combustion, etc).

