Skip to content

Commit 54c3504

Browse files
Fixed light layers not correctly disabled when the lightlayers is set to Nothing and Lightlayers isn't enabled in HDRP Asset (#584)
1 parent 208c30d commit 54c3504

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
621621
- Cloned volume profile from read only assets are created in the root of the project. (case 1154961)
622622
- Fixed Wizard check on default volume profile to also check it is not the default one in package.
623623
- Fix erroneous central depth sampling in TAA.
624+
- Fixed light layers not correctly disabled when the lightlayers is set to Nothing and Lightlayers isn't enabled in HDRP Asset
624625

625626
### Changed
626627
- Improve MIP selection for decals on Transparents

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ internal void GetDirectionalLightData(CommandBuffer cmd, HDCamera hdCamera, Visi
11911191

11921192
var lightData = new DirectionalLightData();
11931193

1194-
lightData.lightLayers = additionalLightData.GetLightLayers();
1194+
lightData.lightLayers = hdCamera.frameSettings.IsEnabled(FrameSettingsField.LightLayers) ? additionalLightData.GetLightLayers() : uint.MaxValue;
11951195

11961196
// Light direction for directional is opposite to the forward direction
11971197
lightData.forward = light.GetForward();
@@ -1343,7 +1343,7 @@ internal void GetLightData(CommandBuffer cmd, HDCamera hdCamera, HDShadowSetting
13431343
var lightType = processedData.lightType;
13441344

13451345
var visibleLightAxisAndPosition = light.GetAxisAndPosition();
1346-
lightData.lightLayers = additionalLightData.GetLightLayers();
1346+
lightData.lightLayers = hdCamera.frameSettings.IsEnabled(FrameSettingsField.LightLayers) ? additionalLightData.GetLightLayers() : uint.MaxValue;
13471347

13481348
lightData.lightType = gpuLightType;
13491349

@@ -1840,7 +1840,7 @@ internal bool GetEnvLightData(CommandBuffer cmd, HDCamera hdCamera, in Processed
18401840
return false;
18411841

18421842
InfluenceVolume influence = probe.influenceVolume;
1843-
envLightData.lightLayers = probe.lightLayersAsUInt;
1843+
envLightData.lightLayers = hdCamera.frameSettings.IsEnabled(FrameSettingsField.LightLayers) ? probe.lightLayersAsUInt : uint.MaxValue;
18441844
envLightData.influenceShapeType = influence.envShape;
18451845
envLightData.weight = processedProbe.weight;
18461846
envLightData.multiplier = probe.multiplier * m_indirectLightingController.indirectSpecularIntensity.value;

0 commit comments

Comments
 (0)