Base class for volume primitives in mantra.
More...
#include <VGEO_Volume.h>
|
| VGEO_Volume () |
|
virtual | ~VGEO_Volume () |
|
virtual float | getNativeStepSize () const =0 |
|
virtual void | getBoxes (UT_Array< UT_BoundingBox > &boxes, float radius, float dbound, float zerothreshold) const =0 |
|
virtual void | getAttributeBinding (UT_StringArray &names, UT_IntArray &sizes) const =0 |
|
virtual void | evaluate (const UT_Vector3 &pos, const UT_Filter &filter, float radius, float time, int idx, float *data) const =0 |
|
virtual void | evaluateMulti (const UT_Vector3 *pos, const UT_Filter &filter, float radius, const float *time, int idx, float *data, int size, int stride) const |
|
virtual bool | evaluateInterval (const UT_BoundingBox &box, const UT_Filter &filter, float radius, float time, int idx, float *minval, float *maxval) const |
|
virtual void | intersectIsosurface (const VGEO_Ray &ray, const UT_Filter &filter, float radius, float time, int idx, float threshold, HitList &hits) const |
|
virtual void | intersectVolume (const VGEO_Ray &ray, HitList &hits) const |
|
virtual UT_Vector3 | gradient (const UT_Vector3 &pos, const UT_Filter &filter, float radius, float time, int idx) const |
|
virtual float | getGradientDelta () const |
| Returns a local distance for use in default gradient calculations. More...
|
|
virtual int | getNormalAttribute () const |
|
virtual float | getVoxelSize () const |
| Returns the voxel size in the same space as 'pos' in evaluate. More...
|
|
virtual bool | isSDF () const |
| Returns true when the volume data should be interpreted as an SDF. More...
|
|
|
virtual GA_Offset | getGeoPrimitive () const |
|
virtual GA_Offset | getGeoVertex () const |
|
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
| Default constructor: Sets counter to 0. More...
|
|
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
| Copy constructor: Sets counter to 0. More...
|
|
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
| Assignment operator: Does not modify counter. More...
|
|
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
| Return current counter. More...
|
|
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
|
Base class for volume primitives in mantra.
- Examples:
- RAY/RAY_DemoVolumeSphere.C.
Definition at line 41 of file VGEO_Volume.h.
VGEO_Volume::VGEO_Volume |
( |
| ) |
|
virtual VGEO_Volume::~VGEO_Volume |
( |
| ) |
|
|
virtual |
Utility method to create bounding boxes for every nonzero voxel in the voxel array.
Evaluate the minimum and maximum values for an attribute within a given box. If this operation is not supported, the caller will assume that the interval is unbounded.
- Parameters
-
box | Evaluation interval |
filter | Filter function |
radius | Filter radius in voxels |
time | Evaluation time (0-1) |
idx | Attribute index (based on getAttributeBinding()) |
minval | Storage for evaluation data (minimum over box) |
maxval | Storage for evaluation data (maximum over box) |
- See Also
- UT_Filter
Definition at line 133 of file VGEO_Volume.h.
Evaluate multiple volume attribute at given positions.
- Parameters
-
pos | Evaluation positions |
filter | Filter function |
radius | Filter radius in voxels |
time | Evaluation times (0-1) |
idx | Attribute index (based on getAttributeBinding()) |
data | Storage for evaluation data |
size | Number of positions to evaluate |
stride | Data size for an individual evaluation, this should match the size returned by getAttributeBinding() for the given index. |
- See Also
- UT_Filter
Return a list of attributes present in this volume. These attributes will be bound to surface shader variables when the volume is rendered. The "idx" passed into evaluation routines will be the array index returned by this operation.
- sizes: number of floats in each attribute
Implemented in HDK_Sample::ray_VolumeSphere.
Return a set of bounding boxes that define the structure of the volumetric data. The boxes are used to accelerate ray intersection testing with the volume and to cull empty space for micropolygon rendering. They need not be an exact representation of the volume, though more accurate boxes will lead to more efficient renders. Specifically, the union of the boxes returned by this method should fully enclose the region of the volume to be rendered. If there is volumetric data outside all boxes, the render may contain artifacts.
Boxes should be defined locally, and need to incorporate the displacement bound.
- Parameters
-
radius | Filter radius in voxels |
dbound | Displacement bound in local space |
zerothreshold | Threshold value under which the volume is considered empty. |
Implemented in HDK_Sample::ray_VolumeSphere.
virtual GA_Offset VGEO_Volume::getGeoPrimitive |
( |
| ) |
const |
|
inlinevirtual |
Return the geometric primitive or vertex associated with the volume. These can be used to fill in primitive and detail attributes associated with the volume.
Definition at line 52 of file VGEO_Volume.h.
virtual GA_Offset VGEO_Volume::getGeoVertex |
( |
| ) |
const |
|
inlinevirtual |
Return the geometric primitive or vertex associated with the volume. These can be used to fill in primitive and detail attributes associated with the volume.
Definition at line 54 of file VGEO_Volume.h.
virtual float VGEO_Volume::getGradientDelta |
( |
| ) |
const |
|
inlinevirtual |
Returns a local distance for use in default gradient calculations.
Definition at line 239 of file VGEO_Volume.h.
virtual float VGEO_Volume::getNativeStepSize |
( |
| ) |
const |
|
pure virtual |
Return the object space step size to use when the volume quality is 1 and there is no object-level scale. For primitives based on voxel grids, this method is usually implemented by returning the voxel size.
Implemented in HDK_Sample::ray_VolumeSphere.
virtual int VGEO_Volume::getNormalAttribute |
( |
| ) |
const |
|
inlinevirtual |
Returns the volume attribute index to be used for normal vector calculations.
Definition at line 243 of file VGEO_Volume.h.
Utility method to create an isosurface from a voxel array.
virtual float VGEO_Volume::getVoxelSize |
( |
| ) |
const |
|
inlinevirtual |
Returns the voxel size in the same space as 'pos' in evaluate.
Definition at line 246 of file VGEO_Volume.h.
Find the intersection of a ray against the isosurface defined by a scalar field. The default implementation uses ray marching and the evaluateMulti() method to find a zero-crossing via sampling.
- Parameters
-
ray | Ray for intersection testing |
filter | Filter function |
radius | Filter radius in voxels |
time | Evaluation time (0-1) |
idx | Attribute index (based on getAttributeBinding()) |
threshold | Isosurface threshold value |
hits | Callback object for insertion of ray intersection results |
Perform ray marching through a volume. The default implementation finds occupied intervals of the volume based on the boxes returned by getBoxes(), and inserts evenly spaced samples within these intervals.
- Parameters
-
ray | Ray for intersection testing |
hits | Callback object for insertion of ray intersection results |
virtual bool VGEO_Volume::isSDF |
( |
| ) |
const |
|
inlinevirtual |
Returns true when the volume data should be interpreted as an SDF.
Definition at line 249 of file VGEO_Volume.h.
The documentation for this class was generated from the following file: