浏览代码

More correction + add unity convention comment

/feature-ReflectionProbeFit
sebastienlagarde 7 年前
当前提交
0fe1f28c
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. 5
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl
  2. 2
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonLighting.hlsl

5
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/Common.hlsl


// Convention:
// Unity is Y up - left handed
// 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.
// The lighting code assume that 1 Unity unit (1uu) == 1 meters. This is very important regarding physically based light unit and inverse square attenuation
// space at the end of the variable name

2
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonLighting.hlsl


#define UNITY_COMMON_LIGHTING_INCLUDED
// These clamping function to max of floating point 16 bit are use to prevent INF in code in case of extreme value
TEMPLATE_1_FLT(ClampToFloat16Max, value, min(value, HALF_MAX))
TEMPLATE_1_REAL(ClampToFloat16Max, value, return min(value, HALF_MAX))
// Ligthing convention
// Light direction is oriented backward (-Z). i.e in shader code, light direction is -lightData.forward

正在加载...
取消
保存