Skip to content

Commit 67ae3c3

Browse files
Merge Hd/bugfix #5255
1 parent 81dc1f3 commit 67ae3c3

File tree

12 files changed

+43
-22
lines changed

12 files changed

+43
-22
lines changed

com.unity.render-pipelines.core/Editor/Volume/Drawers/IntParameterDrawer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ public override bool OnGUI(SerializedDataParameter parameter, GUIContent title)
116116
if (value.propertyType != SerializedPropertyType.LayerMask)
117117
return false;
118118

119-
value.intValue = EditorGUILayout.MaskField(title, value.intValue, InternalEditorUtility.layers);
119+
value.intValue = InternalEditorUtility.ConcatenatedLayersMaskToLayerMask(
120+
EditorGUILayout.MaskField(title, InternalEditorUtility.LayerMaskToConcatenatedLayersMask(value.intValue), InternalEditorUtility.layers));
120121
return true;
121122
}
122123
}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2424
- Fixed the FreeCamera and SimpleCameraController mouse rotation unusable at low framerate (case 1340344).
2525
- Fixed warning "Releasing render texture that is set to be RenderTexture.active!" on pipeline disposal / hdrp live editing.
2626
- Fixed a nullref in volume system after deleting a volume object (case 1348374).
27+
- Fixed update order in Graphics Compositor causing jumpy camera updates (case 1345566).
28+
- Fixed material inspector that allowed setting intensity to an infinite value.
29+
- Fixed issue when switching between non-persistent cameras when path tarcing is enabled (case 1337843).
30+
- Fixed issue with the LayerMaskParameter class storing an erroneous mask value (case 1345515).
31+
- Fixed issue with vertex color defaulting to 0.0 when not defined, in ray/path tracing (case 1348821).
32+
- Fix issue with a compute dispatch being with 0 threads on extremely small resolutions.
2733

2834
## [10.6.0] - 2021-04-29
2935

com.unity.render-pipelines.high-definition/Documentation~/Decal-Projector.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ Using the Inspector allows you to change all of the Decal Projector properties,
4949

5050
## Limitations
5151

52-
- The Decal Projector can affect opaque Materials with either a [Decal Shader](Decal-Shader.md) or a [Decal Master Stack](master-stack-decal.md). However, it can only affect transparent Materials with the [Decal Shader](Decal-Shader.md).
53-
- Decal Emissive isn't supported on Transparent Material.
52+
- The Decal Projector can affect opaque Materials with either a [Decal Shader](Decal-Shader.md) or a [Decal Master Stack](master-stack-decal.md). However, it can only affect transparent Materials with the [Decal Shader](Decal-Shader.md).
53+
- Emissive decals isn't supported on Transparent Material.
54+
- Emissive decals always give an additive positive contribution. This property does not affect the existing emissive properties of the Materials assigned to a GameObject.
5455
- The **Receive Decals** property of Materials in HDRP does not affect emissive decals. HDRP always renders emissive decals unless you use Decal Layers, which can disable emissive decals on a Layer by Layer basis.
5556
- If you project a decal onto a transparent surface, HDRP ignores the decal's Texture tiling.
5657
- In **Project Settings > Graphics**, if **Instancing Variants** is set to **Strip All**, Unity strips the Decal Shader this component references when you build your Project. This happens even if you include the Shader in the **Always Included Shaders** list. If Unity strips the Shader during the build process, the decal does not appear in your built Application.

com.unity.render-pipelines.high-definition/Documentation~/Decal-Shader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ These properties allow you to set the affected attributes of the Material the de
1515
| **Affect Metal** | Enable the checkbox to make the decal use the metallic property of its **Mask Map**. Otherwise the decal has no metallic effect. Uses the red channel of the **Mask Map**.<br />This property only appears when you enable the **Metal and Ambient Occlusion properties** checkbox in your [HDRP Asset](HDRP-Asset.md#Decals). |
1616
| **Affect Ambient Occlusion** | Enable the checkbox to make the decal use the ambient occlusion property of its **Mask Map**. Otherwise the decal has no ambient occlusion effect. Uses the green channel of the **Mask Map**.<br />This property only appears when you enable the **Metal and Ambient Occlusion properties** checkbox in your [HDRP Asset](HDRP-Asset.md#Decals). |
1717
| **Affect Smoothness** | Enable the checkbox to make the decal use the smoothness property of its **Mask Map**. Otherwise the decal has no smoothness effect. Uses the alpha channel of the **Mask Map**.<br /> |
18-
| **Affect Emissive** | Enable the checkbox to make this decal emissive. When enabled, this Material appears self-illuminated and acts as a visible source of light. This property does not work with transparent receiving Materials. |
18+
| **Affect Emissive** | Enable the checkbox to make this decal emissive. When enabled, this Material appears self-illuminated and acts as a visible source of light. This property does not work with transparent receiving Materials. Emissive decals always give an additive positive contribution. This property does not affect the existing emissive properties of the Materials assigned to a GameObject. |
1919

2020

2121
### Surface Inputs

com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace UnityEditor.Rendering.HighDefinition
1111
{
1212
class EmissionUIBlock : MaterialUIBlock
1313
{
14+
static float s_MaxEvValue = Mathf.Floor(LightUtils.ConvertLuminanceToEv(float.MaxValue));
15+
1416
[Flags]
1517
public enum Features
1618
{
@@ -119,7 +121,7 @@ internal static void UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(Materia
119121

120122
internal static void UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(MaterialProperty emissiveColorLDR, MaterialProperty emissiveIntensity, MaterialProperty emissiveColor)
121123
{
122-
Color emissiveColorLDRLinear = emissiveColorLDR.colorValue / emissiveIntensity.floatValue;
124+
Color emissiveColorLDRLinear = emissiveColor.colorValue / emissiveIntensity.floatValue;
123125
emissiveColorLDR.colorValue = emissiveColorLDRLinear.gamma;
124126
}
125127

@@ -183,7 +185,7 @@ void DrawEmissionGUI()
183185
{
184186
float evValue = LightUtils.ConvertLuminanceToEv(emissiveIntensity.floatValue);
185187
evValue = EditorGUILayout.FloatField(Styles.emissiveIntensityText, evValue);
186-
newIntensity = Mathf.Clamp(evValue, 0, float.MaxValue);
188+
newIntensity = Mathf.Clamp(evValue, 0, s_MaxEvValue);
187189
emissiveIntensity.floatValue = LightUtils.ConvertEvToLuminance(evValue);
188190
}
189191
else

com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,8 @@ public void UpdateLayerSetup()
503503
SetupLayerPriorities();
504504
}
505505

506-
// Update is called once per frame
507-
void Update()
506+
// LateUpdate is called once per frame
507+
void LateUpdate()
508508
{
509509
// TODO: move all validation calls to onValidate. Before doing it, this needs some extra testing to ensure nothing breaks
510510
if (enableOutput == false || ValidatePipeline() == false || ValidateAndFixRuntime() == false || RuntimeCheck() == false)

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99

1010
#ifndef SCALARIZE_LIGHT_LOOP
1111
// We perform scalarization only for forward rendering as for deferred loads will already be scalar since tiles will match waves and therefore all threads will read from the same tile.
12-
// More info on scalarization: https://flashypixels.wordpress.com/2018/11/10/intro-to-gpu-scalarization-part-2-scalarize-all-the-lights/
12+
// More info on scalarization: https://flashypixels.wordpress.com/2018/11/10/intro-to-gpu-scalarization-part-2-scalarize-all-the-lights/ .
13+
// Note that it is currently disabled on gamecore platforms for issues with wave intrinsics and the new compiler, it will be soon investigated, but we disable it in the meantime.
1314
#define SCALARIZE_LIGHT_LOOP (defined(PLATFORM_SUPPORTS_WAVE_INTRINSICS) && !defined(LIGHTLOOP_DISABLE_TILE_AND_CLUSTER) && !defined(SHADER_API_GAMECORE) && SHADERPASS == SHADERPASS_FORWARD)
1415
#endif
1516

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ namespace UnityEngine.Rendering.HighDefinition
88
/// </summary>
99
class LightUtils
1010
{
11+
static float s_LuminanceToEvFactor = Mathf.Log(100f / ColorUtils.s_LightMeterCalibrationConstant, 2);
12+
static float s_EvToLuminanceFactor = -Mathf.Log(100f / ColorUtils.s_LightMeterCalibrationConstant, 2);
13+
1114
// Physical light unit helper
1215
// All light unit are in lumen (Luminous power)
1316
// Punctual light (point, spot) are convert to candela (cd = lumens / steradian)
@@ -163,8 +166,7 @@ public static float ConvertCandelaToLux(float candela, float distance)
163166
/// <returns></returns>
164167
public static float ConvertEvToLuminance(float ev)
165168
{
166-
float k = ColorUtils.s_LightMeterCalibrationConstant;
167-
return (k / 100.0f) * Mathf.Pow(2, ev);
169+
return Mathf.Pow(2, ev + s_EvToLuminanceFactor);
168170
}
169171

170172

@@ -194,8 +196,7 @@ public static float ConvertEvToLux(float ev, float distance)
194196
/// <returns></returns>
195197
public static float ConvertLuminanceToEv(float luminance)
196198
{
197-
float k = ColorUtils.s_LightMeterCalibrationConstant;
198-
return (float)Math.Log((luminance * 100f) / k, 2);
199+
return Mathf.Log(luminance, 2) + s_LuminanceToEvFactor;
199200
}
200201

201202
/// <summary>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ static void GenerateMaxZ(in GenerateMaxZParameters parameters, RTHandle depthTex
481481
cmd.SetComputeVectorParam(cs, HDShaderIDs._SrcOffsetAndLimit, srcLimitAndDepthOffset);
482482
cmd.SetComputeFloatParam(cs, HDShaderIDs._DilationWidth, parameters.dilationWidth);
483483

484-
int finalMaskW = maskW / 2;
485-
int finalMaskH = maskH / 2;
484+
int finalMaskW = Mathf.CeilToInt(maskW / 2.0f);
485+
int finalMaskH = Mathf.CeilToInt(maskH / 2.0f);
486486

487487
dispatchX = HDUtils.DivRoundUp(finalMaskW, 8);
488488
dispatchY = HDUtils.DivRoundUp(finalMaskH, 8);

com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.hlsl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ TEXTURE2D_X(_ShadowMaskTexture); // Alias for shadow mask, so we don't need to k
8888
// If a user do a lighting architecture without material classification, this can be remove
8989
#include "Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightLoop/LightLoop.cs.hlsl"
9090

91-
// Currently disable SSR until critical editor fix is available
92-
#undef LIGHTFEATUREFLAGS_SSREFLECTION
93-
#define LIGHTFEATUREFLAGS_SSREFLECTION 0
94-
9591
// Combination need to be define in increasing "comlexity" order as define by FeatureFlagsToTileVariant
9692
static const uint kFeatureVariantFlags[NUM_FEATURE_VARIANTS] =
9793
{

0 commit comments

Comments
 (0)