Skip to content

Commit 65a7fde

Browse files
authored
Merge pull request #8280 from Unity-Technologies/internal/6000.3/staging
Mirror Internal/6000.3/staging
2 parents 0a60eb8 + 2e03b89 commit 65a7fde

File tree

27 files changed

+3424
-38
lines changed

27 files changed

+3424
-38
lines changed

Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentEditor.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,24 +428,27 @@ public override void OnInspectorGUI()
428428
}
429429
}
430430

431+
GUIContent m_DisplayTitle;
431432
/// <summary>
432433
/// Sets the label for the component header. Override this method to provide
433434
/// a custom label. If you don't, Unity automatically obtains one from the class name.
434435
/// </summary>
435436
/// <returns>A label to display in the component header.</returns>
436437
public virtual GUIContent GetDisplayTitle()
437438
{
439+
if (m_DisplayTitle != null) return m_DisplayTitle;
440+
438441
var volumeComponentType = volumeComponent.GetType();
439442
var displayInfo = volumeComponentType.GetCustomAttribute<DisplayInfoAttribute>();
440443
if (displayInfo != null && !string.IsNullOrWhiteSpace(displayInfo.name))
441-
return EditorGUIUtility.TrTextContent(displayInfo.name, string.Empty);
444+
return m_DisplayTitle = EditorGUIUtility.TrTextContent(displayInfo.name, string.Empty);
442445

443446
#pragma warning disable CS0618
444447
if (!string.IsNullOrWhiteSpace(volumeComponent.displayName))
445-
return EditorGUIUtility.TrTextContent(volumeComponent.displayName, string.Empty);
448+
return m_DisplayTitle = EditorGUIUtility.TrTextContent(volumeComponent.displayName, string.Empty);
446449
#pragma warning restore CS0618
447450

448-
return EditorGUIUtility.TrTextContent(ObjectNames.NicifyVariableName(volumeComponentType.Name) , string.Empty);
451+
return m_DisplayTitle = EditorGUIUtility.TrTextContent(ObjectNames.NicifyVariableName(volumeComponentType.Name), string.Empty);
449452
}
450453

451454
void AddToggleState(GUIContent content, bool state)

Packages/com.unity.render-pipelines.core/Editor/Volume/VolumeComponentListEditor.cs

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ void CreateEditor(VolumeComponent component, SerializedProperty property, int in
155155
else
156156
m_Editors[index] = editor;
157157

158+
FilterEditorsBySearch();
159+
158160
DocumentationUtils.TryGetHelpURL(component.GetType(), out string helpUrl);
159161
helpUrl ??= string.Empty;
160162
m_VolumeComponentHelpUrls[editor] = helpUrl;
@@ -222,9 +224,22 @@ public void Clear()
222224
asset = null;
223225
}
224226

227+
readonly HashSet<VolumeComponentEditor> m_CurrentSearchFilteredEditors = new();
228+
void FilterEditorsBySearch()
229+
{
230+
m_CurrentSearchFilteredEditors.Clear();
231+
if (string.IsNullOrEmpty(m_SearchString)) return;
232+
233+
foreach (var editor in m_Editors)
234+
{
235+
if (MatchesSearchString(editor.GetDisplayTitle().text))
236+
m_CurrentSearchFilteredEditors.Add(editor);
237+
}
238+
}
239+
bool EditorIsIncludedInCurrentSearch(VolumeComponentEditor editor) => string.IsNullOrEmpty(m_SearchString) || m_CurrentSearchFilteredEditors.Contains(editor);
225240
bool MatchesSearchString(string title)
226241
{
227-
return m_SearchString.Length == 0 || title.Contains(m_SearchString, StringComparison.OrdinalIgnoreCase);
242+
return string.IsNullOrEmpty(m_SearchString) || title.Contains(m_SearchString, StringComparison.OrdinalIgnoreCase);
228243
}
229244

230245
/// <summary>
@@ -263,7 +278,7 @@ bool ShouldDrawEditor(VolumeComponentEditor editor)
263278
{
264279
if (!editor.visible)
265280
return false;
266-
return MatchesSearchString(editor.GetDisplayTitle().text);
281+
return EditorIsIncludedInCurrentSearch(editor);
267282
}
268283

269284
void DrawEditor(VolumeComponentEditor editor, int index = -1)
@@ -310,7 +325,11 @@ void DrawEditor(VolumeComponentEditor editor, int index = -1)
310325
{
311326
Rect searchRect = GUILayoutUtility.GetRect(50, EditorGUIUtility.singleLineHeight);
312327
searchRect.width -= 2;
313-
m_SearchString = m_SearchField.OnGUI(searchRect, m_SearchString);
328+
using (var check = new EditorGUI.ChangeCheckScope())
329+
{
330+
m_SearchString = m_SearchField.OnGUI(searchRect, m_SearchString);
331+
if (check.changed) FilterEditorsBySearch();
332+
}
314333
GUILayout.Space(2);
315334

316335
EditorGUILayout.HelpBox(
@@ -346,7 +365,6 @@ void DrawEditor(VolumeComponentEditor editor, int index = -1)
346365

347366
for (int i = 0; i < editors.Count; i++)
348367
DrawEditor(editors[i]);
349-
350368
GUILayout.Space(8);
351369
}
352370
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ SAMPLER(sampler_CoatMaskMap);
8585
PROP_DECL_TEX2D(_BaseColorMap);
8686
PROP_DECL_TEX2D(_MaskMap);
8787
PROP_DECL_TEX2D(_BentNormalMap);
88+
PROP_DECL_TEX2D(_BentNormalMapOS);
8889
PROP_DECL_TEX2D(_NormalMap);
8990
PROP_DECL_TEX2D(_NormalMapOS);
9091
PROP_DECL_TEX2D(_DetailMap);

Packages/com.unity.render-pipelines.high-definition/Samples~/MaterialSamples/Scenes/Scene Resources/EyeSamplesDescriptions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Human eyeballs are about 25mm in diameter. The shader uses separate diffusion profiles for the <link="IrisDiffusionProfile 25mm.asset">iris</link> and <link="ScleraDiffusionProfile 25mm.asset">sclera</link>. Scaling the eye changes how subsurface scattering looks. To get the same result for eyes of different sizes, duplicate the diffusion profiles and adjust the world scale, as shown in the 100mm eye example.
66

7-
This <link="SG_Eye.shadergraph">Shader Graph</link> is designed <b>exclusively</b> for this <link="HumanEyeModel.fbx">3D model</link> with an import scale factor of one. When working with different models or scale factors, you'll need to create a separate graph. In this example, we've chosen the <b>'EyeCinematicWithCaustics'</b> type within the Material Type, located under Surface Options in the Graph Inspector.
7+
This <link="Eye.shadergraph">Shader Graph</link> is designed <b>exclusively</b> for this <link="HumanEyeModel.fbx">3D model</link> with an import scale factor of one. When working with different models or scale factors, you'll need to create a separate graph. In this example, we've chosen the <b>'EyeCinematicWithCaustics'</b> type within the Material Type, located under Surface Options in the Graph Inspector.
88

99
""",
1010
"samples": []

Packages/com.unity.render-pipelines.universal/Runtime/2D/Shadows/ShadowCaster2D.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ internal bool IsLit(Light2D light)
274274
{
275275
// Oddly adding and subtracting vectors is expensive here because of the new structures created...
276276
Vector3 deltaPos;
277-
deltaPos.x = light.m_CachedPosition.x - boundingSphere.position.x;
278-
deltaPos.y = light.m_CachedPosition.y - boundingSphere.position.y;
279-
deltaPos.z = light.m_CachedPosition.z - boundingSphere.position.z;
277+
deltaPos.x = light.boundingSphere.position.x - boundingSphere.position.x;
278+
deltaPos.y = light.boundingSphere.position.y - boundingSphere.position.y;
279+
deltaPos.z = light.boundingSphere.position.z - boundingSphere.position.z;
280280

281281
float distanceSq = Vector3.SqrMagnitude(deltaPos);
282282

Packages/com.unity.render-pipelines.universal/Runtime/Passes/PostProcessPassRenderGraph.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,11 +2536,10 @@ public void RenderUberPost(RenderGraph renderGraph, ContextContainer frameData,
25362536
if (userLutTexture.IsValid())
25372537
builder.UseTexture(userLutTexture, AccessFlags.Read);
25382538

2539-
if (m_Bloom.IsActive())
2540-
{
2539+
passData.bloomTexture = bloomTexture; // This can be null if Bloom is not active.
2540+
if (bloomTexture.IsValid())
25412541
builder.UseTexture(bloomTexture, AccessFlags.Read);
2542-
passData.bloomTexture = bloomTexture;
2543-
}
2542+
25442543

25452544
if (requireHDROutput && m_EnableColorEncodingIfNeeded && overlayUITexture.IsValid())
25462545
builder.UseTexture(overlayUITexture, AccessFlags.Read);

Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineGlobalSettings.cs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,12 @@ public static void UpgradeAsset(EntityId assetInstanceID)
153153
asset.m_AssetVersion = 8;
154154
}
155155

156-
// URPReflectionProbeSetings is introduced set the values for older projects.
156+
// URPReflectionProbeSettings is introduced; disable rotation for older projects to preserve
157+
// pre-existing behavior (rotation was not supported before this version).
157158
if (asset.m_AssetVersion < 9)
158159
{
159-
if (GraphicsSettings.TryGetRenderPipelineSettings<URPReflectionProbeSettings>(out var reflectionProbeSettings))
160-
{
161-
reflectionProbeSettings.UseReflectionProbeRotation = false;
162-
}
163-
else
164-
{
165-
Debug.LogError("Failed to upgrade global settings for URPReflectionProbeSettings since it doesn't exists.");
166-
}
167-
160+
var reflectionProbeSettings = GetOrCreateGraphicsSettings<URPReflectionProbeSettings>(asset);
161+
reflectionProbeSettings.UseReflectionProbeRotation = false;
168162
asset.m_AssetVersion = 9;
169163
}
170164

Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,26 @@
44

55
Returns the result of linearly interpolating between input **A** and input **B** by input **T**.
66

7-
For example, when the value of input **T** is 0 the return value is equal to the value of input **A**, when it is 1 the return value is equal to the value of input **B** and when it is 0.5 the return value is the midpoint of the two inputs **A** and **B**.
7+
Unity calculates the output as:
8+
9+
A + T &times; (B &minus; A)
10+
11+
The value of input **T** acts as a weight factor applied to the difference between **B** and **A**:
12+
13+
- When **T** is `0`, the output equals **A**.
14+
- When **T** is `1`, the output equals **B**.
15+
- When **T** is `0.5`, the output is the midpoint between **A** and **B**.
16+
17+
The Lerp node uses Dynamic Vector slots, so **A**, **B**, and **T** always resolve to the same component count, which matches the smallest connected vector (larger vectors truncate). Scalars promote to the resolved size by duplicating their value across components.
818

919
## Ports
1020

1121
| Name | Direction | Type | Description |
1222
|:-----|:----------|:---------------|:------------|
13-
| A | Input | Dynamic Vector | First input value |
14-
| B | Input | Dynamic Vector | Second input value |
15-
| T | Input | Dynamic Vector | Time value. Typical range: 0 to 1. Though you can use values outside of this range they may cause unpredictable results. |
16-
| Out | Output | Dynamic Vector | Output value |
23+
| **A** | Input | Dynamic Vector | First input value |
24+
| **B** | Input | Dynamic Vector | Second input value |
25+
| **T** | Input | Dynamic Vector | Time value. Typical range: 0 to 1. Though you can use values outside of this range they may cause unpredictable results. |
26+
| **Out** | Output | Dynamic Vector | Output value |
1727

1828
## Generated Code Example
1929

Packages/com.unity.shadergraph/Documentation~/Node.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,5 @@ Right clicking on a **Node** will open a context menu. This menu contains many o
4040
**Nodes** interact with the Shader Graph Window's Color Modes. Colors are displayed on nodes underneath the text on the node title bar. See [Color Modes](Color-Modes.md) for more information on available colors for nodes.
4141

4242
<image>
43+
44+
Unity applies each component of T as a weight factor to each component to A and B. If T has fewer components than A and B, Unity casts T to the required number of components. Unity copies the values of the original components of T to the added components.

Packages/com.unity.shadergraph/Samples~/CustomLighting/Components/AdditionalLights/AdditionalLightsBasic.shadersubgraph

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@
849849
"m_FunctionName": "AddAdditionalLightsBasic",
850850
"m_FunctionSource": "3beadf505dbc54f4cae878435013d751",
851851
"m_FunctionSourceUsePragmas": true,
852-
"m_FunctionBody": "Diffuse = MainDiffuse;\r\nColor = MainColor * MainDiffuse;\r\n\r\n#ifndef SHADERGRAPH_PREVIEW\r\n \r\n uint pixelLightCount = GetAdditionalLightsCount();\r\n\r\n#if USE_CLUSTER_LIGHT_LOOP\r\n // for Foward+ LIGHT_LOOP_BEGIN macro uses inputData.normalizedScreenSpaceUV and inputData.positionWS\r\n InputData inputData = (InputData)0;\r\r\n inputData.normalizedScreenSpaceUV = ScreenPosition;\r\n inputData.positionWS = WorldPosition;\r\n#endif\r\n\r\n LIGHT_LOOP_BEGIN(pixelLightCount)\r\n\t\t// Convert the pixel light index to the light data index\r\n\t\t#if !USE_CLUSTER_LIGHT_LOOP\r\n\t\t\tlightIndex = GetPerObjectLightIndex(lightIndex);\r\n\t\t#endif\r\n\t\tLight light = GetAdditionalPerObjectLight(lightIndex, WorldPosition);\r\n float NdotL = saturate(dot(WorldNormal, light.direction));\r\n float thisDiffuse = light.distanceAttenuation * NdotL;\r\n Diffuse += thisDiffuse;\r\n Color += light.color * thisDiffuse;\r\n LIGHT_LOOP_END\r\n float total = Diffuse;\r\n Color = total <= 0 ? MainColor : Color / total;\r\n#endif"
852+
"m_FunctionBody": "Diffuse = MainDiffuse;\r\nColor = MainColor * MainDiffuse;\r\n\r\n#ifndef SHADERGRAPH_PREVIEW\r\n \r\n uint pixelLightCount = GetAdditionalLightsCount();\r\n\r\n#if USE_CLUSTER_LIGHT_LOOP\r\n // for Foward+ LIGHT_LOOP_BEGIN macro uses inputData.normalizedScreenSpaceUV and inputData.positionWS\r\n InputData inputData = (InputData)0;\r\n\r\n inputData.normalizedScreenSpaceUV = ScreenPosition;\r\n inputData.positionWS = WorldPosition;\r\n#endif\r\n\r\n LIGHT_LOOP_BEGIN(pixelLightCount)\r\n\t\tLight light = GetAdditionalLight(lightIndex, WorldPosition);\r\n float NdotL = saturate(dot(WorldNormal, light.direction));\r\n float thisDiffuse = light.distanceAttenuation * NdotL;\r\n Diffuse += thisDiffuse;\r\n Color += light.color * thisDiffuse;\r\n LIGHT_LOOP_END\r\n float total = Diffuse;\r\n Color = total <= 0 ? MainColor : Color / total;\r\n#endif"
853853
}
854854

855855
{

0 commit comments

Comments
 (0)