未验证 提交 b042d3b7 编写于 作者: V Vis 提交者: GitHub

FormulaDerivationNoteForViewZToPerspectiveDepthAndPerspectiveDepthToViewZPr (#21557)

上级 e25b79d5
......@@ -42,6 +42,8 @@ float orthographicDepthToViewZ( const in float linearClipZ, const in float near,
return linearClipZ * ( near - far ) - near;
}
// NOTE: https://twitter.com/gonnavis/status/1377183786949959682
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
return (( near + viewZ ) * far ) / (( far - near ) * viewZ );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册