浏览代码

No renormalization on normals per-pixel for mobile.

/main
Aleksandr Kirillov 7 年前
当前提交
f7246274
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. 4
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/Core.hlsl
  2. 6
      ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl

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


half3 TangentToWorldNormal(half3 normalTangent, half3 tangent, half3 binormal, half3 normal)
{
half3x3 tangentToWorld = half3x3(tangent, binormal, normal);
#ifdef SHADER_API_MOBILE
return mul(normalTangent, tangentToWorld);
#else
#endif
}
// TODO: A similar function should be already available in SRP lib on master. Use that instead

6
ScriptableRenderPipeline/LightweightPipeline/LWRP/ShaderLibrary/LightweightPassLit.hlsl


inputData.normalWS = TangentToWorldNormal(normalTS, IN.tangent.xyz, IN.binormal.xyz, IN.normal.xyz);
#else
half3 viewDir = IN.viewDir;
inputData.normalWS = normalize(IN.normal);
#ifdef SHADER_API_MOBILE
inputData.normalWS = IN.normal;
#else
inputData.normalWS = normalize(IN.normal);
#endif
#endif
#ifdef SHADER_API_MOBILE

正在加载...
取消
保存