|On this page|
This procedural uses a CVEX shader to define a set of 3D fields in space for volume rendering. The export parameters on the CVEX shader will be evaluated during rendering and bound to surface shader parameters of the same name. If you are rendering isosurfaces, you should define a "density" export from the shader since mantra relies on this field being present for isosurface root finding.
The following inputs parameters are available in the CVEX context used by the VEX Volume Procedural:
Position to evaluate, in object space.
Equivalent to the Time global variable passed to the surface shader, indicates the motion blur interframe time for evaluation. Time will be a value between 0 and 1.
When using this procedural, you should always specify an explicit bounding
box. If you don’t specify a box, parts of your function may appear clipped
in the render. The default rendering quality for VEX volume procedurals is
set in relation to the box size, so larger boxes will use a larger ray
march step size. You can adjust quality from the default using
Specifies the CVEX shader that will define the fields in the volume.
Specifies the number of divisions to use in constructing an acceleration data structure for the volume. The default of 1 division will cause the renderer to generate samples within the entire bounding box for the volume. Larger values will trigger a preprocessing phase before rendering that will evaluate the VEX function on a uniform grid to try to determine the important parts of the volume, so that empty portions of the image will render much faster.
Values larger than 1 will only produce a correct result if the feature size in your
volume is larger than the division size - otherwise the preprocessing phase will miss small details in the volume which will then fail to appear in the render, so increasing the octree divisions is not recommended.
The bounding box controls let you specify a bounding box for the referenced geometry. Only when this bounding box is "on screen" will mantra load the referenced geometry. You can set Bounding box to No bounding box required, in which case mantra will always load the references geometry regardless. You can also specify the bounding box by referencing the SOP’s bounding box in the SOP Bounds parameter.
The geometry whose bounding box you want to reference.
The minimum bounding box dimensions, when setting explicit bounds.
The maximum bounding box dimensions, when setting explicit bounds.
This example shows how to render an isosurface defined by a cvex shader using mantra’s volume rendering capabilities. A noise field is generated by a cvex shader, which is attached to the VEX Volume Procedural. The volume is shaded by finding the surface where the density crosses 0, and then shading using a simple surface shader that shows the normals.