Skip to content

Commit cb17dc6

Browse files
committed
Make the LightLoop ignore lights that are hidden by the sceneview visibility toggle.
1 parent 611469e commit cb17dc6

File tree

1 file changed

+8
-0
lines changed
  • com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop

1 file changed

+8
-0
lines changed

com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,14 @@ int PreprocessVisibleLights(HDCamera hdCamera, CullingResults cullResults, Debug
23752375
bool contributesToLighting = ((additionalData.lightDimmer > 0) && (additionalData.affectDiffuse || additionalData.affectSpecular)) || (additionalData.volumetricDimmer > 0);
23762376
contributesToLighting = contributesToLighting && (processedData.lightDistanceFade > 0);
23772377

2378+
// custom-begin:
2379+
#if UNITY_EDITOR
2380+
// Skip light sources that are hidden by the scene visibility toggle.
2381+
// This is necessary to support hiding light sources in baked reflection probes.
2382+
contributesToLighting &= !UnityEditor.SceneVisibilityManager.instance.IsHidden(light.light.gameObject);
2383+
#endif
2384+
// custom-end
2385+
23782386
if (!contributesToLighting)
23792387
continue;
23802388

0 commit comments

Comments
 (0)