Avara3D 0.2.0
C++ API reference
a3d::Sampler Class Reference

Describes filtering, anisotropy, and coordinate wrapping for a Texture. More...

#include <a3d/visual/material/Sampler.h>

Public Types

enum class  FilterMode : uint16_t {
  Nearest = 0x2600 , Linear = 0x2601 , NearestMipmapNearest = 0x2700 , LinearMipmapNearest = 0x2701 ,
  NearestMipmapLinear = 0x2702 , LinearMipmapLinear = 0x2703
}
 Selects texture filtering and optional mipmap interpolation. More...
 
enum class  WrapMode : uint16_t { Repeat = 0x2901 , MirroredRepeat = 0x8370 , ClampToEdge = 0x812F }
 Selects how texture coordinates outside the image range are wrapped. More...
 

Public Member Functions

 Sampler ()
 Creates a Sampler with default filtering, anisotropy, and wrapping state. More...
 
FilterMode minificationFilter () const
 Returns the texture minification filter. More...
 
void minificationFilter (FilterMode mode)
 Sets the texture minification filter. More...
 
FilterMode magnificationFilter () const
 Returns the texture magnification filter. More...
 
void magnificationFilter (FilterMode mode)
 Sets the magnification filter; magnification supports Nearest or Linear filtering. More...
 
float maxAnisotropy () const
 Returns the requested maximum anisotropy. More...
 
void maxAnisotropy (float max)
 Sets the requested maximum anisotropy. More...
 
WrapMode wrapS () const
 Returns the S-coordinate wrap mode. More...
 
void wrapS (WrapMode mode)
 Sets the S-coordinate wrap mode. More...
 
WrapMode wrapT () const
 Returns the T-coordinate wrap mode. More...
 
void wrapT (WrapMode mode)
 Sets the T-coordinate wrap mode. More...
 
WrapMode wrapR () const
 Returns the R-coordinate wrap mode used by cubemap sampling. More...
 
void wrapR (WrapMode mode)
 Sets the R-coordinate wrap mode used by cubemap sampling. More...
 

Detailed Description

Describes filtering, anisotropy, and coordinate wrapping for a Texture.

Definition at line 23 of file Sampler.h.

Member Enumeration Documentation

◆ FilterMode

enum class a3d::Sampler::FilterMode : uint16_t
strong

Selects texture filtering and optional mipmap interpolation.

Enumerator
Nearest 

Select the nearest texel.

Linear 

Linearly interpolate neighboring texels.

NearestMipmapNearest 

Nearest texel from the nearest mipmap level.

LinearMipmapNearest 

Linear texel filtering from the nearest mipmap level.

NearestMipmapLinear 

Nearest-texel filtering interpolated between mipmap levels.

LinearMipmapLinear 

Linear texel filtering interpolated between mipmap levels.

Definition at line 30 of file Sampler.h.

◆ WrapMode

enum class a3d::Sampler::WrapMode : uint16_t
strong

Selects how texture coordinates outside the image range are wrapped.

Enumerator
Repeat 

Repeat the texture periodically.

MirroredRepeat 

Repeat while mirroring every other interval.

ClampToEdge 

Clamp coordinates to the texture edge.

Definition at line 41 of file Sampler.h.

Constructor & Destructor Documentation

◆ Sampler()

a3d::Sampler::Sampler ( )

Creates a Sampler with default filtering, anisotropy, and wrapping state.

Member Function Documentation

◆ magnificationFilter() [1/2]

FilterMode a3d::Sampler::magnificationFilter ( ) const

Returns the texture magnification filter.

◆ magnificationFilter() [2/2]

void a3d::Sampler::magnificationFilter ( FilterMode  mode)

Sets the magnification filter; magnification supports Nearest or Linear filtering.

◆ maxAnisotropy() [1/2]

float a3d::Sampler::maxAnisotropy ( ) const

Returns the requested maximum anisotropy.

◆ maxAnisotropy() [2/2]

void a3d::Sampler::maxAnisotropy ( float  max)

Sets the requested maximum anisotropy.

The renderer may clamp the request to the active rendering API's supported maximum.

◆ minificationFilter() [1/2]

FilterMode a3d::Sampler::minificationFilter ( ) const

Returns the texture minification filter.

◆ minificationFilter() [2/2]

void a3d::Sampler::minificationFilter ( FilterMode  mode)

Sets the texture minification filter.

◆ wrapR() [1/2]

WrapMode a3d::Sampler::wrapR ( ) const

Returns the R-coordinate wrap mode used by cubemap sampling.

◆ wrapR() [2/2]

void a3d::Sampler::wrapR ( WrapMode  mode)

Sets the R-coordinate wrap mode used by cubemap sampling.

◆ wrapS() [1/2]

WrapMode a3d::Sampler::wrapS ( ) const

Returns the S-coordinate wrap mode.

◆ wrapS() [2/2]

void a3d::Sampler::wrapS ( WrapMode  mode)

Sets the S-coordinate wrap mode.

◆ wrapT() [1/2]

WrapMode a3d::Sampler::wrapT ( ) const

Returns the T-coordinate wrap mode.

◆ wrapT() [2/2]

void a3d::Sampler::wrapT ( WrapMode  mode)

Sets the T-coordinate wrap mode.


The documentation for this class was generated from the following file: