HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStMesh Class Referencefinal

#include <mesh.h>

+ Inheritance diagram for HdStMesh:

Public Member Functions

 HF_MALLOC_TAG_NEW ("new HdStMesh")
 
HDST_API HdStMesh (SdfPath const &id, SdfPath const &instancerId=SdfPath())
 
virtual HDST_API ~HdStMesh ()
 
virtual HDST_API void Sync (HdSceneDelegate *delegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits, TfToken const &reprToken) override
 
virtual HDST_API HdDirtyBits GetInitialDirtyBitsMask () const override
 
virtual HDST_API
HdMeshTopologySharedPtr 
GetTopology () const override
 Topology (member) getter. More...
 
- Public Member Functions inherited from HdMesh
virtual HD_API ~HdMesh ()
 
bool IsDoubleSided (HdSceneDelegate *delegate) const
 
HdCullStyle GetCullStyle (HdSceneDelegate *delegate) const
 
VtValue GetShadingStyle (HdSceneDelegate *delegate) const
 
HdMeshTopology GetMeshTopology (HdSceneDelegate *delegate) const
 
HdDisplayStyle GetDisplayStyle (HdSceneDelegate *delegate) const
 
PxOsdSubdivTags GetSubdivTags (HdSceneDelegate *delegate) const
 
VtValue GetPoints (HdSceneDelegate *delegate) const
 
VtValue GetNormals (HdSceneDelegate *delegate) const
 
HD_API TfTokenVector constGetBuiltinPrimvarNames () const override
 
- Public Member Functions inherited from HdRprim
HD_API HdRprim (SdfPath const &id, SdfPath const &instancerId)
 
virtual HD_API ~HdRprim ()
 
HD_API const
HdRepr::DrawItemUniquePtrVector
GetDrawItems (TfToken const &reprToken) const
 
virtual HD_API void Finalize (HdRenderParam *renderParam)
 
SdfPath constGetId () const
 
int32_t GetPrimId () const
 Return the unique instance id. More...
 
HD_API void SetPrimId (int32_t primId)
 Set the unique instance id. More...
 
SdfPath constGetInstancerId () const
 
SdfPath constGetMaterialId () const
 
TfToken constGetMaterialTag () const
 
HdReprSelector constGetReprSelector () const
 
TfToken GetRenderTag (HdSceneDelegate *delegate) const
 Returns the render tag associated to this rprim. More...
 
GfRange3d GetExtent (HdSceneDelegate *delegate) const
 Returns the bounds of the rprim in local, untransformed space. More...
 
HdPrimvarDescriptorVector GetPrimvarDescriptors (HdSceneDelegate *delegate, HdInterpolation interpolation) const
 Primvar Query. More...
 
VtValue GetPrimvar (HdSceneDelegate *delegate, const TfToken &name) const
 
HD_API VtMatrix4dArray GetInstancerTransforms (HdSceneDelegate *delegate)
 
HD_API bool IsDirty (HdChangeTracker &changeTracker) const
 Returns true if any dirty flags are set for this rprim. More...
 
bool IsVisible () const
 Is the prim itself visible. More...
 
HD_API void UpdateReprSelector (HdSceneDelegate *delegate, HdDirtyBits *dirtyBits)
 
HD_API bool CanSkipDirtyBitPropagationAndSync (HdDirtyBits bits) const
 
HD_API HdDirtyBits PropagateRprimDirtyBits (HdDirtyBits bits)
 
HD_API void InitRepr (HdSceneDelegate *delegate, TfToken const &reprToken, HdDirtyBits *dirtyBits)
 

Static Public Member Functions

static HDST_API bool IsEnabledPackedNormals ()
 Returns whether packed (10_10_10 bits) normals to be used. More...
 
- Static Public Member Functions inherited from HdMesh
static HD_API void ConfigureRepr (TfToken const &reprName, HdMeshReprDesc desc1, HdMeshReprDesc desc2=HdMeshReprDesc())
 

Protected Member Functions

virtual HDST_API void _InitRepr (TfToken const &reprToken, HdDirtyBits *dirtyBits) override
 
virtual HDST_API HdDirtyBits _PropagateDirtyBits (HdDirtyBits bits) const override
 
void _UpdateRepr (HdSceneDelegate *sceneDelegate, TfToken const &reprToken, HdDirtyBits *dirtyBitsState)
 
HdBufferArrayRangeSharedPtr _GetSharedPrimvarRange (uint64_t primvarId, HdBufferSpecVector const &updatedOrAddedSpecs, HdBufferSpecVector const &removedSpecs, HdBufferArrayRangeSharedPtr const &curRange, bool *isFirstInstance, HdStResourceRegistrySharedPtr const &resourceRegistry) const
 
bool _UseQuadIndices (const HdRenderIndex &renderIndex, HdSt_MeshTopologySharedPtr const &topology) const
 
bool _UseLimitRefinement (const HdRenderIndex &renderIndex) const
 
bool _UseSmoothNormals (HdSt_MeshTopologySharedPtr const &topology) const
 
bool _UseFlatNormals (const HdMeshReprDesc &desc) const
 
const TfToken_GetMaterialTag (const HdRenderIndex &renderIndex) const
 
void _UpdateDrawItem (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, const HdMeshReprDesc &desc, bool requireSmoothNormals, bool requireFlatNormals)
 
void _UpdateDrawItemGeometricShader (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, const HdMeshReprDesc &desc, size_t drawItemIdForDesc)
 
void _UpdateShadersForAllReprs (HdSceneDelegate *sceneDelegate, bool updateMaterialShader, bool updateGeometricShader)
 
void _PopulateTopology (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, const HdMeshReprDesc &desc)
 
void _PopulateAdjacency (HdStResourceRegistrySharedPtr const &resourceRegistry)
 
void _PopulateVertexPrimvars (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, bool requireSmoothNormals, HdBufferSourceSharedPtr *outPoints)
 
void _PopulateFaceVaryingPrimvars (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, const HdMeshReprDesc &desc)
 
void _PopulateElementPrimvars (HdSceneDelegate *sceneDelegate, HdStDrawItem *drawItem, HdDirtyBits *dirtyBits, bool requireFlatNormals, HdBufferSourceSharedPtr const &points)
 
int _GetRefineLevelForDesc (const HdMeshReprDesc &desc) const
 
HdType _GetPointsDataTypeFromBar (HdStDrawItem *drawItem) const
 
- Protected Member Functions inherited from HdMesh
HD_API HdMesh (SdfPath const &id, SdfPath const &instancerId=SdfPath())
 
- Protected Member Functions inherited from HdRprim
HD_API HdReprSharedPtr const_GetRepr (TfToken const &reprToken) const
 Sets a new material binding to be used by this rprim. More...
 
HD_API void _UpdateVisibility (HdSceneDelegate *sceneDelegate, HdDirtyBits *dirtyBits)
 Sets a new material binding to be used by this rprim. More...
 
HD_API void _SetMaterialId (HdChangeTracker &changeTracker, SdfPath const &materialId)
 Sets a new material binding to be used by this rprim. More...
 
HD_API uint64_t _ComputeSharedPrimvarId (uint64_t baseId, HdBufferSourceSharedPtrVector const &sources, HdComputationSharedPtrVector const &computations) const
 Sets a new material binding to be used by this rprim. More...
 

Additional Inherited Members

- Protected Types inherited from HdMesh
typedef _ReprDescConfigs
< HdMeshReprDesc, 2 > 
_MeshReprConfig
 
- Protected Types inherited from HdRprim
typedef std::vector< std::pair
< TfToken, HdReprSharedPtr > > 
_ReprVector
 Sets a new material binding to be used by this rprim. More...
 
- Static Protected Member Functions inherited from HdMesh
static HD_API
_MeshReprConfig::DescArray 
_GetReprDesc (TfToken const &reprName)
 
- Static Protected Member Functions inherited from HdRprim
static HD_API bool _IsEnabledSharedVertexPrimvar ()
 Sets a new material binding to be used by this rprim. More...
 
- Protected Attributes inherited from HdRprim
HdRprimSharedData _sharedData
 Sets a new material binding to be used by this rprim. More...
 
HdReprSelector _authoredReprSelector
 Sets a new material binding to be used by this rprim. More...
 
_ReprVector _reprs
 Sets a new material binding to be used by this rprim. More...
 

Detailed Description

A subdivision surface or poly-mesh object.

Definition at line 55 of file mesh.h.

Constructor & Destructor Documentation

HDST_API HdStMesh::HdStMesh ( SdfPath const id,
SdfPath const instancerId = SdfPath() 
)

Constructor. instancerId, if specified, is the instancer which uses this mesh as a prototype.

virtual HDST_API HdStMesh::~HdStMesh ( )
virtual

Member Function Documentation

const TfToken& HdStMesh::_GetMaterialTag ( const HdRenderIndex renderIndex) const
protected
HdType HdStMesh::_GetPointsDataTypeFromBar ( HdStDrawItem drawItem) const
protected
int HdStMesh::_GetRefineLevelForDesc ( const HdMeshReprDesc desc) const
protected
HdBufferArrayRangeSharedPtr HdStMesh::_GetSharedPrimvarRange ( uint64_t  primvarId,
HdBufferSpecVector const updatedOrAddedSpecs,
HdBufferSpecVector const removedSpecs,
HdBufferArrayRangeSharedPtr const curRange,
bool *  isFirstInstance,
HdStResourceRegistrySharedPtr const resourceRegistry 
) const
protected
virtual HDST_API void HdStMesh::_InitRepr ( TfToken const reprToken,
HdDirtyBits dirtyBits 
)
overrideprotectedvirtual

Initialize the given representation of this Rprim. This is called prior to syncing the prim, the first time the repr is used.

reprToken is the name of the representation to initalize.

dirtyBits is an in/out value. It is initialized to the dirty bits from the change tracker. InitRepr can then set additional dirty bits if additional data is required from the scene delegate when this repr is synced. InitRepr occurs before dirty bit propagation.

See HdRprim::InitRepr()

Implements HdRprim.

void HdStMesh::_PopulateAdjacency ( HdStResourceRegistrySharedPtr const resourceRegistry)
protected
void HdStMesh::_PopulateElementPrimvars ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
bool  requireFlatNormals,
HdBufferSourceSharedPtr const points 
)
protected
void HdStMesh::_PopulateFaceVaryingPrimvars ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
const HdMeshReprDesc desc 
)
protected
void HdStMesh::_PopulateTopology ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
const HdMeshReprDesc desc 
)
protected
void HdStMesh::_PopulateVertexPrimvars ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
bool  requireSmoothNormals,
HdBufferSourceSharedPtr outPoints 
)
protected
virtual HDST_API HdDirtyBits HdStMesh::_PropagateDirtyBits ( HdDirtyBits  bits) const
overrideprotectedvirtual

This callback from Rprim gives the prim an opportunity to set additional dirty bits based on those already set. This is done before the dirty bits are passed to the scene delegate, so can be used to communicate that extra information is needed by the prim to process the changes.

The return value is the new set of dirty bits, which replaces the bits passed in.

See HdRprim::PropagateRprimDirtyBits()

Implements HdRprim.

void HdStMesh::_UpdateDrawItem ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
HdDirtyBits dirtyBits,
const HdMeshReprDesc desc,
bool  requireSmoothNormals,
bool  requireFlatNormals 
)
protected
void HdStMesh::_UpdateDrawItemGeometricShader ( HdSceneDelegate sceneDelegate,
HdStDrawItem drawItem,
const HdMeshReprDesc desc,
size_t  drawItemIdForDesc 
)
protected
void HdStMesh::_UpdateRepr ( HdSceneDelegate sceneDelegate,
TfToken const reprToken,
HdDirtyBits dirtyBitsState 
)
protected
void HdStMesh::_UpdateShadersForAllReprs ( HdSceneDelegate sceneDelegate,
bool  updateMaterialShader,
bool  updateGeometricShader 
)
protected
bool HdStMesh::_UseFlatNormals ( const HdMeshReprDesc desc) const
protected
bool HdStMesh::_UseLimitRefinement ( const HdRenderIndex renderIndex) const
protected
bool HdStMesh::_UseQuadIndices ( const HdRenderIndex renderIndex,
HdSt_MeshTopologySharedPtr const topology 
) const
protected
bool HdStMesh::_UseSmoothNormals ( HdSt_MeshTopologySharedPtr const topology) const
protected
virtual HDST_API HdDirtyBits HdStMesh::GetInitialDirtyBitsMask ( ) const
overridevirtual

Returns the set of dirty bits that should be added to the change tracker for this prim, when this prim is inserted.

Implements HdRprim.

virtual HDST_API HdMeshTopologySharedPtr HdStMesh::GetTopology ( ) const
overridevirtual

Topology (member) getter.

Reimplemented from HdMesh.

HdStMesh::HF_MALLOC_TAG_NEW ( "new HdStMesh )
static HDST_API bool HdStMesh::IsEnabledPackedNormals ( )
static

Returns whether packed (10_10_10 bits) normals to be used.

virtual HDST_API void HdStMesh::Sync ( HdSceneDelegate delegate,
HdRenderParam renderParam,
HdDirtyBits dirtyBits,
TfToken const reprToken 
)
overridevirtual

Pull invalidated scene data and prepare/update the renderable representation.

This function is told which scene data to pull through the dirtyBits parameter. The first time it's called, dirtyBits comes from _GetInitialDirtyBits(), which provides initial dirty state, but after that it's driven by invalidation tracking in the scene delegate.

The contract for this function is that the prim can only pull on scene delegate buffers that are marked dirty. Scene delegates can and do implement just-in-time data schemes that mean that pulling on clean data will be at best incorrect, and at worst a crash.

This function is called in parallel from worker threads, so it needs to be threadsafe; calls into HdSceneDelegate are ok.

Parameters
sceneDelegateThe data source for this geometry item.
renderParamA render delegate object that holds rendering parameters that scene geometry may use.
dirtyBitsA specifier for which scene data has changed.
reprTokenThe representation that needs to be updated. This is useful for backends that support multiple display representations for an rprim. A given representation may choose to pull on a subset of the dirty state.
dirtyBitsOn input specifies which state is dirty and can be pulled from the scene delegate. On output specifies which bits are still dirty and were not cleaned by the sync.

Implements HdRprim.


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