Tuesday, October 6, 2009


Since long time I was thinking to post rendering RGB(primary color) mattes in Maya to tweak lighting out put in any compositing software. After receiving mail from Jesper Hammarb├Ąck I am posting it right now. particularly if you are using Maya 2009 or greater, its a great comfort to render more RGB mattes at a time by using new renderpass feature with mentalray. I am going to explain rendering RGB mattes of a car model using Maya 2009 MentalRay. This is the Car Model...

Lets start preparing shaders for RGB mattes. With Maya 2009 MentalRay we can seperate

even we can render in to more type of passes according to the shader what we use. These type of passes can be used to render multiple RGB mattes in a single render.
First: preparing rgb mattes in ambient color.
create a Lambert shader change color value to white, ambient value to red and change rest of the values to "0".as shown in this images.choose pure red (value 1) in color chooser and leave blue and green values to "0".

repeat same steps by changing values for green and blue as shown in below images

assign these shaders to the geometry in the scene.(I assigned to the wheels of this car)
now we will start preparing rgb mattes in incandescence. (you can render only 3 mattes at a time if you have more geometry parts to control you need to render many rgb mattes instead of rendering more scenes we will prepare shaders with with different channels and assign to different parts of the geometry and render in to seperate passes so that you could get more rgb mattes in a single render)like this

Now we prepare another shader to render RGB mattes in reflection pass. This is little complex than the earlier passes. First create a phong shader change; color, transparency, ambient color and incandescence channels to black and connect ramp in specular and reflected color channels change ramp to red color and cosine power and reflectivity values to 100 and 1 respectively like the images below..

Now we have 3 shaders with 3 RGB passes each i.e we get 9 RGB mattes in one render.Assign these shaders to nine different objects in scene and follow render settings like this

Now associate the render passes with renderlayer and render it you could get render output in to 4 passes consisting of RGB mattes/masks. Here is the output

if you need a tool to download based on this, you can visit http://pragmaticartistry.com/.

Thursday, October 1, 2009


After a long time (near about 7Years) I tried to lit a scene in 3ds Max. I took neutral (only blin with no speculars) shading exterior set and started afternoon lighting with default scanline render. The set looks like this without any lights.
Start with one freeDirectional light to simulate Sun. with settings shdows on with shodow map shadow options. ">

change the bias to 0.05(by default 3dsmax renderer calculates shadow bias as 1.0 but this value takes shadow out from the origin. like this image.
this image shows corrected bias value for this set. so the shadows will stay at the origin of the geometry. This occurs because of the shadow map calculation by scanline render. It creates a 2d map of the geometry from light's view. bias value controls the placement of the shadow map.

Now we need to add a fill light to eliminate the darkness created by keyshadows. for this I used a freeSpot light with values like this and position that light somewhere around opposite to the sun light direction.

and render output with fill light and sun light looks like this

Now back side of the set is too dark and fill light is not reaching there. So create a point light and include only that surface to the light illumination and shadow parameters and the light settings should be like this; use inverse square as the decay rate. it restrics light to a limited distance. by default all the cg lights comes with infinite range. we can control with decay and attenuation parameters. Rendered image with fill light added for the back side of the set should look like this

Now we will start adding more lights for detailing and simulating the bounce of the sun.add bounce for the balcony. usually in midday noon time bounce is more and it bounce the texture/shader color of the nearby geometry since we have only gray color shading so the light bounces with default sun light color. these are the settings for balcony bounce light. I used a omni light as the bounce light and included only balcony base geometry to lights illumination and shadow parameters ( include and exclude parameters are similar to Maya make/brake light links attribute). light settings are like this;

and the rendered image should look like this

Now balcony top fill...

Now adding bounce light for fabrik in the foreground with a free spot positioned from the bottom with this settings....

and render out put is like this....

Now add details to pillars by using free spot.(spot lights are more orthodox lights with less render time, I encourage the usage of spot lights more often)when ever you get confused with which light illuminating which geometry you can simply unchek the lights in lightlister(cool tool in 3dsMax) and chek the individual lights illuminating geometry! render output with added details to the pillar.

Now start adding details to the wooden rack in the foreground. with usual spot lights. this is the render output...

Now small pillar in the background.

Fabrik key in order to match sun illumination.....

Bounce light for Small balcony right side of the set.....

after adding global fill for floor and fill for backside geometry.. the image should look like this.