|
HdEmbree implements instancing by adding prototype geometry to the BVH multiple times within HdEmbreeMesh::Sync(). More...
#include <instancer.h>
Public Member Functions | |
HdEmbreeInstancer (HdSceneDelegate *delegate, SdfPath const &id) | |
Constructor. | |
~HdEmbreeInstancer () | |
Destructor. | |
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 "hydra:instanceTransforms", "hydra:instanceTranslations", "hydra:instanceRotations", and "hydra:instanceScales". | |
void | Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override |
Updates cached primvar data from the scene delegate. | |
Public Member Functions inherited from HdInstancer | |
HD_API | HdInstancer (HdSceneDelegate *delegate, SdfPath const &id) |
Constructor. | |
SdfPath const & | GetId () const |
Returns the identifier. | |
SdfPath const & | GetParentId () const |
Returns the parent instancer identifier. | |
HdSceneDelegate * | GetDelegate () const |
virtual HD_API void | Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) |
virtual HD_API void | Finalize (HdRenderParam *renderParam) |
virtual HD_API HdDirtyBits | GetInitialDirtyBitsMask () const |
Additional Inherited Members | |
Static Public Member Functions inherited from HdInstancer | |
static HD_API int | GetInstancerNumLevels (HdRenderIndex &index, HdRprim const &rprim) |
static HD_API TfTokenVector const & | GetBuiltinPrimvarNames () |
static HD_API void | _SyncInstancerAndParents (HdRenderIndex &renderIndex, SdfPath const &instancerId) |
Protected Member Functions inherited from HdInstancer | |
HD_API void | _UpdateInstancer (HdSceneDelegate *delegate, HdDirtyBits *dirtyBits) |
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 50 of file instancer.h.
HdEmbreeInstancer | ( | HdSceneDelegate * | delegate, |
SdfPath const & | id | ||
) |
Constructor.
delegate | The scene delegate backing this instancer's data. |
id | The unique id of this instancer. |
~HdEmbreeInstancer | ( | ) |
Destructor.
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 "hydra:instanceTransforms", "hydra:instanceTranslations", "hydra:instanceRotations", and "hydra:instanceScales".
Computes and flattens nested transforms, if necessary.
prototypeId | The prototype to compute transforms for. |
|
overridevirtual |
Updates cached primvar data from the scene delegate.
sceneDelegate | The scene delegate for this prim. |
renderParam | The hdEmbree render param. |
dirtyBits | The dirty bits for this instancer. |
Reimplemented from HdInstancer.