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

A draw item is a light-weight representation of an HdRprim's resources and material to be used for rendering. More...

Inherited by HdStDrawItem.

Public Member Functions

 HF_MALLOC_TAG_NEW ("new HdDrawItem")
 
HD_API HdDrawItem (HdRprimSharedData const *sharedData)
 
HD_API SdfPath const & GetRprimID () const
 
HD_API GfBBox3d const & GetBounds () const
 
HD_API GfRange3d const & GetExtent () const
 
HD_API GfMatrix4d const & GetMatrix () const
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetConstantPrimvarRange () const
 Returns a BufferRange of constant-Primvar. More...
 
HD_API int GetInstancePrimvarNumLevels () const
 Returns the number of nested levels of instance primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetInstancePrimvarRange (int level) const
 Returns a BufferRange of instance-Primvars at level the level is assigned to nested instancers in a bottom-up manner. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetInstanceIndexRange () const
 Returns a BufferRange of instance-index indirection. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetElementPrimvarRange () const
 Returns a BufferRange of element-Primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetTopologyRange () const
 Returns a BufferArrayRange of topology. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetTopologyVisibilityRange () const
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetVertexPrimvarRange () const
 Returns a BufferArrayRange of vertex-primvars. More...
 
HD_API
HdBufferArrayRangeSharedPtr
const & 
GetFaceVaryingPrimvarRange () const
 Returns a BufferArrayRange of face-varying primvars. More...
 
HD_API HdDrawingCoordGetDrawingCoord ()
 
HD_API bool GetVisible () const
 Returns the authored visibility, expressed by the delegate. More...
 
HD_API bool HasInstancer () const
 Returns true if the drawItem has instancer. More...
 
HD_API size_t GetBufferArraysHash () const
 Returns the hash of the versions of underlying buffers. More...
 
HD_API bool IntersectsViewVolume (GfMatrix4d const &viewProjMatrix) const
 Tests the intersection with the view projection matrix. More...
 

Protected Member Functions

HD_API HdRprimSharedData const * _GetSharedData () const
 Returns the shared data. More...
 
virtual HD_API size_t _GetBufferArraysHash () const
 Allows derived classes to return a hash of the versions of buffers they manage. More...
 

Friends

HD_API friend std::ostream & operator<< (std::ostream &out, const HdDrawItem &self)
 
template<class HashState >
void TfHashAppend (HashState &h, HdDrawItem const &di)
 

Detailed Description

A draw item is a light-weight representation of an HdRprim's resources and material to be used for rendering.

The visual representation (HdRepr) of an HdRprim might require multiple draw items.

HdDrawItem(s) are created by the HdRprim (HdMesh, HdBasisCurve, ..) for each HdRepr. The relevant compositional hierarchy is:

HdRprim | +–HdRepr(s) | +–HdDrawItem(s)

HdDrawItem(s) are consumed by HdRenderPass for its HdRprimCollection via HdRenderIndex::GetDrawItems.

Note
Rendering backends may choose to specialize this class.

Definition at line 66 of file drawItem.h.

Member Function Documentation

virtual HD_API size_t _GetBufferArraysHash ( ) const
protectedvirtual

Allows derived classes to return a hash of the versions of buffers they manage.

Called by GetBufferArraysHash.

HD_API HdRprimSharedData const* _GetSharedData ( ) const
inlineprotected

Returns the shared data.

Definition at line 205 of file drawItem.h.

HD_API size_t GetBufferArraysHash ( ) const

Returns the hash of the versions of underlying buffers.

When the hash changes, it means the drawing coord might have been reassigned, so any drawing coord caching buffer (e.g. indirect dispatch buffer) has to be rebuilt at the moment. Note that this value is a hash, not sequential.

HD_API HdBufferArrayRangeSharedPtr const& GetConstantPrimvarRange ( ) const
inline

Returns a BufferRange of constant-Primvar.

Definition at line 93 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetElementPrimvarRange ( ) const
inline

Returns a BufferRange of element-Primvars.

Definition at line 131 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetFaceVaryingPrimvarRange ( ) const
inline

Returns a BufferArrayRange of face-varying primvars.

Definition at line 158 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetInstanceIndexRange ( ) const
inline

Returns a BufferRange of instance-index indirection.

Definition at line 124 of file drawItem.h.

HD_API int GetInstancePrimvarNumLevels ( ) const
inline

Returns the number of nested levels of instance primvars.

Definition at line 100 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetInstancePrimvarRange ( int  level) const
inline

Returns a BufferRange of instance-Primvars at level the level is assigned to nested instancers in a bottom-up manner.

example: (numLevels = 2)

instancerA         (level = 1)
  |
  +-- instancerB   (level = 0)
        |
        +-- mesh_prototype

Definition at line 117 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetTopologyRange ( ) const
inline

Returns a BufferArrayRange of topology.

Definition at line 138 of file drawItem.h.

HD_API HdBufferArrayRangeSharedPtr const& GetVertexPrimvarRange ( ) const
inline

Returns a BufferArrayRange of vertex-primvars.

Definition at line 151 of file drawItem.h.

HD_API bool GetVisible ( ) const
inline

Returns the authored visibility, expressed by the delegate.

Definition at line 170 of file drawItem.h.

HD_API bool HasInstancer ( ) const
inline

Returns true if the drawItem has instancer.

Definition at line 174 of file drawItem.h.

HD_API bool IntersectsViewVolume ( GfMatrix4d const &  viewProjMatrix) const

Tests the intersection with the view projection matrix.

Returns true if this drawItem is in the frustum.

XXX: Currently if this drawitem uses HW instancing, always returns true.


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