Cogs.Rendering
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Public Attributes | List of all members
Cogs::SamplerState Struct Reference

Encapsulates state for texture sampling in a state object. More...

#include <SamplerState.h>

Public Types

enum  AddressMode {
  Clamp , Wrap , Mirror , Border ,
  AddressMode_Size
}
 Addressing modes to use when sampling textures. More...
 
enum  FilterMode {
  MinMagMipPoint , MinMagMipLinear , ComparisonMinMagMipPoint , ComparisonMinMagMipLinear ,
  FilterMode_Size
}
 Filter modes to specify how texture data is treated when sampled. More...
 
enum  ComparisonFunction {
  Never , Less , Equal , LessEqual ,
  Greater , NotEqual , GreaterEqual , Always ,
  ComparisonFunction_Size
}
 Comparison functions applied when sampling depth buffers using comparison filters. More...
 

Static Public Member Functions

static SamplerStateDefaultState ()
 Constructs a sampler state initialized with the default values.
 

Public Attributes

AddressMode addressModeS
 Specifies the addressing mode along the S axis in texture coordinate space.
 
AddressMode addressModeT
 Specifies the addressing mode along the T axis in texture coordinate space.
 
AddressMode addressModeW
 Specifies the addressing mode along the W axis in texture coordinate space.
 
FilterMode filter
 Specifies the filter to use for texture sampling.
 
ComparisonFunction comparisonFunction
 Specifies the comparison function to use when applying a comparison sampler.
 
unsigned int maxAnisotropy
 Specifies the maximum number of anisotropic samples to use when sampling a texture.
 
float borderColor [4]
 

Detailed Description

Encapsulates state for texture sampling in a state object.

Sampler state can be used to control how textures are sampled, e.g if texture coordinates wrap around when going outside [0, 1] range, if mipmaps are used etc.

Member Enumeration Documentation

◆ AddressMode

Addressing modes to use when sampling textures.

Enumerator
Clamp 

Texture coordinates are clamped to the [0, 1] range.

Wrap 

Texture coordinates automatically wrap around to [0, 1] range.

Mirror 

Texture coordinates are mirrored when outside [0, 1] range.

Border 

Texture color is set to the border color when outside [0, 1] range.

AddressMode_Size 

◆ ComparisonFunction

Comparison functions applied when sampling depth buffers using comparison filters.

Enumerator
Never 
Less 
Equal 
LessEqual 
Greater 
NotEqual 
GreaterEqual 
Always 
ComparisonFunction_Size 

◆ FilterMode

Filter modes to specify how texture data is treated when sampled.

Enumerator
MinMagMipPoint 

Point sampling for both minification and magnification.

MinMagMipLinear 

Linear sampling for both minification and magnification.

ComparisonMinMagMipPoint 

Comparison filter for depth sample comparisons using point sampling.

ComparisonMinMagMipLinear 

Comparison filter for depth sample comparisons using linear interpolation sampling.

FilterMode_Size 

Member Function Documentation

◆ DefaultState()

static SamplerState & Cogs::SamplerState::DefaultState ( )
inlinestatic

Constructs a sampler state initialized with the default values.

References MinMagMipLinear, Never, and Wrap.

Member Data Documentation

◆ addressModeS

AddressMode Cogs::SamplerState::addressModeS

Specifies the addressing mode along the S axis in texture coordinate space.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().

◆ addressModeT

AddressMode Cogs::SamplerState::addressModeT

Specifies the addressing mode along the T axis in texture coordinate space.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().

◆ addressModeW

AddressMode Cogs::SamplerState::addressModeW

Specifies the addressing mode along the W axis in texture coordinate space.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().

◆ borderColor

float Cogs::SamplerState::borderColor[4]

Specifies the border color to apply if the addressing mode is Border and texture coordinates are outside the [0, 1] range.

◆ comparisonFunction

ComparisonFunction Cogs::SamplerState::comparisonFunction

Specifies the comparison function to use when applying a comparison sampler.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().

◆ filter

FilterMode Cogs::SamplerState::filter

Specifies the filter to use for texture sampling.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().

◆ maxAnisotropy

unsigned int Cogs::SamplerState::maxAnisotropy

Specifies the maximum number of anisotropic samples to use when sampling a texture.

Referenced by std::equal_to< Cogs::SamplerState >::operator()(), and std::hash< Cogs::SamplerState >::operator()().


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