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


Names of fields that may be present in a GBuffer. More...

Public Types

enum  Value {
  WS_NORMAL = 0,
  CS_NORMAL,
  WS_FACE_NORMAL,
  CS_FACE_NORMAL,
  WS_POSITION,
  CS_POSITION,
  LAMBERTIAN,
  GLOSSY,
  TRANSMISSIVE,
  EMISSIVE,
  CS_POSITION_CHANGE,
  SS_POSITION_CHANGE,
  CS_Z,
  DEPTH_AND_STENCIL,
  TS_NORMAL,
  SVO_POSITION,
  FLAGS,
  SVO_COVARIANCE_MAT1,
  SVO_COVARIANCE_MAT2,
  TEXCOORD0,
  COUNT
}
 

Public Member Functions

 Field (const G3D::String &x)
 
 Field (const G3D::Any &a)
 
 Field (const Value v)
 
 Field (int v)
 
 Field (char v)
 
 Field ()
 
void deserialize (G3D::BinaryInput &b)
 
unsigned int hashCode () const
 
bool isUnitVector () const
 
 operator int () const
 
bool operator!= (const Field ::Value other) const
 
bool operator!= (const Field other) const
 
Field operator+ (const int x) const
 
Fieldoperator++ ()
 
Fieldoperator+= (const int x)
 
Field operator- (const int x) const
 
Fieldoperator-- ()
 
Fieldoperator-= (const int x)
 
bool operator< (const Field other) const
 
bool operator< (const Value other) const
 
bool operator<= (const Field other) const
 
bool operator<= (const Value other) const
 
Fieldoperator= (const G3D::Any &a)
 
bool operator== (const Field other) const
 
bool operator== (const Field ::Value other) const
 
bool operator> (const Field other) const
 
bool operator> (const Value other) const
 
bool operator>= (const Value other) const
 
bool operator>= (const Field 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::GBuffer::Field::Value value
 

Detailed Description


Names of fields that may be present in a GBuffer.

These use the abbreviations CS = camera space, WS = world space, SS = screen space, TS = tangent space.

Normals are always encoded as n' = (n+1)/2, even if they are in floating point format, to simplify the implementation of routines that read and write GBuffers.

Member Enumeration Documentation

◆ Value

Enumerator
WS_NORMAL 

Shading normal, after interpolation and bump-mapping.

CS_NORMAL 

Shading normal, after interpolation and bump-mapping.

WS_FACE_NORMAL 

Geometric normal of the face, independent of the vertex normals.

CS_FACE_NORMAL 

Geometric normal of the face, independent of the vertex normals.

WS_POSITION 

Must be a floating-point format.

CS_POSITION 

Must be a floating-point format.

LAMBERTIAN 

Must be a floating-point or normalized fixed-point format.

See also
UniversalBSDF, UniversalMaterial.
GLOSSY 

RGB = magnitude; A = exponent.

Fresnel has not been applied. Must be a floating-point or normalized fixed-point format.

See also
UniversalBSDF, UniversalMaterial.
TRANSMISSIVE 

Must be a RGBA floating-point or normalized fixed-point format.

Index of refraction is in the A channel.

See also
UniversalBSDF, UniversalMaterial.
EMISSIVE 

Must be a floating-point or normalized fixed-point format.

See also
UniversalBSDF, UniversalMaterial.
CS_POSITION_CHANGE 

World-space position change since the previous frame, according to a Surface.

Must be RGB floating-point.

      The name "velocity" is reserved for future use as
      instantaneous velocity. 

      There is no "WS_POSITION_CHANGE" because there is no
      application (for a screen-space buffer of position
      changes that don't take the camera's own movement into
      account) to justify the added implementation
      complexity required for that.
SS_POSITION_CHANGE 

Texture storing the screen-space pixel displacement since the previous frame.

As a result, floating-point textures will store the sub-pixel displacement and signed integers (e.g., ImageFormat::RG8UI) will round to the nearest pixel.

CS_Z 

Camera-space Z.

Must be a floating-point, R-only texture. This is always a negative value if a perspective transformation has been applied.

DEPTH_AND_STENCIL 

The depth buffer, used for depth write and test.

Not camera-space Z. This may include stencil bits.

TS_NORMAL 

Shading normal, after interpolation and bump-mapping, in tangent-space.

Note that tangent space is based on interpolated vertex normals. If no bump mapping is applied the shading normal will always be (0, 0, 1).

SVO_POSITION 

Position within the normalized [0, 1] oct tree cube for SVO.

FLAGS 

Application-specific flags (e.g., "anisotropic", "water shader", "ray trace this pixel".

These may actually use individual bits, or be four values that can be 0, 1, or interpolated between them.

See also
UniversalMaterial::Specification
SVO_COVARIANCE_MAT1 

Covariance matrix for voxel based filtering.

SVO_COVARIANCE_MAT2 
TEXCOORD0 
COUNT 

Not a valid enumeration value.

Constructor & Destructor Documentation

◆ Field() [1/6]

G3D::GBuffer::Field::Field ( const G3D::String x)
inlineexplicit

◆ Field() [2/6]

G3D::GBuffer::Field::Field ( const G3D::Any a)
inlineexplicit

◆ Field() [3/6]

G3D::GBuffer::Field::Field ( char  v)
inlineexplicit

◆ Field() [4/6]

G3D::GBuffer::Field::Field ( )
inline

◆ Field() [5/6]

G3D::GBuffer::Field::Field ( const Value  v)
inline

◆ Field() [6/6]

G3D::GBuffer::Field::Field ( int  v)
inlineexplicit

Member Function Documentation

◆ classname()

static const char* G3D::GBuffer::Field::classname ( )
inlinestatic

◆ count()

static int G3D::GBuffer::Field::count ( )
inlinestatic

◆ deserialize()

void G3D::GBuffer::Field::deserialize ( G3D::BinaryInput b)
inline

◆ hashCode()

unsigned int G3D::GBuffer::Field::hashCode ( ) const
inline

◆ isUnitVector()

bool G3D::GBuffer::Field::isUnitVector ( ) const
inline

◆ nthValue()

static Value G3D::GBuffer::Field::nthValue ( int  n)
inlinestatic

◆ operator int()

G3D::GBuffer::Field::operator int ( ) const
inline

◆ operator!=() [1/2]

bool G3D::GBuffer::Field::operator!= ( const Field  other) const
inline

◆ operator!=() [2/2]

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

◆ operator+()

Field G3D::GBuffer::Field::operator+ ( const int  x) const
inline

◆ operator++()

Field& G3D::GBuffer::Field::operator++ ( )
inline

◆ operator+=()

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

◆ operator-()

Field G3D::GBuffer::Field::operator- ( const int  x) const
inline

◆ operator--()

Field& G3D::GBuffer::Field::operator-- ( )
inline

◆ operator-=()

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

◆ operator<() [1/2]

bool G3D::GBuffer::Field::operator< ( const Value  other) const
inline

◆ operator<() [2/2]

bool G3D::GBuffer::Field::operator< ( const Field  other) const
inline

◆ operator<=() [1/2]

bool G3D::GBuffer::Field::operator<= ( const Field  other) const
inline

◆ operator<=() [2/2]

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

◆ operator=()

Field& G3D::GBuffer::Field::operator= ( const G3D::Any a)
inline

◆ operator==() [1/2]

bool G3D::GBuffer::Field::operator== ( const Field  other) const
inline

◆ operator==() [2/2]

bool G3D::GBuffer::Field::operator== ( const Field ::Value  other) const
inline

◆ operator>() [1/2]

bool G3D::GBuffer::Field::operator> ( const Field  other) const
inline

◆ operator>() [2/2]

bool G3D::GBuffer::Field::operator> ( const Value  other) const
inline

◆ operator>=() [1/2]

bool G3D::GBuffer::Field::operator>= ( const Field  other) const
inline

◆ operator>=() [2/2]

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

◆ serialize()

void G3D::GBuffer::Field::serialize ( G3D::BinaryOutput b) const
inline

◆ toAny()

G3D::Any G3D::GBuffer::Field::toAny ( ) const
inline

◆ toString() [1/2]

static const char* G3D::GBuffer::Field::toString ( int  i,
Value v 
)
static

◆ toString() [2/2]

const char* G3D::GBuffer::Field::toString ( ) const
inline

Member Data Documentation

◆ value

enum G3D::GBuffer::Field::Value G3D::GBuffer::Field::value

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