浏览代码

Improve the remapping of the FGD texture

/Add-support-for-light-specular-color-tint
Evgenii Golubev 7 年前
当前提交
9968e7e6
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 8
      ScriptableRenderPipeline/Core/ShaderLibrary/ImageBasedLighting.hlsl
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

8
ScriptableRenderPipeline/Core/ShaderLibrary/ImageBasedLighting.hlsl


}
}
// Remap from [0, 1.5] to [0, 1] range.
acc.z /= 1.5;
acc /= sampleCount;
return acc / sampleCount;
// Remap from the [0.5, 1.5] to the [0, 1] range.
acc.z -= 0.5;
return acc;
}
uint GetIBLRuntimeFilterSampleCount(uint mipLevel)

5
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


#ifdef LIT_DIFFUSE_LAMBERT_BRDF
diffuseFGD = 1.0;
#else
// Remap from [0, 1] to [0, 1.5] range.
diffuseFGD = 1.5 * preFGD.z;
// Remap from the [0, 1] to the [0.5, 1.5] range.
diffuseFGD = preFGD.z + 0.5;
#endif
reflectivity = preFGD.y;

// envDiffuseLighting is used for refraction in this Lit material. Use the weight to balance between transmission and reflection
diffuseLighting = lerp(directDiffuseLighting + bakeDiffuseLighting, accLighting.envDiffuseLighting, accLighting.envDiffuseLightingWeight);
specularLighting = accLighting.dirSpecularLighting + accLighting.punctualSpecularLighting + accLighting.areaSpecularLighting + accLighting.envSpecularLighting;
// Rescale the GGX to account for the multiple scattering.
specularLighting *= 1 + bsdfData.fresnel0 * preLightData.energyCompensation;
}
正在加载...
取消
保存