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 <embree4/rtcore.h>
19#include <embree4/rtcore_ray.h>
21PXR_NAMESPACE_OPEN_SCOPE
50 HF_MALLOC_TAG_NEW(
"new HdEmbreeMesh");
93 HdDirtyBits* dirtyBits,
94 TfToken const &reprToken)
override;
102 bool EmbreeMeshIsDoubleSided()
const
121 HdDirtyBits *dirtyBits)
override;
146 HdDirtyBits *dirtyBits,
154 HdDirtyBits dirtyBits);
159 HdDirtyBits dirtyBits);
165 void _CreatePrimvarSampler(
TfToken const& name,
VtValue const& data,
166 HdInterpolation interpolation,
170 RTCGeometry _CreateEmbreeSubdivMesh(RTCScene scene, RTCDevice device);
172 RTCGeometry _CreateEmbreeTriangleMesh(RTCScene scene, RTCDevice device);
175 static void _EmbreeCullFaces(
const RTCFilterFunctionNArguments* args);
182 RTCScene _rtcMeshScene;
185 std::vector<unsigned> _rtcInstanceIds;
192 VtVec3fArray _points;
201 VtVec3iArray _triangulatedIndices;
202 VtIntArray _trianglePrimitiveParams;
203 VtVec3fArray _computedNormals;
210 Hd_VertexAdjacency _adjacency;
211 bool _adjacencyValid;
218 HdCullStyle _cullStyle;
224 struct PrimvarSource {
226 HdInterpolation interpolation;
228 TfHashMap<TfToken, PrimvarSource, TfToken::HashFunctor> _primvarSourceMap;
243 RTCGeometry _geometry;
244 std::vector<RTCGeometry> _rtcInstanceGeometries;
251PXR_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.