24#ifndef PXR_IMAGING_HD_MESH_H
25#define PXR_IMAGING_HD_MESH_H
28#include "pxr/imaging/hd/api.h"
29#include "pxr/imaging/hd/version.h"
30#include "pxr/imaging/hd/enums.h"
31#include "pxr/imaging/hd/meshTopology.h"
32#include "pxr/imaging/hd/rprim.h"
33#include "pxr/imaging/hd/tokens.h"
36PXR_NAMESPACE_OPEN_SCOPE
38#define HD_MESH_REPR_DESC_TOKENS \
40 (surfaceShaderUnlit) \
41 (surfaceShaderSheer) \
42 (surfaceShaderOutline) \
48 HD_MESH_REPR_DESC_TOKENS);
57 HdCullStyle
cullStyle = HdCullStyleDontCare,
78 bool IsEmpty()
const {
79 return geomStyle == HdMeshGeomStyleInvalid;
133 virtual HdMeshTopologySharedPtr
GetTopology()
const;
160 using _MeshReprConfig = _ReprDescConfigs<HdMeshReprDesc, 2>;
163 static _MeshReprConfig::DescArray _GetReprDesc(
TfToken const &reprName);
172 static _MeshReprConfig _reprDescConfig;
211inline HdMeshTopologySharedPtr
214 return HdMeshTopologySharedPtr();
220 return GetPrimvar(delegate, HdTokens->points);
226 return GetPrimvar(delegate, HdTokens->normals);
230PXR_NAMESPACE_CLOSE_SCOPE
Hydra Schema for a subdivision surface or poly-mesh object.
HD_API HdMesh(SdfPath const &id)
Constructor.
virtual HdMeshTopologySharedPtr GetTopology() const
Topology getter.
VtValue GetPoints(HdSceneDelegate *delegate) const
Primvars Accessors.
HD_API TfTokenVector const & GetBuiltinPrimvarNames() const override
Returns the names of built-in primvars, i.e.
static HD_API void ConfigureRepr(TfToken const &reprName, HdMeshReprDesc desc1, HdMeshReprDesc desc2=HdMeshReprDesc())
Configure the geometric style of the mesh for a given representation.
HdMeshTopology GetMeshTopology(HdSceneDelegate *delegate) const
Topological accessors via the scene delegate.
bool IsDoubleSided(HdSceneDelegate *delegate) const
Render State.
Topology data for meshes.
The render engine state for a given rprim from the scene graph.
SdfPath const & GetId() const
Returns the identifier of this Rprim.
Adapter class providing data exchange with the client scene graph.
virtual HD_API HdDisplayStyle GetDisplayStyle(SdfPath const &id)
Returns the refinement level for the given prim in the range [0,8].
virtual HD_API VtValue GetShadingStyle(SdfPath const &id)
Returns the shading style for the given prim.
virtual HD_API bool GetDoubleSided(SdfPath const &id)
Returns the doubleSided state for the given prim.
virtual HD_API HdMeshTopology GetMeshTopology(SdfPath const &id)
Gets the topological mesh data for a given prim.
virtual HD_API PxOsdSubdivTags GetSubdivTags(SdfPath const &id)
Gets the subdivision surface tags (sharpness, holes, etc).
virtual HD_API HdCullStyle GetCullStyle(SdfPath const &id)
Returns the cullstyle for the given prim.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
Describes how the geometry of a prim should be displayed.
Descriptor to configure the drawItem(s) for a repr.
bool flatShadingEnabled
Does this mesh want flat shading?
HdCullStyle cullStyle
The culling style: draw front faces, back faces, etc.
bool enableScalarOverride
Should scalar override be allowed on this drawItem.
HdMeshGeomStyle geomStyle
The rendering style: draw refined/unrefined, edge, points, etc.
bool forceOpaqueEdges
If the geom style includes edges, should those edges be forced to be fully opaque,...
bool doubleSided
Should this mesh be treated as double-sided? The resolved value is (prim.doubleSided || repr....
float lineWidth
How big (in pixels) should line drawing be?
TfToken shadingTerminal
Specifies how the fragment color should be computed from surfaceShader; this can be used to render a ...
bool useCustomDisplacement
Should this mesh use displacementShader() to displace points?
bool blendWireframeColor
Should the wireframe color be blended into the color primvar?
std::vector< TfToken > TfTokenVector
Convenience types.