浏览代码

Improve the formulation of the dominant specular dir

/main
Evgenii Golubev 8 年前
当前提交
5e512acb
共有 1 个文件被更改,包括 4 次插入5 次删除
  1. 9
      Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl

9
Assets/ScriptableRenderLoop/ShaderLibrary/ImageBasedLighting.hlsl


// Ref: "Moving Frostbite to PBR", p. 69.
float3 GetSpecularDominantDir(float3 N, float3 R, float roughness, float NdotV)
{
float a = 1.0 - roughness;
float s = sqrt(1.0 - roughness);
float sinNV = sqrt(1.0 - NdotV * NdotV);
float a = 1.0 - roughness;
float s = sqrt(a);
float lerpFactor = a * (s + roughness);
float lerpFactor = (s + roughness) * a;
float lerpFactor = s * saturate(lerp(s + s, a * a, sinNV));
float lerpFactor = (s + roughness) * saturate(lerp(a * a, a * a + a, NdotV * NdotV));
#endif
// The result is not normalized as we fetch in a cubemap

正在加载...
取消
保存