Microsoft KB Archive/164208

= Microsoft Knowledge Base =

HOWTO: Mental Ray to Render Shadows with Alpha Channel Layer
Last reviewed: February 26, 1997

Article ID: Q164208

3.51 | 3.51 IRIX | WINDOWS NT kbgraphic kbhowto

The information in this article applies to:


 * Softimage 3D for IRIX, version 3.51
 * Softimage 3D for Windows NT, version 3.51

SUMMARY
This article is offers a solution for generating .pic files that only show shadows with an alpha channel layer. SOFTIMAGE 3D is not a post-production tool, so it will be necessary for you to fine-tune this technique.

Step I: Choosing your Objects

 * 1) Load a Primitive Grid, Sphere, and cube (default settings are fine).
 * 2) Scale the Sphere until it encompasses the Cube and Grid (for example, 10 Softimage units along all three axes).
 * 3) Inverse the Sphere's normals to point inward towards the Grid and Cube.
 * 4) Translate the Cube 5 to 6 Softimage units along the positive y-axis.
 * 5) Scale the Cube 0.2 along all three axes.

Step II: Defining Materials

 * 1) Select the Sphere, and choose Info>Selection. Click Render Setup and choose the mental ray renderer. In the mental ray Render Setup dialog box, deactivate Secondary rays and Shadows. To accept the changes, click Ok.
 * 2) With the Sphere still selected, go to the Material Editor and change the material to Constant, and change the RGB values to 1.0.
 * 3) Select the Grid and deactivate the Secondary rays and Shadows options in the mental ray Render Setup dialog box. Then change the material to Lambert, and change the RGB values to 1.0 for both the Ambient and Diffuse colors. Set 0.5 for Transparency, and 0.0 for the Refractive Index.
 * 4) Select the Cube and deactivate Primary rays.

Step III: Defining Lights

 * 1) For the first light, choose Raytraced Spot Light and set 30.0 for the Cone Angle, 5.0 for the Spread Angle, and 0.2 for the Umbra Intensity.
 * 2) Choose Raytraced mental ray Area Light for the second Light. Choose the Rectangle Geometry type, and set the Area Sampling to 1 for both the U and V directions. Set the Umbra Intensity to 0.2.
 * 3) Translate the Spot Light 24.0 Softimage units along the y-axis (above the Cube, and inside the Sphere).
 * 4) Leave the mental ray Area Light at its default position, but scale it by 10.0 for all three axes.

Step IV: Rendering

 * 1) Render the scene with mental ray renderer. Remember to activate all the Render Setup Global Switches (name the rendered picture file "shadow1"). You will notice that the resulting rendered picture appears with a grayish shadow over a white background (use "showpic to view the image).

Step V: Alpha Channel Layer
  From a command shell, enter the "negate" standalone command: negate shadow1.1.pic negate1.1.pic The rendered picture file will be a negative version of the original rendered picture. You should still see the grayish shadow, but over a black background (use "showpic" to view the image).  To display the alpha channel of the "negate1.1.pic", place your cursor over the rendered picture file, and press the "a" key. The shadow area appears gray, but with a slightly different intensity. Nevertheless, the shadow area still contains an alpha channel layer. As an option, use the "contrast" standalone, which lets you modify the negate1 picture file's intensity by adjusting the contrast of the picture file.

Step VI: Compositing

 * 1) In the Compositing operation, simply make the negate1 picture file a second layer, with an alpha channel compositing option. For more details on Compositing, consult the SOFTIMAGE 3D Reference Guide, A to H, on page 186, and the Using Tools Guide on page 73.