35 const float depth_coefficient)
37 float half_co = depth_coefficient * 0.5;
38 float clamp_z = max (0.000001, z);
39 return log2 (clamp_z) * half_co;
53 const float depth_coefficient)
55 float half_co = depth_coefficient * 0.5;
56 float clamp_z = max (0.000001, z + 1.0);
57 return log2 (clamp_z) * half_co;
74 const float depth_coefficient)
76 float half_co = depth_coefficient * 0.5;
77 float exponent = z / half_co;
78 return pow (2.0, exponent) - 1.0;
81 #endif // R2_LOG_DEPTH_H 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)
float R2_logDepthPrepareEyeZ(const float z)