24 #ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_H 25 #define PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_H 28 #include "pxr/imaging/hd/mesh.h" 29 #include "pxr/imaging/hd/enums.h" 30 #include "pxr/imaging/hd/vertexAdjacency.h" 33 #include "pxr/imaging/plugin/hdEmbree/meshSamplers.h" 35 #include <embree3/rtcore.h> 36 #include <embree3/rtcore_ray.h> 38 PXR_NAMESPACE_OPEN_SCOPE
67 HF_MALLOC_TAG_NEW(
"new HdEmbreeMesh");
110 HdDirtyBits* dirtyBits,
111 TfToken const &reprToken)
override;
133 HdDirtyBits *dirtyBits)
override;
158 HdDirtyBits *dirtyBits,
166 HdDirtyBits dirtyBits);
171 HdDirtyBits dirtyBits);
177 void _CreatePrimvarSampler(
TfToken const& name,
VtValue const& data,
178 HdInterpolation interpolation,
182 RTCGeometry _CreateEmbreeSubdivMesh(RTCScene scene, RTCDevice device);
184 RTCGeometry _CreateEmbreeTriangleMesh(RTCScene scene, RTCDevice device);
187 static void _EmbreeCullFaces(
const RTCFilterFunctionNArguments* args);
194 RTCScene _rtcMeshScene;
197 std::vector<unsigned> _rtcInstanceIds;
204 VtVec3fArray _points;
213 VtVec3iArray _triangulatedIndices;
214 VtIntArray _trianglePrimitiveParams;
215 VtVec3fArray _computedNormals;
222 Hd_VertexAdjacency _adjacency;
223 bool _adjacencyValid;
230 HdCullStyle _cullStyle;
236 struct PrimvarSource {
238 HdInterpolation interpolation;
240 TfHashMap<TfToken, PrimvarSource, TfToken::HashFunctor> _primvarSourceMap;
255 RTCGeometry _geometry;
256 std::vector<RTCGeometry> _rtcInstanceGeometries;
263 PXR_NAMESPACE_CLOSE_SCOPE
265 #endif // PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_H Stores a 4x4 matrix of float elements.
Descriptor to configure the drawItem(s) for a repr.
virtual void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits, TfToken const &reprToken) override
Pull invalidated scene data and prepare/update the renderable representation.
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
virtual void _InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBits) override
Initialize the given representation of this Rprim.
Token for efficient comparison, assignment, and hashing of known strings.
A small bit of state attached to each bit of instanced geometry in embree, for the benefit of HdEmbre...
Utility class to track which embree user vertex buffers are currently in use.
An HdEmbree representation of a subdivision surface or poly-mesh object.
Adapter class providing data exchange with the client scene graph.
std::vector< TfToken > TfTokenVector
Convenience types.
A path value used to locate objects in layers or scenegraphs.
A small bit of state attached to each bit of prototype geometry in embree, for the benefit of HdEmbre...
virtual HdDirtyBits GetInitialDirtyBitsMask() const override
Inform the scene graph which state needs to be downloaded in the first Sync() call: in this case,...
Hydra Schema for a subdivision surface or poly-mesh object.
HdEmbreeMesh(SdfPath const &id)
HdEmbreeMesh constructor.
Topology data for meshes.
virtual void Finalize(HdRenderParam *renderParam) override
Release any resources this class is holding onto: in this case, destroy the geometry object in the em...
virtual ~HdEmbreeMesh()=default
HdEmbreeMesh destructor.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
virtual HdDirtyBits _PropagateDirtyBits(HdDirtyBits bits) const override
This callback from Rprim gives the prim an opportunity to set additional dirty bits based on those al...