浏览代码

Some extra cleanup

/main
sebastienlagarde 6 年前
当前提交
6a64d66c
共有 3 个文件被更改,包括 2 次插入11 次删除
  1. 2
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/BSDF.hlsl
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Material/LTCAreaLight/LTCAreaLight.cs
  3. 9
      com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl

2
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/BSDF.hlsl


// The f0 or the base should account for the new computed eta_2 on top.
// This is optionally done if we are given the needed current ior over the base layer that is accounted for
// in the baseLayerFresnel0 parameter:
if(iorOverBaseLayer > 0.0)
if (iorOverBaseLayer > 0.0)
{
// Fresnel0ToIor will give us a ratio of baseIor/topIor, hence we * iorOverBaseLayer to get the baseIor
real3 baseIor = iorOverBaseLayer * Fresnel0ToIor(baseLayerFresnel0 + 0.0001); // guard against 1.0

2
com.unity.render-pipelines.high-definition/HDRP/Material/LTCAreaLight/LTCAreaLight.cs


int m_refCounting;
// For area lighting - We pack all texture inside a texture array to reduce the number of resource required
Texture2DArray m_LtcData; // 0: m_LtcGGXMatrix - RGBA,12: m_LtcDisneyDiffuseMatrix - RGBA
Texture2DArray m_LtcData; // 0: m_LtcGGXMatrix - RGBA, 1: m_LtcDisneyDiffuseMatrix - RGBA
const int k_LtcLUTMatrixDim = 3; // size of the matrix (3x3)
const int k_LtcLUTResolution = 64;

9
com.unity.render-pipelines.high-definition/HDRP/Material/Lit/Lit.hlsl


preLightData.coatPartLambdaV = GetSmithJointGGXPartLambdaV(NdotV, CLEAR_COAT_ROUGHNESS);
preLightData.coatIblR = reflect(-V, N);
preLightData.coatIblF = F_Schlick(CLEAR_COAT_F0, NdotV) * bsdfData.coatMask;
}

// We don't multiply by 'bsdfData.diffuseColor' here. It's done only once in PostEvaluateBSDF().
// See comment for specular magnitude, it apply to diffuse as well
#ifdef USE_DIFFUSE_LAMBERT_BRDF
lighting.diffuse = ltcValue;
#else
#endif
UNITY_BRANCH if (HasFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{

ltcValue *= lightData.diffuseScale;
// We don't multiply by 'bsdfData.diffuseColor' here. It's done only once in PostEvaluateBSDF().
// See comment for specular magnitude, it apply to diffuse as well
#ifdef USE_DIFFUSE_LAMBERT_BRDF
lighting.diffuse = ltcValue;
#else
#endif
UNITY_BRANCH if (HasFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{

正在加载...
取消
保存