浏览代码

got rid of the unnecessary tangent normalization. mikkts compliance only requires normalization when converting normal from TS to WS.

/backport-shader-optimization
Felipe Lira 7 年前
当前提交
0bd77cdc
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 3
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl

3
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl


void OutputTangentToWorld(half4 vertexTangent, half3 vertexNormal, out half3 tangentWS, out half3 binormalWS, out half3 normalWS)
{
// mikkts space compliant. only normalize when extracting normal at frag.
tangentWS = normalize(mul((half3x3)UNITY_MATRIX_M, vertexTangent.xyz));
tangentWS = TransformObjectToWorldDir(vertexTangent.xyz);
binormalWS = cross(normalWS, tangentWS) * sign;
}

正在加载...
取消
保存