Skip to content

Commit 475e9f1

Browse files
remi-chapelainEvergreen
authored andcommitted
[Backport 2023.2][HDRP] Fix clouds not affected by intensity multiplier
Backport of #47069
1 parent a5c4e53 commit 475e9f1

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Packages/com.unity.render-pipelines.high-definition/Documentation~/reference-light-component.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ These settings define the emissive behavior of your Light. You can set the Light
124124
| **Affect Specular** | Enable the checkbox to apply [specular](https://docs.unity3d.com/Manual/shader-NormalSpecular.html) lighting to this Light.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode**. |
125125
| **Range Attenuation** | Enable the checkbox to make this Light shine uniformly across its range. This stops light from fading around the edges. This setting is useful when the range limit isn't visible on screen, and you don't want the edges of your light to fade out. This property is available for all **Light Types** except **Directional**.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode** for **Type** Area. |
126126
| **Fade Distance** | The distance between the Light source and the Camera at which the Light begins to fade out. Measured in meters. This property is available for all **Light Types** except **Directional**.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode**. |
127-
| **Intensity Multiplier** | A multiplier that gets applied to the intensity of the Light. Doesn't affect the intensity value, but only gets applied during the evaluation of the lighting. You can also modify this property via [Timeline](https://docs.unity3d.com/Manual/TimelineSection.html), Scripting or [animation](https://docs.unity3d.com/Manual/animeditor-AnimatingAGameObject.html). The parameter lets you fade the Light in and out without having to store its original intensity.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode**. |
127+
| **Intensity Multiplier** | A multiplier that gets applied to the intensity of the Light. Doesn't affect the intensity value, but only gets applied during the evaluation of the lighting. You can also modify this property via [Timeline](https://docs.unity3d.com/Manual/TimelineSection.html), Scripting or [animation](https://docs.unity3d.com/Manual/animeditor-AnimatingAGameObject.html). The parameter lets you fade the Light in and out without having to store its original intensity.<br />This property does not affect the [Physically Based Sky](physically-based-sky-volume-override-reference.html) rendering for the main directionnal light.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode**. |
128128
| **Display Emissive Mesh** | Enable the checkbox to make Unity automatically generate a Mesh with an emissive Material using the size, color, and intensity of this Light. Unity automatically adds the Mesh and Material to the GameObject the Light component is attached to. This property is available for **Rectangle** and **Tube** Lights.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. (In case of an IES profile and a cookie used at the same time, only the cookie will be displayed). |
129129
| **Include For Ray Tracing** | Enable the checkbox to make this Light active when you enable the **Ray Tracing** [Frame Setting](Frame-Settings.md) on the Camera. This applies to rasterization and [ray tracing](Ray-Tracing-Getting-Started.md) passes.<br />This property only appears when you enable [additional properties](expose-all-additional-properties.md) for this section. It's only available in Realtime or Mixed light **Mode**. |
130130

Packages/com.unity.render-pipelines.high-definition/Editor/Lighting/HDLightUI.Skin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sealed class Styles
4646
public readonly GUIContent affectDiffuse = EditorGUIUtility.TrTextContent("Affect Diffuse", "When disabled, HDRP does not calculate diffuse lighting for this Light. Does not increase performance as HDRP still calculates the diffuse lighting.");
4747
public readonly GUIContent affectSpecular = EditorGUIUtility.TrTextContent("Affect Specular", "When disabled, HDRP does not calculate specular lighting for this Light. Does not increase performance as HDRP still calculates the specular lighting.");
4848
public readonly GUIContent nonLightmappedOnly = EditorGUIUtility.TrTextContent("Shadowmask Mode", "Determines Shadowmask functionality when using Mixed lighting. Distance Shadowmask casts real-time shadows within the Shadow Distance, and baked shadows beyond. In Shadowmask mode, static GI contributors always cast baked shadows.\nEnable Shadowmask support in the HDRP asset to make use of this feature. Only available when Lighting Mode is set to Shadowmask in the Lighting window.");
49-
public readonly GUIContent lightDimmer = EditorGUIUtility.TrTextContent("Intensity Multiplier", "Multiplies the intensity of the Light by the given number. This is useful for modifying the intensity of multiple Lights simultaneously without needing know the intensity of each Light.");
49+
public readonly GUIContent lightDimmer = EditorGUIUtility.TrTextContent("Intensity Multiplier", "Multiplies the intensity of the Light by the given number. This is useful for modifying the intensity of multiple Lights simultaneously without needing know the intensity of each Light. This property does not affect the Physically Based Sky rendering for the main directionnal light.");
5050
public readonly GUIContent fadeDistance = EditorGUIUtility.TrTextContent("Fade Distance", "Sets the distance from the camera at which light smoothly fades out before HDRP culls it completely. This minimizes popping.");
5151
public readonly GUIContent innerOuterSpotAngle = EditorGUIUtility.TrTextContent("Inner / Outer Spot Angle", "Controls the inner and outer angles in degrees, at the base of a Spot light's cone.");
5252
public readonly GUIContent spotIESCutoffPercent = EditorGUIUtility.TrTextContent("IES Cutoff Angle (%)", "Cutoff the IES Light in percent, of the base angle of the Spot Light's cone.");

Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ void UpdateShaderVariableslClouds(ref ShaderVariablesClouds cb, HDCamera hdCamer
358358
// Grab the target sun additional data
359359
m_CurrentSunLight.TryGetComponent<HDAdditionalLightData>(out additionalLightData);
360360
// m_CurrentSunLightDataIndex is supposed to be guaranteed to be non -1 if the current sun is not null
361-
cb._SunLightColor = m_GpuLightsBuilder.directionalLights[m_CurrentSunLightDataIndex].color * settings.sunLightDimmer.value;
361+
cb._SunLightColor = m_GpuLightsBuilder.directionalLights[m_CurrentSunLightDataIndex].color * settings.sunLightDimmer.value * additionalLightData.lightDimmer;
362362
cb._SunDirection = -currentSun.transform.forward;
363363
}
364364
else

Packages/com.unity.render-pipelines.high-definition/Runtime/Sky/CloudSystem/CloudLayer/CloudLayerRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public override void RenderClouds(BuiltinSkyParameters builtinParams, bool rende
141141

142142
var lightComponent = builtinParams.sunLight.GetComponent<Light>();
143143
var additionalLightData = builtinParams.sunLight.GetComponent<HDAdditionalLightData>();
144-
lightColor = LightUtils.EvaluateLightColor(lightComponent, additionalLightData);
144+
lightColor = LightUtils.EvaluateLightColor(lightComponent, additionalLightData) * additionalLightData.lightDimmer;
145145
}
146146

147147
s_VectorArray[0] = cloudLayer.layerA.Color * lightColor; s_VectorArray[1] = cloudLayer.layerB.Color * lightColor;

0 commit comments

Comments
 (0)