浏览代码

Add a reference implementation of transmission for rectangular area lights

/main
Evgenii Golubev 7 年前
当前提交
291342ad
共有 1 个文件被更改,包括 21 次插入0 次删除
  1. 21
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl

21
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


ltcValue *= lightData.specularScale;
specularLighting = fresnelTerm * lightData.color * ltcValue;
}
[branch] if (bsdfData.enableTransmission)
{
// Currently, we only model diffuse transmission. Specular transmission is not yet supported.
// We assume that the back side of the object is a uniformly illuminated infinite plane
// (we reuse the illumination) with the reversed normal of the current sample.
#if 1 // Reference transmission implementation
float3 backN = -bsdfData.normalWS;
float3 backV = -V;
// Assume a Lambertian model for performance and simplicity.
ltcValue = LTCEvaluate(matL, backV, backN, preLightData.NdotV, k_identity3x3);
#else
#endif // Reference transmission implementation
float3 backLight = lightData.color * (ltcValue * lightData.diffuseScale);
// We use diffuse lighting for accumulation since it is going to be blurred during the SSS pass.
diffuseLighting += backLight * bsdfData.transmittance; // Premultiplied with the diffuse color
}
#endif // LIT_DISPLAY_REFERENCE_AREA
}

正在加载...
取消
保存