Math v0.2.0
SIMD optimized C++ mathematics library
Loading...
Searching...
No Matches
Sampler3D Class Reference

Texture (image) sampler 3D. More...

#include <sampler.hpp>

Public Member Functions

 Sampler3D (const void *texels, uint3 size) noexcept
 Creates a new 3D texture (image) sampler.
template<class T = f32x4>
get (uint3 position) const noexcept
 Returns texel at specified position.
template<class T = f32x4>
sampleNearest (float3 uv, bool repeatMode=false) const noexcept
 Samples nearest texel from an image.

Detailed Description

Texture (image) sampler 3D.

Constructor & Destructor Documentation

◆ Sampler3D()

Sampler3D ( const void * texels,
uint3 size )
inlinenoexcept

Creates a new 3D texture (image) sampler.

Parameters
[in]texelstarget texture texel data
sizetarget texture 3D size in texels
mipCounttexture mipmap level count

Member Function Documentation

◆ get()

template<class T = f32x4>
T get ( uint3 position) const
inlinenoexcept

Returns texel at specified position.

Parameters
positiontexel 3D position and mipmap level
Template Parameters
Ttype of the texture pixel

◆ sampleNearest()

template<class T = f32x4>
T sampleNearest ( float3 uv,
bool repeatMode = false ) const
inlinenoexcept

Samples nearest texel from an image.

Parameters
uv3D texture coordinates where to sample
repeatModeclamp to border or repeat sampling mode
Template Parameters
Ttype of the texture pixel