在Unity的URP Package中,Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl文件内有一大段关于各种规范的注释。本人读了一遍觉得还挺有用,特地翻译出来分享给大家。
下面开始原文+翻译。
Convention:
规范:
Unity is Y up and left handed in world space
Caution: When going from world space to view space, unity is right handed in view space and the determinant of the matrix is negative
For cubemap capture (reflection probe) view space is still left handed (cubemap convention) and the determinant is positive.
在Unity的世界空间中,Y朝上并且使用左手坐标系。
注意:从世界空间变换到视图空间的同时也会转变为右手坐标系,因此变换矩阵的行列式是负的。
对于反射探针获取的cubemap,按照一贯习惯,查看空间依然使用左手坐标系,因此行列式是正的。
The lighting code assume that 1 Unity unit (1uu) == 1 meters. This is very important regarding physically based light unit and inverse square attenuation
光照模型中默认按照1单位为1米进行计算,因此为了实现更逼真的渲染效果,一定要确保模型的尺寸比例是正确的。
space at the end of the variable name
WS: world space
RWS: Camera-Relat