浏览代码

Merge pull request #432 from Unity-Technologies/Branch_FixNormalInfluence

Branch fix normal influence
/stochastic_alpha_test
GitHub 7 年前
当前提交
d0ba0ab5
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 7
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl

7
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


float influenceFactor = BlendLayeredScalar(0.0, _InheritBaseNormal1, _InheritBaseNormal2, _InheritBaseNormal3, weights) * influenceMask;
// We will add smoothly the contribution of the normal map by lerping between vertex normal ( (0,0,1) in tangent space) and the actual normal from the main layer depending on the influence factor.
// Note: that we don't take details map into account here.
float3 mainNormalTS = lerp(float3(0.0, 0.0, 1.0), normalTS0, influenceFactor);
#ifdef SURFACE_GRADIENT
float3 neutralNormalTS = float3(0.0, 0.0, 0.0);
#else
float3 neutralNormalTS = float3(0.0, 0.0, 1.0);
#endif
float3 mainNormalTS = lerp(neutralNormalTS, normalTS0, influenceFactor);
// Add on our regular normal a bit of Main Layer normal base on influence factor. Note that this affect only the "visible" normal.
#ifdef SURFACE_GRADIENT

正在加载...
取消
保存