7#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_H
8#define PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_H
11#include "pxr/imaging/hd/mesh.h"
12#include "pxr/imaging/hd/enums.h"
13#include "pxr/imaging/hd/vertexAdjacency.h"
16#include "pxr/imaging/plugin/hdEmbree/meshSamplers.h"
18#include <embree3/rtcore.h>
19#include <embree3/rtcore_ray.h>
21PXR_NAMESPACE_OPEN_SCOPE
50 HF_MALLOC_TAG_NEW(
"new HdEmbreeMesh");
93 HdDirtyBits* dirtyBits,
94 TfToken const &reprToken)
override;
116 HdDirtyBits *dirtyBits)
override;
141 HdDirtyBits *dirtyBits,
149 HdDirtyBits dirtyBits);
154 HdDirtyBits dirtyBits);
160 void _CreatePrimvarSampler(
TfToken const& name,
VtValue const& data,
161 HdInterpolation interpolation,
165 RTCGeometry _CreateEmbreeSubdivMesh(RTCScene scene, RTCDevice device);
167 RTCGeometry _CreateEmbreeTriangleMesh(RTCScene scene, RTCDevice device);
170 static void _EmbreeCullFaces(
const RTCFilterFunctionNArguments* args);
177 RTCScene _rtcMeshScene;
180 std::vector<unsigned> _rtcInstanceIds;
187 VtVec3fArray _points;
196 VtVec3iArray _triangulatedIndices;
197 VtIntArray _trianglePrimitiveParams;
198 VtVec3fArray _computedNormals;
205 Hd_VertexAdjacency _adjacency;
206 bool _adjacencyValid;
213 HdCullStyle _cullStyle;
219 struct PrimvarSource {
221 HdInterpolation interpolation;
223 TfHashMap<TfToken, PrimvarSource, TfToken::HashFunctor> _primvarSourceMap;
238 RTCGeometry _geometry;
239 std::vector<RTCGeometry> _rtcInstanceGeometries;
246PXR_NAMESPACE_CLOSE_SCOPE
Stores a 4x4 matrix of float elements.
An HdEmbree representation of a subdivision surface or poly-mesh object.
virtual void Sync(HdSceneDelegate *sceneDelegate, HdRenderParam *renderParam, HdDirtyBits *dirtyBits, TfToken const &reprToken) override
Pull invalidated scene data and prepare/update the renderable representation.
virtual ~HdEmbreeMesh()=default
HdEmbreeMesh destructor.
virtual HdDirtyBits GetInitialDirtyBitsMask() const override
Inform the scene graph which state needs to be downloaded in the first Sync() call: in this case,...
virtual void _InitRepr(TfToken const &reprToken, HdDirtyBits *dirtyBits) override
Initialize the given representation of this Rprim.
virtual void Finalize(HdRenderParam *renderParam) override
Release any resources this class is holding onto: in this case, destroy the geometry object in the em...
HdEmbreeMesh(SdfPath const &id)
HdEmbreeMesh constructor.
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...
Utility class to track which embree user vertex buffers are currently in use.
Hydra Schema for a subdivision surface or poly-mesh object.
Topology data for meshes.
The HdRenderParam is an opaque (to core Hydra) handle, to an object that is obtained from the render ...
Adapter class providing data exchange with the client scene graph.
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...
A small bit of state attached to each bit of instanced geometry in embree, for the benefit of HdEmbre...
A small bit of state attached to each bit of prototype geometry in embree, for the benefit of HdEmbre...
Descriptor to configure the drawItem(s) for a repr.
std::vector< TfToken > TfTokenVector
Convenience types.