Procedural Primitives For Mantra

Mantra Procedurals: Table Of Contents

Procedural Primitives

A procedural primitive (VRAY_Procedural) provides a way to generate geometry during the rendering process. Rather than loading geometry from disk or the IFD, a procedural can generate geometry on the fly.

If the geometry is small in screen-space (i.e. far from the viewing camera), the procedural can generate less geometry than if the geometry were large in screen space.

In the simplest sense, a procedural is represented as a bounding box (UT_BoundingBox) and a method to render the procedural (VRAY_Procedural::render()).

When mantra determines that the bounding box needs to be rendered, the render method is called. At this point, the procedural can either generate geometry (VRAY_Procedural::openGeometryObject()) or it can generate further procedurals (VRAY_Procedural::openProceduralObject()).

For example, there could be a forest of trees specified as a procedural. The render method could then generate a sub-forest by dividing the forest into more manageable chunks. Or, it could generate multiple tree geometry objects.

How To Create A Geometry SHOP

Once your procedural is created, you can create a SHOP interface by starting Houdini and using File->New Operator Type. Choose a new SHOP type, then choose Geometry/Procedural Shader as the network type.

You can then edit the parameters of the SHOP.

You may want to set the Render Mask to * (in the Basic tab of the type properties).

Example Procedural Primitives

VRAY/VRAY_DemoBoxC

This simple example will render a polygonal box during the rendering process. The surface shader is set to the "constant" shader.

VRAY/VRAY_DemoFileC

This is a slightly more interesting example. The procedural defers loading of a disk file until the procedural is rendered. The procedural can also set motion blur (either velocity blur or deformation blur).

VRAY/VRAY_DemoStampC

Instead of generating geometry directly, this example file will stamp box primitives through a volume. It does this by creating new procedural objects which then get rendered.

VRAY/VRAY_DemoMountainC

This procedural renders a fractal triangle. If the level of detail of the procedural primitive is too large, the primitive will split into 4 child procedural primitives. If the primitive is small in screenspace, triangle geometry will be rendered directly.

VRAY/VRAY_DemoVolumeSphereC

This is an example of generating a procedural volume primitive.

Rather than adding geometry or a procedural, the render() method creates a new volume primitive (defined in the example).

See also:
VRAY_Procedural, VRAY_ProceduralArg, VRAY_Volume

Generated on Mon Jan 28 00:47:42 2013 for HDK by  doxygen 1.5.9