浏览代码

Fix IntegrateSpecularGGXIBLRef() for the standard GGX

/stochastic_alpha_test
Evgenii Golubev 7 年前
当前提交
594d4513
共有 1 个文件被更改,包括 13 次插入3 次删除
  1. 16
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitReference.hlsl

16
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitReference.hlsl


// Ref: Moving Frostbite to PBR (Appendix A)
float3 IntegrateSpecularGGXIBLRef(LightLoopContext lightLoopContext,
float3 V, PreLightData preLightData, EnvLightData lightData, BSDFData bsdfData,
uint sampleCount = 4096)
uint sampleCount = 2048)
float3x3 localToWorld = float3x3(bsdfData.tangentWS, bsdfData.bitangentWS, bsdfData.normalWS);
float3x3 localToWorld;
if (bsdfData.materialId == MATERIALID_LIT_ANISO)
{
localToWorld = float3x3(bsdfData.tangentWS, bsdfData.bitangentWS, bsdfData.normalWS);
}
else
{
// We do not have a tangent frame unless we use anisotropic GGX.
localToWorld = GetLocalFrame(bsdfData.normalWS);
}
float NdotV = max(preLightData.NdotV, MIN_N_DOT_V);
float3 acc = float3(0.0, 0.0, 0.0);

{
ImportanceSampleGGX(u, V, localToWorld, bsdfData.roughness, NdotV, L, VdotH, NdotL, weightOverPdf);
}
if (NdotL > 0.0)
{

正在加载...
取消
保存