| Support Forum Library Source SourceForge Page G3D Web Page |
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 |
Encoding of the depth buffer (not the GBuffer::Field::CS_Z buffer)
| 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 |
| G3D::DepthEncoding::G3D_DECLARE_ENUM_CLASS_METHODS | ( | DepthEncoding | ) |
| enum G3D::DepthEncoding::Value G3D::DepthEncoding::value |
1.8.2