Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
G3D::DepthEncoding Class Reference

Encoding of the depth buffer (not the GBuffer::Field::CS_Z buffer) More...

Public Types

enum  Value {
  HYPERBOLIC,
  LINEAR,
  COMPLEMENTARY
}
 

Public Member Functions

 G3D_DECLARE_ENUM_CLASS_METHODS (DepthEncoding)
 

Static Public Member Functions

static const char * toString (int i, Value &v)
 

Public Attributes

enum G3D::DepthEncoding::Value value
 

Detailed Description

Encoding of the depth buffer (not the GBuffer::Field::CS_Z buffer)

Member Enumeration Documentation

Enumerator:
HYPERBOLIC 

Traditional (n)/(f-n) * (1 - f/z) encoding.

Easy to produce from a projection matrix, few good numerical properties.

LINEAR 

(z-n)/(f-n), provides uniform precision for fixed point formats like DEPTH24, and easy to reconstruct csZ directly from the depth buffer.

Poor precision under floating-point formats.

Accomplished using a custom vertex shader; not possible with a projection matrix.

COMPLEMENTARY 

(n)/(f-n) * (f/z-1) encoding, good for floating-point formats like DEPTH32F.

    Accomplished using glDepthRange(1.0f, 0.0f) with a traditionl
    projection matrix. 

    \par Referenced Code:

http://portal.acm.org/citation.cfm?id=311579&dl=ACM&coll=DL&CFID=28183902&CFTOKEN=63987370

Member Function Documentation

G3D::DepthEncoding::G3D_DECLARE_ENUM_CLASS_METHODS ( DepthEncoding  )
static const char* G3D::DepthEncoding::toString ( int  i,
Value v 
)
static

Member Data Documentation

enum G3D::DepthEncoding::Value G3D::DepthEncoding::value

documentation generated on Sat Jan 12 2013 22:49:54 using doxygen 1.8.2