24 #ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_SAMPLERS_H 25 #define PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_SAMPLERS_H 28 #include "pxr/imaging/plugin/hdEmbree/sampler.h" 29 #include "pxr/imaging/hd/meshUtil.h" 32 #include <embree3/rtcore.h> 33 #include <embree3/rtcore_geometry.h> 37 PXR_NAMESPACE_OPEN_SCOPE
57 void Free(
int buffer);
68 std::bitset<PXR_MAX_USER_VERTEX_BUFFERS> _bitset;
91 : _buffer(name, value)
92 , _sampler(_buffer) {}
103 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
129 VtIntArray
const& primitiveParams)
130 : _buffer(name, value)
132 , _primitiveParams(primitiveParams) {}
139 : _buffer(name, value)
140 , _sampler(_buffer) {}
153 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
159 VtIntArray
const _primitiveParams;
179 VtVec3iArray
const& indices)
180 : _buffer(name, value)
182 , _indices(indices) {}
196 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
202 VtVec3iArray
const _indices;
231 : _buffer(name, _Triangulate(name, value, meshUtil))
232 , _sampler(_buffer) {}
247 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
301 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
312 PXR_NAMESPACE_CLOSE_SCOPE
314 #endif // PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_SAMPLERS_H
HdEmbreeTriangleFaceVaryingSampler(TfToken const &name, VtValue const &value, HdMeshUtil &meshUtil)
Constructor.
unsigned int NumBuffers()
Query how many buffers are currently in user for this geometry.
HdTupleType represents zero, one, or more values of the same HdType.
void Free(int buffer)
Free a buffer by clearing its bit.
An abstract base class that knows how to sample a primvar signal given a ray hit coordinate: an <elem...
HdEmbreeRTCBufferAllocator()
Constructor. By default, set everything to unallocated.
HdEmbreeTriangleVertexSampler(TfToken const &name, VtValue const &value, VtVec3iArray const &indices)
Constructor.
int Allocate()
Allocate a buffer by finding the first clear bit, using that as the buffer number,...
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
HdEmbreeSubdivVertexSampler(TfToken const &name, VtValue const &value, RTCScene meshScene, unsigned meshId, HdEmbreeRTCBufferAllocator *allocator)
Constructor.
Token for efficient comparison, assignment, and hashing of known strings.
Utility class to track which embree user vertex buffers are currently in use.
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
HdEmbreeConstantSampler(TfToken const &name, VtValue const &value)
Constructor.
virtual ~HdEmbreeSubdivVertexSampler()
Destructor. Frees the embree user vertex buffer.
This class implements the HdEmbreePrimvarSampler interface for primvars on triangle meshes with "vert...
This class implements the HdEmbreePrimvarSampler interface for primvars on triangle meshes with "face...
This class implements the HdEmbreePrimvarSampler interface for primvars on subdiv meshes with "vertex...
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
A utility class that knows how to sample an element from a type-tagged buffer (like HdVtBufferSource)...
static constexpr int PXR_MAX_USER_VERTEX_BUFFERS
As of Embree3 the number of buffers was greatly increased however the maximum is only defined locally...
This class implements the HdEmbreePrimvarSampler interface for primvars with "constant" interpolation...
Provides a container which may hold any type, and provides introspection and iteration over array typ...
A collection of utility algorithms for generating triangulation and quadrangulation of an input topol...
An implementation of HdBufferSource where the source data value is a VtValue.