HDK
|
#include <instancer.h>
Public Member Functions | |
HDST_API | HdStInstancer (HdSceneDelegate *delegate, SdfPath const &id) |
Constructor. More... | |
HDST_API void | Sync (HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits) override |
HdBufferArrayRangeSharedPtr | GetInstancePrimvarRange () const |
HDST_API VtIntArray | GetInstanceIndices (SdfPath const &prototypeId) |
Public Member Functions inherited from HdInstancer | |
HD_API | HdInstancer (HdSceneDelegate *delegate, SdfPath const &id) |
Constructor. More... | |
virtual HD_API | ~HdInstancer () |
SdfPath const & | GetId () const |
Returns the identifier. More... | |
SdfPath const & | GetParentId () const |
Returns the parent instancer identifier. More... | |
HdSceneDelegate * | GetDelegate () const |
virtual HD_API void | Finalize (HdRenderParam *renderParam) |
virtual HD_API HdDirtyBits | GetInitialDirtyBitsMask () const |
Protected Member Functions | |
HDST_API void | _GetInstanceIndices (SdfPath const &prototypeId, std::vector< VtIntArray > *instanceIndicesArray) |
HDST_API void | _SyncPrimvars (HdSceneDelegate *sceneDelegate, HdDirtyBits *dirtyBits) |
Protected Member Functions inherited from HdInstancer | |
HD_API void | _UpdateInstancer (HdSceneDelegate *delegate, HdDirtyBits *dirtyBits) |
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) |
HdSt implements instancing by drawing each proto multiple times with a single draw call. Application of instance primvars (like transforms) is done in shaders. Instance transforms in particular are computed in ApplyInstanceTransform in instancing.glslfx.
If this instancer is nested, instance indices will be computed recursively by ascending the hierarchy. HdStInstancer computes a flattened index structure for each prototype by taking the cartesian product of the instance indices at each level.
For example:
The flattened index gives the number of times the proto is drawn, and the index tuple can be passed to the shader so that each instance can look up its instance primvars in the bound primvar arrays.
Definition at line 68 of file instancer.h.
HDST_API HdStInstancer::HdStInstancer | ( | HdSceneDelegate * | delegate, |
SdfPath const & | id | ||
) |
Constructor.
|
protected |
|
protected |
Populates the instance index indirection buffer for prototypeId
and returns a flat array of instance index tuples.
|
inline |
Definition at line 82 of file instancer.h.
|
overridevirtual |
Reimplemented from HdInstancer.