Matte Object Rasterizer¶
Available in Krakatoa v1.5.0 and higher
Overview¶
- Matte objects in Krakatoa are intended as stand-ins for geometry that will be rendered in other renderers like 3ds Max Default Scanline renderer, mental ray, Brazil r/s, final render or VRay to name a few.
- Matte Objects can occlude light thus casting shadows onto particles - the Cast Shadows option of the Light source must be checked for the Matte Object to be considered.
- Matte Objects can occlude particles as seen from the camera’s point of view.
- Krakatoa supports Opacity-mapped Matte Objects, allowing for complex texture-based structures using low-resolution geometry.
- Krakatoa supports the optional generation of two output image layers - one with un-occluded particles and one with particles that could be partially or fully occluded by Matte Objects.
History¶
Prior to v1.5.0¶
- In early versions of Krakatoa (1.0.0 through 1.1.3), Matte Objects were implemented using a raytracer accelerated by a kd-tree structure.
- It provided two modes
- Depth Maps - the geometry from the kd-tree would be converted into a Z-Depth Map by shooting rays through every pixel of the attenuation map or final image, then every particle would be compared to the Depth value stored in the map to determine if it is in front or behind a Matte Object. This mode was faster when the number of particles exceeded the number of pixels in the map or final image.
- Brute-Force Raytracing where each particle would be checked against the Matte Objects by shooting a ray into the kd-tree. This mode was faster when the number of particles was lower than the number of pixels in the map or final image.
- It provided two modes
v1.5.x¶
- Both modes were removed in v1.5.0 and replaced with a Depth Map Rasterizer (a form of Scanline algorithm) which was several orders of magnitude faster in generating a Depth Map to be used to check the particles against.
- For example, rendering 50 million particles in Particle Mode, pre-loaded in PCache and occluded by the 1 million faces of the Stanford Buddha model showed the following performance numbers:
- Pure Render time without Matte Object: 42.375 seconds.
- Generating Matte Objects Depth Map: 0.610 seconds.
- Pure Render time with Matte Objects: 54.625 seconds (12.25 seconds overhead)
- Similarly, rendering 10 million particles in Voxel mode illuminated by one Spot Light and occluded by the same mesh, the performance numbers were:
- Render time without Matte Objects: 22.578 seconds.
- Render time with Matte Objects: 21.641 seconds (0.937 seconds faster!)
- This is caused by the fact that the slowest part of voxel rendering is the actual filling of the voxels, so the more the Matte Objects occlude voxels, the faster the rendering!
- For example, rendering 50 million particles in Particle Mode, pre-loaded in PCache and occluded by the 1 million faces of the Stanford Buddha model showed the following performance numbers:
v1.6.x+¶
- Krakatoa v1.6.0 introduced multi-threaded acceleration to the Matte Objects Rasterizer, allowing the use of multiple cores to generate the Depth Map.
- In addition, a large number of bugs related to the rendering of the Depth Map were fixed, including the rasterizing of large polygons intersecting the image plane.
Opacity Mapped Matte Objects¶
- As mentioned above, Krakatoa v1.5.0 introduced support for opacity-mapped Matte Objects.
- Although Krakatoa supports semi-transparent objects as matte objects, compositing such renders with other render elements is not always possible - it would require more than two output layers if there are overlapping semi-transparent objects.
- The following examples show Particle and Voxel rendering with a plane without opacity mapping and the same plane with an opacity mapped black&white bitmap texture of a leaf.
Particle Mode, No Opacity Map vs. Particle Mode, Opacity Mapped


Voxel Mode, No Opacity Map vs. Voxel Mode, Opacity Mapped


Foreground and Background Layers¶
- The option “>Save Multiple Layers” found in the Matte Objects rollout of the Krakatoa User Interface controls whether all particles will be written to a single image or will be split based on their location relatively to the Matte Objects.
Krakatoa v1.5.x¶
- Krakatoa v1.5.0 introduced the ability to split the render output into two layers.
- Particles in front of the Matte Object would be rendered into the Foreground layer which was then saved to the Output Image specified in the Render Setup Dialog.
- Particles behind the Matte Object would be rendered into the Background layer which was saved into a separate OpenEXR file at the same location as the foreground layer, but with a suffix “_layer1” appended to the file name.
Krakatoa v1.6.x¶
- In Krakatoa v1.6.0, the Background Layer saving was moved to a dedicated Render Element called “Krakatoa_OccludedLayer”.
- When the “>Save Multiple Layers” option is checked, the Render Element will be added to the Render Elements Manager’s list of not there yet and will be enabled automatically .
- When the option is unchecked, the Render Element will be disabled but not removed.
- The Render Element file format can be set to any supported by 3ds Max image output format, not just OpenEXR.
Usage Example¶
- See the following Tutorial for an overview of the Multiple Layers saving workflow.