| Previous Topic (Saving Particle Files Tutorial) | Up (Contents) | Next Topic (Shadows On Geometry Tutorial) |
Matte Objects and Shadows
In most cases, your particle systems do not stand alone. You will need to combine them with other plates or rendered elements. The following exercises will introduce you to Krakatoa features for handling matte objects, shadow-casting lights, and particle shadows on geometry.
Matte Objects
- To demonstrate the use of Matte Objects, create a sphere in your scene and position it such that it obscures your camera’s view of the particle system and so that it also blocks some light from the spotlight into the particles.
- Select your new sphere object. In the Krakatoa GUI, scroll down to and expand the Matte Objects rollout.
- Click on Create/Update Matte Selection Set while the sphere is still selected in the scene.
This will create a Named Selection Set default-named "KrakatoaMatteObjects" in your scene and add it to the right list box. Krakatoa will use all geometry objects in the listed Named Selection Sets as matte objects.
- Click QUICK RENDER to see your results. Observe that the particles behind the sphere are no longer visible.
- Select your Spotlight, and in the Modify Panel turn on Shadows.
- QUICK RENDER again. Observe that the sphere is now also casting a shadow into the particles. In the Rendered Frame Window, toggle between RGB and Alpha channels to see where particles are obscured by your matte object versus where they are simply in the shadow of the matte object.
Note on shadow quality: Several factors will affect the quality of your shadows. If you begin to see moiré patterns, you may need some combination of increasing the shadow map size, increasing the number of particles, and decreasing the particle density.
Summary: With matte objects and shadow-casting lights, you have created a layer easy to integrate into a final composite. In the next exercise, we will show how your particles can cast shadows on rendered scene geometry.
Shadows on Geometry
Your final composites will likely contain other geometric objects to be integrated with your particle system. To assist in casting shadows on geometry rendered with other 3ds Max renderers, Krakatoa can store attenuation maps for each shadow-casting light. In turn, these maps can be assigned to the projection slots of your lights to project shadows onto your scene objects. Krakatoa also provides shortcuts for assigning maps and switching renderers.
To create and save Attenuation Maps
- Right-click the QUICK RENDER button and make sure Save Render Output and Set Render Output Filename are both checked. If they are not, select Set Render Output Filename and pick the location and the name of the image files to save.
- In the same Right-click menu, select the item Save Attenuation Maps - if checked, a sub-folder called \Shadows will be automatically generated when rendering the output images and an attenuation map containing the name of the light object it was generated from will be saved in EXR format for each frame.
Alternatively, you can expand the Shadows On Geometry rollout in the Krakatoa GUI and check the >Save Attenuation Maps When Rendering option. The right-click menu is a shortcut to the same option.
- Render the scene as usual - when finished, right-click the QUICK RENDER button again and select the Explore Render Path option - a Windows Explorer will be opened to reveal the render output location.
- The folder should contain a sub-folder called \Shadows - check to see that there is an attenuation map saved for each light and frame rendered.
- Now either press the Open Krakatoa Shadows Utility button in the Shadows On Geometry rollout, or, if you have installed the Krakatoa MacroScripts in the 3ds Max GUI, locate the KrakatoaShadows button and press it to open the utility.
- The utility is a MAXScript dialog which will help you apply the shadow information to your lights.
- It will take the current render output path and attempt to resolve the location of the \Shadows folder automatically. If the folder could not be resolved (for example because the Render Output Path has been removed or changed after the rendering has finished), press the Select Shadows Data Location button and pick the folder containing the attenuation maps by selecting a representative attenuation map. The File Prefix will be the portion of the file name from the beginning to the first underscore character. The file prefix can be used to distinguish between multiple rendering sessions stored within the same folder. For example, if you rendered to the image file name "myFirstTest_0000.exr", the attenuation maps would be called like "myFirstTest_Omni01_0000.exr", "myFirstTest_Spot01_0000.exr" and so on. If you decided to change the name of the output image to, say, "secondTest_0000.exr", then the shadows will also use the new prefix. Thus, picking a file with the desired prefix will ensure you are using the correct sequence of attenuation maps.
- Next, press the large ADD KRAKATOA SHADOWS TO THE SCENE button - the utility will scan the scene for lights, match them with the attenuation maps in the \shadows folder and assign the Projector maps as necessary. Existing projector map will be preserved and MULTIPLIED with the Attenuation map. Using the REMOVE Krakatoa Shadows From The Scene later will remove the Krakatoa attenuation maps and any RGB Multiply maps and restore the projector maps as they were before the application of the shadows.
- Finally, you want to switch the renderer from Krakatoa back to Scanline, mental ray, VRay, Brazil etc. to perform the actual rendering of scene geometry with Krakatoa shadows projected by the lights. You can either select any of the existing renderer classes displayed in the first drop-down list, or pick a previously generated render preset.
Once you are done rendering, you can revert back to Krakatoa by pressing the RESTORE Krakatoa Renderer button at the bottom of the dialog.
You should be able to combine the Krakatoa particle rendering pass with the main pass rendered in another renderer in Video Post or any compositing application.
For a detailed tutorial, please see the next page: Casting Shadows On Geometry