This class implements the HdEmbreePrimvarSampler interface for primvars with "uniform" interpolation mode. More...
Public Member Functions | |
HdEmbreeUniformSampler (TfToken const &name, VtValue const &value, VtIntArray const &primitiveParams) | |
Constructor. More... | |
HdEmbreeUniformSampler (TfToken const &name, VtValue const &value) | |
Constructor. More... | |
virtual bool | Sample (unsigned int element, float u, float v, void *value, HdTupleType dataType) const |
Sample the primvar at an (element, u, v) location. More... | |
Public Member Functions inherited from HdEmbreePrimvarSampler | |
HdEmbreePrimvarSampler ()=default | |
Default constructor. More... | |
virtual | ~HdEmbreePrimvarSampler ()=default |
Default destructor. More... | |
template<typename T > | |
bool | Sample (unsigned int element, float u, float v, T *value) const |
Additional Inherited Members | |
Static Protected Member Functions inherited from HdEmbreePrimvarSampler | |
static bool | _Interpolate (void *out, void **samples, float *weights, size_t sampleCount, HdTupleType dataType) |
Utility function for derived classes: combine multiple samples with blend weights: out = sum_i { samples [i] * weights [i] }. More... | |
This class implements the HdEmbreePrimvarSampler interface for primvars with "uniform" interpolation mode.
This means that the buffer has one item per authored face. For unrefined meshes, HdEmbree will convert mesh polygons to triangles, so this class optionally takes an array called "primitiveParams" which maps from the face index embree reports to the original authored face in the scene data. If primitiveParams is not provided, this translation step is skipped.
Definition at line 118 of file meshSamplers.h.
|
inline |
Constructor.
name | The name of the primvar. |
value | The buffer data for the primvar. |
primitiveParams | A mapping from geometry face index to authored face index. |
Definition at line 125 of file meshSamplers.h.
|
inline |
Constructor.
name | The name of the primvar. |
value | The buffer data for the primvar. |
Definition at line 135 of file meshSamplers.h.
|
virtual |
Sample the primvar at an (element, u, v) location.
For uniform primvars, optionally look up the authored face index in _primitiveParams[element] (which is stored encoded); then return _buffer[element].
element | The element index to sample. |
u | The u coordinate to sample. |
v | The v coordinate to sample. |
value | The memory to write the value to (only written on success). |
dataType | The HdTupleType describing element values. |
Implements HdEmbreePrimvarSampler.