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>
35 PXR_NAMESPACE_OPEN_SCOPE
55 void Free(
int buffer);
66 std::bitset<PXR_MAX_USER_VERTEX_BUFFERS> _bitset;
89 : _buffer(name, value)
90 , _sampler(_buffer) {}
101 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
127 VtIntArray
const& primitiveParams)
128 : _buffer(name, value)
130 , _primitiveParams(primitiveParams) {}
137 : _buffer(name, value)
138 , _sampler(_buffer) {}
151 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
157 VtIntArray
const _primitiveParams;
177 VtVec3iArray
const& indices)
178 : _buffer(name, value)
180 , _indices(indices) {}
194 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
200 VtVec3iArray
const _indices;
229 : _buffer(name, _Triangulate(name, value, meshUtil))
230 , _sampler(_buffer) {}
245 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
299 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
310 PXR_NAMESPACE_CLOSE_SCOPE
312 #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.
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
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...
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
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, and setting the bit to mark it as used.
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.
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
HdEmbreeConstantSampler(TfToken const &name, VtValue const &value)
Constructor.
virtual ~HdEmbreeSubdivVertexSampler()
Destructor. Frees the embree user vertex buffer.
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
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...
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
This class implements the HdEmbreePrimvarSampler interface for primvars on subdiv meshes with "vertex...
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.