All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdEmbreeInstancer Class Reference

HdEmbree implements instancing by adding prototype geometry to the BVH multiple times within HdEmbreeMesh::Sync(). More...

+ Inheritance diagram for HdEmbreeInstancer:

Public Member Functions

 HdEmbreeInstancer (HdSceneDelegate *delegate, SdfPath const &id, SdfPath const &parentInstancerId)
 Constructor. More...
 
 ~HdEmbreeInstancer ()
 Destructor. More...
 
VtMatrix4dArray ComputeInstanceTransforms (SdfPath const &prototypeId)
 Computes all instance transforms for the provided prototype id, taking into account the scene delegate's instancerTransform and the instance primvars "instanceTransform", "translate", "rotate", "scale". More...
 
- Public Member Functions inherited from HdInstancer
HD_API HdInstancer (HdSceneDelegate *delegate, SdfPath const &id, SdfPath const &parentInstancerId)
 Constructor. More...
 
SdfPath const & GetId () const
 Returns the identifier. More...
 
SdfPath const & GetParentId () const
 Returns the parent instancer identifier. More...
 
HdSceneDelegateGetDelegate () const
 
HD_API TfTokenVector const & GetBuiltinPrimvarNames () const
 

Additional Inherited Members

- Static Public Member Functions inherited from HdInstancer
static HD_API int GetInstancerNumLevels (HdRenderIndex &index, HdRprim const &rprim)
 

Detailed Description

HdEmbree implements instancing by adding prototype geometry to the BVH multiple times within HdEmbreeMesh::Sync().

The only instance-varying attribute that HdEmbree supports is transform, so the natural accessor to instancer data is ComputeInstanceTransforms(), which returns a list of transforms to apply to the given prototype (one instance per transform).

Nested instancing can be handled by recursion, and by taking the cartesian product of the transform arrays at each nesting level, to create a flattened transform array.

Definition at line 52 of file instancer.h.

Constructor & Destructor Documentation

HdEmbreeInstancer ( HdSceneDelegate delegate,
SdfPath const &  id,
SdfPath const &  parentInstancerId 
)

Constructor.

Parameters
delegateThe scene delegate backing this instancer's data.
idThe unique id of this instancer.
parentInstancerIdThe unique id of the parent instancer, or an empty id if not applicable.

Destructor.

Member Function Documentation

VtMatrix4dArray ComputeInstanceTransforms ( SdfPath const &  prototypeId)

Computes all instance transforms for the provided prototype id, taking into account the scene delegate's instancerTransform and the instance primvars "instanceTransform", "translate", "rotate", "scale".

Computes and flattens nested transforms, if necessary.

Parameters
prototypeIdThe prototype to compute transforms for.
Returns
One transform per instance, to apply when drawing.

The documentation for this class was generated from the following file: