Tuesday, October 6, 2009

HOW TO RENDER RGB MATTES IN MAYA

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

ambientRaw
diffuseMaterialColor
incandescence
reflectedMaterialColor
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

EXTERIOR SET LIGHTING WITH 3DS MAX

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.

Saturday, September 26, 2009

WHAT'S NEW IN 3DS MAX 2010 LIGHTING AND RENDERING

UI improvements



New Scene Explorer



New Material Explorer



New Render Frame Window (MentalRay)



Global Tuning Parameters

WHAT'S NEW IN MAYA 2010 LIGHTING AND RENDERING

New release of autodesk Maya 2010 has improved global illumination, compatible workflow to export all the render layers/passes to autodesk Toxik, MenatalRay network rendering using autodesk Backburner. and many more. Few of the new features of Maya 2010 are given below.

New stereoscopic workflow added

Maya vector renderer now supported

Five mental ray for Maya batch rendering licenses available for command line rendering

Eight remote licenses now available for all users of mental ray satellite rendering

so happy rendering.

Saturday, July 25, 2009

FAKING GI WITH MAYA SOFTWARE RENDER

This tutorial describes how to fake GI by using lights in Maya software renderer, means we are going to simulate occlusion shadows within the Maya. For this I used a set available in www.3drender.com, you can download from http://www.3drender.com/challenges/index.htm . open the scene and set a camera to match the view like this.

set the render settings as resolution 1920*1080, preview quality with raytrace off. We are going to use only depth map shadows. lets start the lighting. First we need to set sun light/key light by using directional light. create a directional light. adjust the light to cast afternoon kind of shadow.( usually afternoon shadows are short in length and very krisp. These should be 1:0.75 in length comparative to the object length. directional light settings should be like this..

match key direction to this image

Now setup lights to get soft occluding geometry shadows on the front side wall. For this use point lights with dmap shadows with high filter size. These light attributes should be like this.

and render should be like this

set three more fill lights with same settings and change decay rate accordingly after setting up all the key lights the set should look like this.

Now you can see soft occlusion kind of shadows on the occluding walls archs etc..
And this method is useful whenever you light and render heavy BGs with complex geometry. You can save lot of time against mentalRay Ambiant occlusion caliculation. I rendered full HD resolution(1920*1080)in less than 3 minutes!

Monday, July 13, 2009

COMPOSITING KEY SHADOW ON GROUND

This is a simple tutorial explains you to how to composit a key shadow over a groung/floor. I used maya software render for the shadow rendering and used digital fusion for compositing. Now the task is to match renders with this below given image...

in this image I used two different types of shadow types for table and the bottle. Bottle has transparency so I used raytraced shadows and for tabel I used regular Dmap shadows. If we use same raytraced shadows for the entire set that will drastically reduce system performance. Flexibility of multipass rendering allows us to handle this situation. Lets prepare maya scene for rendering. In this scene I used simple geometry from the noted kitchen set of Jeremy Birn. just keep two chairs, a table and floor like this...

Let we start creating render layers in Maya. first select floor object and create a render layer. return to master layer select table and chairs then create another render layers rename it as table and chairs. Now select table chair and floor, rename it as "key shadow_table". select table top rename create render layer and rename it as "bottle_shadow". Let render the scene. Floor layer should look like this. add appropriate lights for the render layers to cast the shadow. Just re-check the render layers.
1. ren_floor

2. ren_bottle_shadow (apply usebg shader for table_top and switch off primary visibility for bottle and glass objects, turn on raytraced shadows for the light)

3. ren_floor_shadow (apply usebg shader for floor and switch off primary visibility for table and chairs).

4. ren_table_and_chair
5. ren_bottle_and_glass

after rendering each layer output should look like this.


Now its time for Fusion.
Construct flow in this order.
ren_floor+ren_floor_shadow+ren_table_and_chair+ren_bottle_shadow+ren_bottle_and_glass.
and Fusion flow should look like this.

And each merge from the top should give result like this...



Thursday, July 2, 2009

DIGITAL FUSION---EXTRACTING ALPHA WITH CHANNEL BOOLEAN

We usually use channel boolean to cut get an alpha channel out of a rgb image. for this we need one alpha channeled image in extra to the rgb image. This tutorial shows you to extract alpha channel from a rgb image. here we have images of a BG and a character without alpha channel and one character image with alpha channel. Now with this image you can cut the charter alpha channel(usually it is available in master beauty pass if you are rendering with multipass render) and apply it on bg in order to composite the bg and character together. we have footage of bg split into AO pass and color pass. character footage in one image without alpha and another with alpha. Now construct the flow. first add bg AO and Color with multiply apply mode. drag a channel boolean node from the tool tab to flow area connect its background connection to the character image without alpha. again connect its foreground connection to character image with alpha. Now merge this connection with bg merge. Now character and bg will be composited. character stays on BG! follow the below images to understand the "channel boolean" tool and the construction of the flow.
channel boolean tool settings.....

channel boolean connections....

the final final should be like this....

LIGHTING AN INTERIOR SET


Now the task is to match this image's look and feel. This interior scene modeled by Jeremy Birn. This scene contains only shader colors and no textures at all. We are going to lit it with maya using maya software in single pass. timing is Night.

First you should set the key direction. this is night lighting so we use cool moon light as our key. for this I used direction light as the key. Edit key lights attributes to match this settings....

adjust the key position like this and you should get the render like this image.

Now set fill lights for wall, ceiling, and room. and settings for all the fill lights are shown below...

adjust the positions accordingly. The final position of the fill lights for wall, cieling and room should look like below given image.

and the renders should look like this...

now add a window key light to illuminate the window sides showing the key, use a point light with no decay and put a cool color with intensity of 0.750, dmap shadows on with dmap resolution of 1024 and sample 10.

Now add a fill light for floor. with settings of intensity 0.175, color cool blue, cone angle 120, dmap size 256 with sample 8, dmap focus 50. match with this image

add one rim light for chimney with 0.2 intensity. leave rest of the settings to default. Add a fire light(a point light) and place in to the fireplace area with warm orange color with settings of intensity 8.750, decay-linear, dmap size 256, filter size 10. match render to this image.

now add lights for fireplace's stacking tubes

now fine tune rest of the objects by adding appropriate rim fill and kicker lights. and the final image looks like this.