7#ifndef PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_SAMPLERS_H
8#define PXR_IMAGING_PLUGIN_HD_EMBREE_MESH_SAMPLERS_H
11#include "pxr/imaging/plugin/hdEmbree/sampler.h"
12#include "pxr/imaging/hd/meshUtil.h"
15#include <embree3/rtcore.h>
16#include <embree3/rtcore_geometry.h>
20PXR_NAMESPACE_OPEN_SCOPE
51 std::bitset<PXR_MAX_USER_VERTEX_BUFFERS> _bitset;
74 : _buffer(name, value)
75 , _sampler(_buffer) {}
86 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
112 VtIntArray
const& primitiveParams)
113 : _buffer(name, value)
115 , _primitiveParams(primitiveParams) {}
122 : _buffer(name, value)
123 , _sampler(_buffer) {}
136 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
142 VtIntArray
const _primitiveParams;
162 VtVec3iArray
const& indices)
163 : _buffer(name, value)
165 , _indices(indices) {}
179 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
185 VtVec3iArray
const _indices;
214 : _buffer(name, _Triangulate(name, value, meshUtil))
215 , _sampler(_buffer) {}
230 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
284 virtual bool Sample(
unsigned int element,
float u,
float v,
void* value,
295PXR_NAMESPACE_CLOSE_SCOPE
Defines all the types "TYPED" for which Vt creates a VtTYPEDArray typedef.
A utility class that knows how to sample an element from a type-tagged buffer (like HdVtBufferSource)...
This class implements the HdEmbreePrimvarSampler interface for primvars with "constant" interpolation...
HdEmbreeConstantSampler(TfToken const &name, VtValue const &value)
Constructor.
virtual bool Sample(unsigned int element, float u, float v, void *value, HdTupleType dataType) const
Sample the primvar at an (element, u, v) location.
An abstract base class that knows how to sample a primvar signal given a ray hit coordinate: an <elem...
Utility class to track which embree user vertex buffers are currently in use.
HdEmbreeRTCBufferAllocator()
Constructor. By default, set everything to unallocated.
int Allocate()
Allocate a buffer by finding the first clear bit, using that as the buffer number,...
unsigned int NumBuffers()
Query how many buffers are currently in user for this geometry.
void Free(int buffer)
Free a buffer by clearing its bit.
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 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.
virtual ~HdEmbreeSubdivVertexSampler()
Destructor. Frees the embree user vertex buffer.
HdEmbreeSubdivVertexSampler(TfToken const &name, VtValue const &value, RTCScene meshScene, unsigned meshId, HdEmbreeRTCBufferAllocator *allocator)
Constructor.
This class implements the HdEmbreePrimvarSampler interface for primvars on triangle meshes with "face...
HdEmbreeTriangleFaceVaryingSampler(TfToken const &name, VtValue const &value, HdMeshUtil &meshUtil)
Constructor.
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...
HdEmbreeTriangleVertexSampler(TfToken const &name, VtValue const &value, VtVec3iArray const &indices)
Constructor.
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 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.
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...
HdTupleType represents zero, one, or more values of the same HdType.