Skip to content

[Backport 2021.1][HDRP] Misc HDRP PR backport #3746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,239 changes: 669 additions & 570 deletions TestProjects/HDRP_RuntimeTests/Assets/Scenes/002-HDMaterials.unity

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_52555058f421518fa1159536b0ef5770_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_5837ea117a574c30b83a120690f269a8_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -57,6 +61,19 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -69,7 +86,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: -2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_52555058f421518fa1159536b0ef5770_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_5837ea117a574c30b83a120690f269a8_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -57,6 +61,19 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -69,7 +86,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: 3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_52555058f421518fa1159536b0ef5770_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_5837ea117a574c30b83a120690f269a8_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -57,6 +61,19 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -69,7 +86,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_52555058f421518fa1159536b0ef5770_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_5837ea117a574c30b83a120690f269a8_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -57,6 +61,19 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -69,7 +86,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: -2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_52555058f421518fa1159536b0ef5770_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_5837ea117a574c30b83a120690f269a8_Texture_1:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -57,6 +61,19 @@ Material:
m_Texture: {fileID: 2800000, guid: fcecce6d2c9be8d418a27f0658a2210d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -69,7 +86,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Material:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_22ab0c98da19fa8cb25fd19a0aeeb31b_Texture_1:
m_Texture: {fileID: 2800000, guid: 9afbfdeb6447dc74089f286f49995089, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_234b653769274d599f16c88325d2e6ae_Texture_1:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
Expand Down Expand Up @@ -69,6 +73,10 @@ Material:
m_Texture: {fileID: 2800000, guid: f23830c1beb532d4a8bf9a720ef56e25, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_922ed2f15209728c934f7ad08e8df067_Texture_1:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_998a067d9ebe483eaf2b10434380d263_Texture_1:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
Expand All @@ -77,6 +85,10 @@ Material:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_b38e27eec0c6198ab3dec7c4cf4437e3_Texture_1:
m_Texture: {fileID: 2800000, guid: f23830c1beb532d4a8bf9a720ef56e25, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SampleTexture2D_b4b43955db0f4c4b8749459e55a590f4_Texture_1:
m_Texture: {fileID: 2800000, guid: 9afbfdeb6447dc74089f286f49995089, type: 3}
m_Scale: {x: 1, y: 1}
Expand Down Expand Up @@ -105,6 +117,19 @@ Material:
m_Texture: {fileID: 2800000, guid: 9f19737ffbb4a694caf1778274c346ab, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AffectAO: 1
- _AffectAlbedo: 1
Expand All @@ -117,7 +142,9 @@ Material:
- _DecalColorMask1: 15
- _DecalColorMask2: 15
- _DecalColorMask3: 12
- _DecalMeshBiasType: 0
- _DecalMeshDepthBias: 0
- _DecalMeshViewBias: 0
- _DecalStencilRef: 16
- _DecalStencilWriteMask: 16
- _DrawOrder: 0
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions com.unity.render-pipelines.core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fixed the selection of the Additional properties from ALL/NONE when the option "Show additional properties" is disabled
- Fixed ACES tonemaping for Nintendo Switch by forcing some shader color conversion functions to full float precision.
- Fixed missing warning UI about Projector component being unsupported (case 1300327).
- Fixed the display name of a Volume Parameter when is defined the attribute InspectorName

## [10.2.0] - 2020-10-19

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using UnityEditor.AnimatedValues;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.Rendering;
Expand Down Expand Up @@ -294,7 +295,7 @@ public virtual void OnInspectorGUI()
// Display every field as-is
foreach (var parameter in m_Parameters)
{
if (parameter.displayName.text != "")
if (!string.IsNullOrEmpty(parameter.displayName.text))
PropertyField(parameter.param, parameter.displayName);
else
PropertyField(parameter.param);
Expand Down Expand Up @@ -401,36 +402,50 @@ protected void PropertyField(SerializedDataParameter property)
}

/// <summary>
/// Draws a given <see cref="SerializedDataParameter"/> in the editor using a custom label
/// and tooltip.
/// Handles unity built-in decorators (Space, Header, Tooltips, ...) from <see cref="SerializedDataParameter"/> attributes
/// </summary>
/// <param name="property">The property to draw in the editor.</param>
/// <param name="title">A custom label and/or tooltip.</param>
protected void PropertyField(SerializedDataParameter property, GUIContent title)
/// <param name="property">The property to obtain the attributes and handle the decorators</param>
/// <param name="title">A custom label and/or tooltip that might be updated by <see cref="TooltipAttribute"/> and/or by <see cref="InspectorNameAttribute"/></param>
void HandleDecorators(SerializedDataParameter property, GUIContent title)
{
// Handle unity built-in decorators (Space, Header, Tooltip etc)
foreach (var attr in property.attributes)
{
if (attr is PropertyAttribute)
if (!(attr is PropertyAttribute))
continue;

switch (attr)
{
if (attr is SpaceAttribute)
{
EditorGUILayout.GetControlRect(false, (attr as SpaceAttribute).height);
}
else if (attr is HeaderAttribute)
case SpaceAttribute spaceAttribute:
EditorGUILayout.GetControlRect(false, spaceAttribute.height);
break;
case HeaderAttribute headerAttribute:
{
var rect = EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight);
rect.y += 0f;
rect = EditorGUI.IndentedRect(rect);
EditorGUI.LabelField(rect, (attr as HeaderAttribute).header, EditorStyles.miniLabel);
var rect = EditorGUI.IndentedRect(EditorGUILayout.GetControlRect(false, EditorGUIUtility.singleLineHeight));
EditorGUI.LabelField(rect, headerAttribute.header, EditorStyles.miniLabel);
break;
}
else if (attr is TooltipAttribute)
case TooltipAttribute tooltipAttribute:
{
if (string.IsNullOrEmpty(title.tooltip))
title.tooltip = (attr as TooltipAttribute).tooltip;
title.tooltip = tooltipAttribute.tooltip;
break;
}
case InspectorNameAttribute inspectorNameAttribute:
title.text = inspectorNameAttribute.displayName;
break;
}
}
}

/// <summary>
/// Draws a given <see cref="SerializedDataParameter"/> in the editor using a custom label
/// and tooltip.
/// </summary>
/// <param name="property">The property to draw in the editor.</param>
/// <param name="title">A custom label and/or tooltip.</param>
protected void PropertyField(SerializedDataParameter property, GUIContent title)
{
HandleDecorators(property, title);

// Custom parameter drawer
VolumeParameterDrawer drawer;
Expand Down
Loading