R2 Shaders
|
Logarithmic depth functions. More...
Go to the source code of this file.
Functions | |
float | R2_logDepthPrepareEyeZ (const float z) |
float | R2_logDepthEncodePartial (const float z, const float depth_coefficient) |
float | R2_logDepthEncodeFull (const float z, const float depth_coefficient) |
float | R2_logDepthDecode (const float z, const float depth_coefficient) |
Logarithmic depth functions.
Definition in file R2LogDepth.h.
float R2_logDepthDecode | ( | const float | z, |
const float | depth_coefficient | ||
) |
Decode a depth value that was encoded with the given depth coefficient. Note that in most cases, this will yield a positive eye-space Z value, and must be negated to yield a conventional negative eye-space Z value.
z | The depth value |
depth_coefficient | The coefficient used during encoding |
Definition at line 72 of file R2LogDepth.h.
float R2_logDepthEncodeFull | ( | const float | z, |
const float | depth_coefficient | ||
) |
Fully encode the given eye-space Z value.
z | An eye-space Z value |
depth_coefficient | The depth coefficient used to encode z |
Definition at line 51 of file R2LogDepth.h.
float R2_logDepthEncodePartial | ( | const float | z, |
const float | depth_coefficient | ||
) |
Partially encode the given positive eye-space Z value. This partial encoding can be used when performing part of the encoding in a vertex shader and the rest in a fragment shader (for efficiency reasons) - See R2_logDepthPrepareEyeZ.
z | An eye-space Z value |
depth_coefficient | The depth coefficient used to encode z |
Definition at line 33 of file R2LogDepth.h.
float R2_logDepthPrepareEyeZ | ( | const float | z | ) |
Prepare an eye-space Z value for encoding. See R2_logDepthEncodePartial.
z | An eye-space Z value |
Definition at line 15 of file R2LogDepth.h.