Cogs.Core
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.

Definition at line 11 of file SamplerState.h.

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.

Definition at line 14 of file SamplerState.h.

◆ ComparisonFunction

Comparison functions applied when sampling depth buffers using comparison filters.

Definition at line 47 of file SamplerState.h.

◆ 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.

Definition at line 30 of file SamplerState.h.

Member Function Documentation

◆ DefaultState()

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

Constructs a sampler state initialized with the default values.

Definition at line 85 of file SamplerState.h.

References MinMagMipLinear, and Wrap.

Referenced by Cogs::Core::Volumetric::OctRenderer::initialize(), and Cogs::ContextGL20::setSamplerState().

Member Data Documentation

◆ addressModeS

AddressMode Cogs::SamplerState::addressModeS

◆ addressModeT

AddressMode Cogs::SamplerState::addressModeT

◆ addressModeW

AddressMode Cogs::SamplerState::addressModeW

◆ 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.

Definition at line 80 of file SamplerState.h.

Referenced by Cogs::TexturesD3D11::loadSamplerState(), Cogs::TexturesD3D12::loadSamplerState(), Cogs::TexturesGL20::loadSamplerState(), and Cogs::TexturesVK::loadSamplerState().

◆ comparisonFunction

ComparisonFunction Cogs::SamplerState::comparisonFunction

◆ filter

FilterMode Cogs::SamplerState::filter

◆ maxAnisotropy

unsigned int Cogs::SamplerState::maxAnisotropy

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