Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
G3D::Sampler Class Reference


A class holding all of the parameters one would want to use to when accessing a Texture More...

Public Member Functions

 Sampler (WrapMode m=WrapMode::TILE, InterpolateMode i=InterpolateMode::TRILINEAR_MIPMAP)
 
 Sampler (WrapMode x, WrapMode y, InterpolateMode i=InterpolateMode::TRILINEAR_MIPMAP)
 
 Sampler (const Any &any)
 
bool equals (const Sampler &other) const
 
size_t hashCode () const
 
bool operator== (const Sampler &other) const
 
Any toAny () const
 

Static Public Member Functions

static const Samplerbuffer ()
 Useful defaults for general purpose computing. More...
 
static const SamplercubeMap ()
 Useful defaults for cube maps TRILINEAR_MIPMAP / CLAMP / DEPTH_NORMAL. More...
 
static const SamplerdefaultClamp ()
 
static const Samplerdefaults ()
 
static const SamplerlightMap ()
 Useful defaults for light maps. More...
 
static const Samplershadow ()
 Useful defaults for shadow maps. More...
 
static const Samplervideo ()
 Useful defaults for video/image processing. More...
 
static const Samplervisualization ()
 Useful defaults for directly visualizing data NEAREST_MIPMAP / CLAMP / DEPTH_NORMAL. More...
 

Public Attributes

DepthReadMode depthReadMode
 Default is DEPTH_NORMAL. More...
 
InterpolateMode interpolateMode
 Default is TRILINEAR_MIPMAP. More...
 
float maxAnisotropy
 Default is 16.0. More...
 
int maxMipMap
 Highest MIP-map level that will be used during rendering. More...
 
int minMipMap
 Lowest MIP-map level that will be used during rendering. More...
 
float mipBias
 Add to the MIP level after it is computed. More...
 
WrapMode xWrapMode
 Default is TILE. More...
 
WrapMode yWrapMode
 Wrap mode for the Y coordinate. More...
 

Detailed Description


A class holding all of the parameters one would want to use to when accessing a Texture

See also
GLSamplerObject, Texture

Constructor & Destructor Documentation

◆ Sampler() [1/3]

◆ Sampler() [2/3]

G3D::Sampler::Sampler ( WrapMode  x,
WrapMode  y,
InterpolateMode  i = InterpolateMode::TRILINEAR_MIPMAP 
)

◆ Sampler() [3/3]

G3D::Sampler::Sampler ( const Any any)
Parameters
anyMust be in the form of a table of the fields or appear as a call to a static factory method, e.g.,:
  • Sampler::Sampler{ interpolateMode = "TRILINEAR_MIPMAP", wrapMode = "TILE", ... }
  • Sampler::Sampler::video()

Member Function Documentation

◆ buffer()

static const Sampler& G3D::Sampler::buffer ( )
static

Useful defaults for general purpose computing.

NEAREST_NO_MIPMAP / CLAMP / DEPTH_NORMAL

◆ cubeMap()

static const Sampler& G3D::Sampler::cubeMap ( )
static

Useful defaults for cube maps TRILINEAR_MIPMAP / CLAMP / DEPTH_NORMAL.

◆ defaultClamp()

static const Sampler& G3D::Sampler::defaultClamp ( )
static

◆ defaults()

static const Sampler& G3D::Sampler::defaults ( )
static

◆ equals()

bool G3D::Sampler::equals ( const Sampler other) const

◆ hashCode()

size_t G3D::Sampler::hashCode ( ) const

◆ lightMap()

static const Sampler& G3D::Sampler::lightMap ( )
static

Useful defaults for light maps.

TRILINEAR_MIPMAP / CLAMP / DEPTH_NORMAL / maxAnisotropy = 4.0

◆ operator==()

bool G3D::Sampler::operator== ( const Sampler other) const

◆ shadow()

static const Sampler& G3D::Sampler::shadow ( )
static

Useful defaults for shadow maps.

BILINEAR_NO_MIPMAP / CLAMP / DEPTH_LEQUAL

◆ toAny()

Any G3D::Sampler::toAny ( ) const

◆ video()

static const Sampler& G3D::Sampler::video ( )
static

Useful defaults for video/image processing.

BILINEAR_NO_MIPMAP / CLAMP / DEPTH_NORMAL

◆ visualization()

static const Sampler& G3D::Sampler::visualization ( )
static

Useful defaults for directly visualizing data NEAREST_MIPMAP / CLAMP / DEPTH_NORMAL.

Member Data Documentation

◆ depthReadMode

DepthReadMode G3D::Sampler::depthReadMode

Default is DEPTH_NORMAL.

◆ interpolateMode

InterpolateMode G3D::Sampler::interpolateMode

Default is TRILINEAR_MIPMAP.

◆ maxAnisotropy

float G3D::Sampler::maxAnisotropy

Default is 16.0.

◆ maxMipMap

int G3D::Sampler::maxMipMap

Highest MIP-map level that will be used during rendering.

The highest level that actually exists will be L = log(max(m_width, m_height), 2)), although it is fine to set maxMipMap higher than this. Must be larger than minMipMap. Default is 1000.

Setting the max mipmap level is useful for preventing adjacent areas of a texture from being blurred together when viewed at a distance. It may decrease performance, however, by forcing a larger texture into cache than would otherwise be required.

◆ minMipMap

int G3D::Sampler::minMipMap

Lowest MIP-map level that will be used during rendering.

Level 0 is the full-size image. Default is -1000, matching the OpenGL spec.

Referenced Code:
http://oss.sgi.com/projects/ogl-sample/registry/SGIS/texture_lod.txt

◆ mipBias

float G3D::Sampler::mipBias

Add to the MIP level after it is computed.

>0 = make blurrier, <0 = make sharper. Default is -0.25f

◆ xWrapMode

WrapMode G3D::Sampler::xWrapMode

Default is TILE.

◆ yWrapMode

WrapMode G3D::Sampler::yWrapMode

Wrap mode for the Y coordinate.

Default is TILE


documentation generated on Wed Nov 24 2021 08:01:59 using doxygen 1.8.15