浏览代码

Add Disney Diffuse support for LTC

/main
Evgenii Golubev 8 年前
当前提交
bc786266
共有 1 个文件被更改,包括 14 次插入9 次删除
  1. 23
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl

23
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl


// Evaluate the diffuse part.
{
//#ifdef DIFFUSE_LAMBERT_BRDF
static float3x3 identity = {1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0};
ltcValue = LTCEvaluate(V, bsdfData.normalWS, identity, L, lightData.twoSided);
#ifdef DIFFUSE_LAMBERT_BRDF
static const float3x3 identity3x3 = {1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0};
ltcValue = LTCEvaluate(V, bsdfData.normalWS, identity3x3, L, lightData.twoSided);
#else
ltcValue = LTCEvaluate(V, bsdfData.normalWS, preLightData.ltcXformDisneyDiffuse, L, lightData.twoSided);
#endif
if (ltcValue == 0.0)
{

#ifndef DIFFUSE_LAMBERT_BRDF
// TODO: verify that we do not need to multiply by PI.
ltcValue *= preLightData.ltcDisneyDiffuseMagnitude;
#endif
//#else
// TODO: Disney
//#endif
}
// Evaluate the specular part.

正在加载...
取消
保存