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

How the alpha value should be interpreted for partial coverage. More...

Public Types

enum  Value {
  DETECT,
  ONE,
  BINARY,
  COVERAGE_MASK,
  BLEND
}
 

Public Member Functions

 AlphaFilter (const G3D::String &x)
 
 AlphaFilter (char v)
 
 AlphaFilter (int v)
 
 AlphaFilter (const G3D::Any &a)
 
 AlphaFilter ()
 
 AlphaFilter (const Value v)
 
void deserialize (G3D::BinaryInput &b)
 
unsigned int hashCode () const
 
 operator int () const
 
bool operator!= (const AlphaFilter ::Value other) const
 
bool operator!= (const AlphaFilter other) const
 
AlphaFilter operator+ (const int x) const
 
AlphaFilteroperator++ ()
 
AlphaFilteroperator+= (const int x)
 
AlphaFilter operator- (const int x) const
 
AlphaFilteroperator-- ()
 
AlphaFilteroperator-= (const int x)
 
bool operator< (const AlphaFilter other) const
 
bool operator< (const Value other) const
 
bool operator<= (const Value other) const
 
bool operator<= (const AlphaFilter other) const
 
AlphaFilteroperator= (const G3D::Any &a)
 
bool operator== (const AlphaFilter ::Value other) const
 
bool operator== (const AlphaFilter other) const
 
bool operator> (const AlphaFilter other) const
 
bool operator> (const Value other) const
 
bool operator>= (const AlphaFilter other) const
 
bool operator>= (const Value other) const
 
void serialize (G3D::BinaryOutput &b) const
 
G3D::Any toAny () const
 
const char * toString () const
 

Static Public Member Functions

static const char * classname ()
 
static int count ()
 
static Value nthValue (int n)
 
static const char * toString (int i, Value &v)
 

Public Attributes

enum G3D::AlphaFilter::Value value
 

Detailed Description

How the alpha value should be interpreted for partial coverage.

This must be kept in sync with AlphaFilter.glsl

See also
UniversalMaterial

Member Enumeration Documentation

◆ Value

Enumerator
DETECT 

Used by UniversalMaterial to specify a default behavior: - use BLEND for surfaces with some 0.0 < alpha < 1.0 - use ONE for surfaces with all alpha = 1.0.

  • use BINARY for surfaces with both alpha = 0 and alpha = 1 at locations, but no intermediate values
ONE 

Treat the surface as completely covered, forcing alpha = 1.0 everywhere.

BINARY 

Alpha is rounded per sample before being applied.

Alpha >= 0.5 is rendered, alpha < 0.5 is discarded. This enables faster deferred shading and more accurate post-processing because the surface can be exactly represented in the GBuffer. It creates some aliasing on surface edges, however.

COVERAGE_MASK 

Convert alpha to coverage values using glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB).

Requires a MSAA framebuffer to be bound. Not currently supported by UniversalSurface. See http://www.dhpoware.com/samples/glMultiSampleAntiAliasing.html for an example.

BLEND 

Render surfaces with partial coverage from back to front, using Porter and Duff's OVER operator.

This leaves the depth buffer inconsistent with the color buffer and requires a sort, but often gives the best appearance. Even surfaces with a binary alpha cutout can benefit from blending because the transition under minification or magnification between alpha = 0 and alpha = 1 will create fractional values.

Constructor & Destructor Documentation

◆ AlphaFilter() [1/6]

G3D::AlphaFilter::AlphaFilter ( const G3D::String x)
inlineexplicit

◆ AlphaFilter() [2/6]

G3D::AlphaFilter::AlphaFilter ( const G3D::Any a)
inlineexplicit

◆ AlphaFilter() [3/6]

G3D::AlphaFilter::AlphaFilter ( char  v)
inlineexplicit

◆ AlphaFilter() [4/6]

G3D::AlphaFilter::AlphaFilter ( )
inline

◆ AlphaFilter() [5/6]

G3D::AlphaFilter::AlphaFilter ( const Value  v)
inline

◆ AlphaFilter() [6/6]

G3D::AlphaFilter::AlphaFilter ( int  v)
inlineexplicit

Member Function Documentation

◆ classname()

static const char* G3D::AlphaFilter::classname ( )
inlinestatic

◆ count()

static int G3D::AlphaFilter::count ( )
inlinestatic

◆ deserialize()

void G3D::AlphaFilter::deserialize ( G3D::BinaryInput b)
inline

◆ hashCode()

unsigned int G3D::AlphaFilter::hashCode ( ) const
inline

◆ nthValue()

static Value G3D::AlphaFilter::nthValue ( int  n)
inlinestatic

◆ operator int()

G3D::AlphaFilter::operator int ( ) const
inline

◆ operator!=() [1/2]

bool G3D::AlphaFilter::operator!= ( const AlphaFilter  other) const
inline

◆ operator!=() [2/2]

bool G3D::AlphaFilter::operator!= ( const AlphaFilter ::Value  other) const
inline

◆ operator+()

AlphaFilter G3D::AlphaFilter::operator+ ( const int  x) const
inline

◆ operator++()

AlphaFilter& G3D::AlphaFilter::operator++ ( )
inline

◆ operator+=()

AlphaFilter& G3D::AlphaFilter::operator+= ( const int  x)
inline

◆ operator-()

AlphaFilter G3D::AlphaFilter::operator- ( const int  x) const
inline

◆ operator--()

AlphaFilter& G3D::AlphaFilter::operator-- ( )
inline

◆ operator-=()

AlphaFilter& G3D::AlphaFilter::operator-= ( const int  x)
inline

◆ operator<() [1/2]

bool G3D::AlphaFilter::operator< ( const Value  other) const
inline

◆ operator<() [2/2]

bool G3D::AlphaFilter::operator< ( const AlphaFilter  other) const
inline

◆ operator<=() [1/2]

bool G3D::AlphaFilter::operator<= ( const AlphaFilter  other) const
inline

◆ operator<=() [2/2]

bool G3D::AlphaFilter::operator<= ( const Value  other) const
inline

◆ operator=()

AlphaFilter& G3D::AlphaFilter::operator= ( const G3D::Any a)
inline

◆ operator==() [1/2]

bool G3D::AlphaFilter::operator== ( const AlphaFilter ::Value  other) const
inline

◆ operator==() [2/2]

bool G3D::AlphaFilter::operator== ( const AlphaFilter  other) const
inline

◆ operator>() [1/2]

bool G3D::AlphaFilter::operator> ( const AlphaFilter  other) const
inline

◆ operator>() [2/2]

bool G3D::AlphaFilter::operator> ( const Value  other) const
inline

◆ operator>=() [1/2]

bool G3D::AlphaFilter::operator>= ( const AlphaFilter  other) const
inline

◆ operator>=() [2/2]

bool G3D::AlphaFilter::operator>= ( const Value  other) const
inline

◆ serialize()

void G3D::AlphaFilter::serialize ( G3D::BinaryOutput b) const
inline

◆ toAny()

G3D::Any G3D::AlphaFilter::toAny ( ) const
inline

◆ toString() [1/2]

const char* G3D::AlphaFilter::toString ( ) const
inline

◆ toString() [2/2]

static const char* G3D::AlphaFilter::toString ( int  i,
Value v 
)
inlinestatic

Member Data Documentation

◆ value

enum G3D::AlphaFilter::Value G3D::AlphaFilter::value

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