浏览代码

Fix issue with sky that was not lighting correctly the scene

/main
sebastienlagarde 7 年前
当前提交
b8aab929
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. 15
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.hlsl

15
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.hlsl


}
// Define macro for a better understanding of the loop
#define EVALUATE_BSDF_ENV(envLightData, TYPE, type) \
if (IsMatchingLightLayer(envLightData.lightLayers, builtinData.renderingLayers)) \
{ \
#define EVALUATE_BSDF_ENV_SKY(envLightData, TYPE, type) \
AccumulateIndirectLighting(lighting, aggregateLighting); \
}
AccumulateIndirectLighting(lighting, aggregateLighting);
// Environment cubemap test lightlayers, sky don't test it
#define EVALUATE_BSDF_ENV(envLightData, TYPE, type) if (IsMatchingLightLayer(envLightData.lightLayers, builtinData.renderingLayers)) { EVALUATE_BSDF_ENV_SKY(envLightData, TYPE, type) }
// First loop iteration
if (featureFlags & (LIGHTFEATUREFLAGS_ENV | LIGHTFEATUREFLAGS_SKY | LIGHTFEATUREFLAGS_SSREFRACTION | LIGHTFEATUREFLAGS_SSREFLECTION))

// Only apply the sky if we haven't yet accumulated enough IBL lighting.
if (reflectionHierarchyWeight < 1.0)
{
EVALUATE_BSDF_ENV(envLightSky, REFLECTION, reflection);
EVALUATE_BSDF_ENV_SKY(envLightSky, REFLECTION, reflection);
}
if (featureFlags & LIGHTFEATUREFLAGS_SSREFRACTION)

EVALUATE_BSDF_ENV(envLightSky, REFRACTION, refraction);
EVALUATE_BSDF_ENV_SKY(envLightSky, REFRACTION, refraction);
#undef EVALUATE_BSDF_ENV_SKY
// Also Apply indiret diffuse (GI)
// PostEvaluateBSDF will perform any operation wanted by the material and sum everything into diffuseLighting and specularLighting

正在加载...
取消
保存