赣州市洪水风险预警系统三维版本
guoshilong
2023-02-04 1a2905dce9e5d69df9619cfe513cc2e80b1424fb
1
2
3
4
5
6
7
8
9
10
11
float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
    float near = czm_currentFrustum.x;
    float far = czm_currentFrustum.y;
    float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
    float depthFromNear = pow(2.0, log2Depth) - 1.0;
    return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
    return logZ;
}