From f70be20f905ba169b5d583ebe0043cee84bcee51 Mon Sep 17 00:00:00 2001 From: Kenny Tan Date: Sat, 2 May 2026 09:19:11 +0000 Subject: [PATCH 1/5] [Port] [6000.0] [UUM-134522][UUM-136056][URP 2D][6000.6] Fix 2d shadow volumetric bugs --- .../Runtime/2D/Light2DCullResult.cs | 2 +- .../Runtime/2D/Passes/Utility/RendererLighting.cs | 5 ++--- .../Runtime/2D/Rendergraph/DrawLight2DPass.cs | 3 ++- .../Runtime/2D/Rendergraph/DrawShadow2DPass.cs | 5 +++++ .../Shaders/2D/Include/LightingUtility.hlsl | 4 ++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DCullResult.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DCullResult.cs index 7ced864a6bf..c5cb4033581 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DCullResult.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DCullResult.cs @@ -74,7 +74,7 @@ public LightStats GetLightStatsByLayer(int layerID, ref LayerBatch layer) returnStats.totalNormalMapUsage++; if (light.volumeIntensity > 0 && light.volumetricEnabled) returnStats.totalVolumetricUsage++; - if (light.volumeIntensity > 0 && light.volumetricEnabled && RendererLighting.CanCastShadows(light, layerID)) + if (RendererLighting.CanCastVolumetricShadows(light, layer.endLayerValue)) returnStats.totalVolumetricShadowUsage++; returnStats.blendStylesUsed |= (uint)(1 << light.blendStyleIndex); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs index b457a1b1891..b0c9028a188 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs @@ -213,10 +213,9 @@ internal static bool CanCastShadows(Light2D light, int layerToRender) return light.shadowsEnabled && light.shadowIntensity > 0 && light.IsLitLayer(layerToRender); } - private static bool CanCastVolumetricShadows(Light2D light, int endLayerValue) + internal static bool CanCastVolumetricShadows(Light2D light, int endLayerValue) { - var topMostLayerValue = light.GetTopMostLitLayer(); - return light.volumetricShadowsEnabled && light.shadowVolumeIntensity > 0 && topMostLayerValue == endLayerValue; + return light.volumeIntensity > 0 && light.volumetricEnabled && light.volumetricShadowsEnabled && light.shadowVolumeIntensity > 0 && light.GetTopMostLitLayer() == endLayerValue; } internal static void RenderLight(IRenderPass2D pass, CommandBuffer cmd, Light2D light, bool isVolume, int blendStyleIndex, int layerToRender, bool hasShadows, bool batchingSupported, ref int shadowLightCount) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs index 961e14527b2..870b161fa45 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawLight2DPass.cs @@ -84,7 +84,8 @@ private static void Execute(RasterCommandBuffer cmd, PassData passData, ref Laye layerBatch.endLayerValue != light.GetTopMostLitLayer())) continue; - var useShadows = passData.layerBatch.lightStats.useShadows && layerBatch.shadowIndices.Contains(j); + var useShadows = (!passData.isVolumetric && passData.layerBatch.lightStats.useShadows) || (passData.isVolumetric && passData.layerBatch.lightStats.useVolumetricShadowLights); + useShadows &= layerBatch.shadowIndices.Contains(j); var lightMaterial = passData.rendererData.GetLightMaterial(light, passData.isVolumetric, useShadows); var lightMesh = light.lightMesh; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawShadow2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawShadow2DPass.cs index 24c1ea64d6a..4ca2a2e24a8 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawShadow2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawShadow2DPass.cs @@ -39,6 +39,7 @@ internal class PassData internal Renderer2DData rendererData; internal TextureHandle[] shadowTextures; internal TextureHandle shadowDepth; + internal bool isVolumetric; } public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData rendererData, ref LayerBatch layerBatch, int batchIndex, bool isVolumetric = false) @@ -52,6 +53,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData using (var builder = graph.AddUnsafePass(!isVolumetric ? k_ShadowPass : k_ShadowVolumetricPass, out var passData, !isVolumetric ? m_ProfilingSampler : m_ProfilingSamplerVolume)) { + passData.isVolumetric = isVolumetric; passData.layerBatch = layerBatch; passData.rendererData = rendererData; passData.shadowTextures = universal2DResourceData.shadowTextures[batchIndex]; @@ -73,6 +75,9 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData var index = data.layerBatch.shadowIndices[i]; var light = data.layerBatch.lights[index]; + if (data.isVolumetric && !RendererLighting.CanCastVolumetricShadows(light, data.layerBatch.endLayerValue)) + continue; + // Shadow Pass ExecuteShadowPass(cmd, data, light, i); } diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl index c8d1a76dd51..cb7b1175627 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl @@ -59,8 +59,8 @@ if(intensity < 1)\ {\ half4 shadowTex = SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, input.shadowUV); \ - half4 shadowIntensity = 1-max(shadowTex.r, shadowTex.g * 1-shadowTex.b);\ - color.rgb = (color.rgb * shadowIntensity) + (color.rgb * intensity*(1 - shadowIntensity));\ + half shadowIntensity = 1 - max(shadowTex.r, shadowTex.g * (1 - shadowTex.b));\ + color.rgb = (color.rgb * shadowIntensity) + (color.rgb * intensity * (1 - shadowIntensity));\ } #define TRANSFER_SHADOWS(output)\ From 0915687340c0ec1ae3c947e2cdeb61ad6dcacd15 Mon Sep 17 00:00:00 2001 From: Evergreen Date: Thu, 7 May 2026 10:41:31 +0000 Subject: [PATCH 2/5] [Port] [6000.0] URP Renderer - When adding/removing scriptable render features refresh the project browser to reflect the changes. --- .../Editor/ScriptableRendererDataEditor.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs index 784f10b9dd4..84d49b55d5d 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ScriptableRendererDataEditor.cs @@ -337,6 +337,8 @@ private void ClearEditorsList() private void ForceSave() { EditorUtility.SetDirty(target); + AssetDatabase.SaveAssetIfDirty(target); + AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath(target)); } } } From 2305d4709a78aa23229706c3e58459219961ffaf Mon Sep 17 00:00:00 2001 From: Evergreen Date: Fri, 8 May 2026 08:25:04 +0000 Subject: [PATCH 3/5] [Port] [6000.0] [URP] Fixed SSAO precision issue on Mobile devices --- .../ShaderLibrary/SSAO.hlsl | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SSAO.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SSAO.hlsl index efa4bd13a51..e355b6f6256 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SSAO.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/SSAO.hlsl @@ -278,15 +278,13 @@ half3 ReconstructNormal(float2 uv, float linearDepth, float3 vpos, float2 pixelD #if defined(_SOURCE_DEPTH_LOW) return half3(normalize(cross(ddy(vpos), ddx(vpos)))); #else - float2 delta = float2(_SourceSize.zw * 2.0); - - pixelDensity = rcp(pixelDensity); + float2 delta = float2(_SourceSize.zw * 2.0) * rcp(pixelDensity); // Sample the neighbour fragments - float2 lUV = float2(-delta.x, 0.0) * pixelDensity; - float2 rUV = float2(delta.x, 0.0) * pixelDensity; - float2 uUV = float2(0.0, delta.y) * pixelDensity; - float2 dUV = float2(0.0, -delta.y) * pixelDensity; + float2 lUV = float2(-delta.x, 0.0); + float2 rUV = float2(delta.x, 0.0); + float2 uUV = float2(0.0, delta.y); + float2 dUV = float2(0.0, -delta.y); float3 l1 = float3(uv + lUV, 0.0); l1.z = SampleAndGetLinearEyeDepth(l1.xy); // Left1 float3 r1 = float3(uv + rUV, 0.0); r1.z = SampleAndGetLinearEyeDepth(r1.xy); // Right1 @@ -316,17 +314,17 @@ half3 ReconstructNormal(float2 uv, float linearDepth, float3 vpos, float2 pixelD // h == 1.0 && v == 1.0: p1 = right, p2 = up // h == 0.0 && v == 1.0: p1 = up, p2 = left // Calculate the view space positions for the three points... - half3 P1; - half3 P2; + float3 P1; + float3 P2; if (closest_vertical == 0) { - P1 = half3(closest_horizontal == 0 ? l1 : d1); - P2 = half3(closest_horizontal == 0 ? d1 : r1); + P1 = closest_horizontal == 0 ? l1 : d1; + P2 = closest_horizontal == 0 ? d1 : r1; } else { - P1 = half3(closest_horizontal == 0 ? u1 : r1); - P2 = half3(closest_horizontal == 0 ? l1 : u1); + P1 = closest_horizontal == 0 ? u1 : r1; + P2 = closest_horizontal == 0 ? l1 : u1; } // Use the cross product to calculate the normal... From 768ab294e017c8a3fef314cbe755a0e423ed90f6 Mon Sep 17 00:00:00 2001 From: Evergreen Date: Fri, 8 May 2026 08:25:04 +0000 Subject: [PATCH 4/5] [Port] [6000.0] docg-8030: Replace edge with wire --- .../Documentation~/Create-Node-Menu.md | 4 ++-- .../Documentation~/Data-Types.md | 8 ++++---- Packages/com.unity.shadergraph/Documentation~/Edge.md | 11 ----------- .../Documentation~/Float-Node.md | 2 +- Packages/com.unity.shadergraph/Documentation~/Node.md | 6 +++--- .../Documentation~/Port-Bindings.md | 4 ++-- Packages/com.unity.shadergraph/Documentation~/Port.md | 10 +++++----- .../Documentation~/Precision-Modes.md | 6 +++--- .../Documentation~/TableOfContents.md | 2 +- .../Documentation~/Vector-2-Node.md | 2 +- .../Documentation~/Vector-3-Node.md | 2 +- .../Documentation~/Vector-4-Node.md | 2 +- Packages/com.unity.shadergraph/Documentation~/Wire.md | 11 +++++++++++ 13 files changed, 35 insertions(+), 35 deletions(-) delete mode 100644 Packages/com.unity.shadergraph/Documentation~/Edge.md create mode 100644 Packages/com.unity.shadergraph/Documentation~/Wire.md diff --git a/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md b/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md index 011ab4a6cec..163fd4d391f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md +++ b/Packages/com.unity.shadergraph/Documentation~/Create-Node-Menu.md @@ -27,7 +27,7 @@ To add a [node](Node.md) to your shader graph, follow these steps: To connect [ports](Port.md) between two existing [nodes](Node.md) or with the [master stack](Master-Stack.md), select and drag the desired port to the target. -The line resulting from that connection is called an [edge](Edge.md). +The line resulting from that connection is called a [wire](Wire.md). You can only connect an output port to an input port, or vice-versa, and you can't connect two ports of the same node together. @@ -64,6 +64,6 @@ To add a new [block node](Block-Node.md) to the [master stack](Master-Stack.md), * [Nodes](Node.md) * [Ports](Port.md) -* [Edges](Edge.md) +* [Wires](Wire.md) * [Master Stack](Master-Stack.md) * [Block nodes](Block-Node.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Data-Types.md b/Packages/com.unity.shadergraph/Documentation~/Data-Types.md index 608c0d126dc..d328a5ce46f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Data-Types.md +++ b/Packages/com.unity.shadergraph/Documentation~/Data-Types.md @@ -2,7 +2,7 @@ ## Description -There are a number of **Data Types** in [Shader Graph](index.md). Each **Port** on a [Node](Node.md) has an associated **Data Type** that defines what edges can be connected to it. The **Data Types** have colors for usability, these colors are applied to ports and edges of that **Data Type**. +There are a number of **Data Types** in [Shader Graph](index.md). Each **Port** on a [Node](Node.md) has an associated **Data Type** that defines what wires can be connected to it. The **Data Types** have colors for usability, these colors are applied to ports and wires of that **Data Type**. Some **Data Types** have associated [Property Types](Property-Types.md) for exposing these values to the [Inspector](https://docs.unity3d.com/Manual/UsingTheInspector.html) for [Materials](https://docs.unity3d.com/Manual/class-Material.html) that use the shader. @@ -35,17 +35,17 @@ All **Vector** types can be promoted or truncated to match any **Vector** type [ ## Dynamic Data Types -Some **Data Types** are dynamic. This means a port using these **Data Types** can change their underlying **Concrete Data Type** based on what **Data Type** is connected to it. By default, [Nodes](Node.md) using dynamic **Data Types** can only have one **Concrete Data Type**, meaning that once a connected edge has applied its **Data Type** to that port, all other **Dynamic Data Type** slots of that [Node](Node.md) will apply the same **Data Type**. +Some **Data Types** are dynamic. This means a port using these **Data Types** can change their underlying **Concrete Data Type** based on what **Data Type** is connected to it. By default, [Nodes](Node.md) using dynamic **Data Types** can only have one **Concrete Data Type**, meaning that once a connected wire has applied its **Data Type** to that port, all other **Dynamic Data Type** slots of that [Node](Node.md) will apply the same **Data Type**. One notable exception to this is the [Multiply Node](Multiply-Node.md) which allows both **Dynamic** **Matrix** and **Vector** types. ### Dynamic Vector -The **Dynamic Vector** type allows connected edges of any **Vector** type. All connected edges are automatically truncated to the type with the lowest dimension, unless the lowest dimension is 1, in which case the **Float** is promoted. +The **Dynamic Vector** type allows connected wires of any **Vector** type. All connected wires are automatically truncated to the type with the lowest dimension, unless the lowest dimension is 1, in which case the **Float** is promoted. ### Dynamic Matrix -The **Dynamic Matrix** type allows connected edges of any **Matrix** type. All connected edges are automatically truncated to the type with the lowest dimension. +The **Dynamic Matrix** type allows connected wires of any **Matrix** type. All connected wires are automatically truncated to the type with the lowest dimension. ### Dynamic diff --git a/Packages/com.unity.shadergraph/Documentation~/Edge.md b/Packages/com.unity.shadergraph/Documentation~/Edge.md deleted file mode 100644 index 5a45646a536..00000000000 --- a/Packages/com.unity.shadergraph/Documentation~/Edge.md +++ /dev/null @@ -1,11 +0,0 @@ -# Edge - -## Description - -An **Edge** defines a connection between two [Ports](Port.md). **Edges** define how data flows through the [Shader Graph](index.md) node network. They can only be connected from an input [Port](Port.md) to an output [Port](Port.md). - -Each **Edge** has a [Data Type](Data-Types.md) which defines what [Ports](Port.md) it can be connected to. Each [Data Type](Data-Types.md) has an associated color for identifying its type. - -You can create a new **Edge** by clicking and dragging from a [Port](Port.md) with the left mouse button. Edges can be deleted with Delete (Windows), Command + Backspace (OSX) or from the context menu by right clicking on the edge. - -You can open a contextual [Create Node Menu](Create-Node-Menu.md) by dragging an **Edge** from a [Port](Port.md) with the left mouse button and releasing it in an empty area of the workspace. diff --git a/Packages/com.unity.shadergraph/Documentation~/Float-Node.md b/Packages/com.unity.shadergraph/Documentation~/Float-Node.md index f5040e664e0..7873e4b52d7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Float-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Float-Node.md @@ -2,7 +2,7 @@ ## Description -Defines a **Float** value in the shader. If [Port](Port.md) **X** is not connected with an [Edge](Edge.md) this [Node](Node.md) defines a constant **Float**. +Defines a **Float** value in the shader. If [Port](Port.md) **X** is not connected with a [Wire](Wire.md) this [Node](Node.md) defines a constant **Float**. ## Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/Node.md b/Packages/com.unity.shadergraph/Documentation~/Node.md index 8fde6148615..1762eb3ce4b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Node.md @@ -2,13 +2,13 @@ ## Description -A **Node** defines an input, output or operation on the Shader Graph, depending on its available [Ports](Port.md). A **Node** may have any number of input and/or output ports. You create a Shader Graph by connecting these ports with [Edges](Edge.md). A **Node** might also have any number of **Controls**, these are controls on the **Node** that do not have ports. +A **Node** defines an input, output or operation on the Shader Graph, depending on its available [Ports](Port.md). A **Node** may have any number of input and/or output ports. You create a Shader Graph by connecting these ports with [Wires](Wire.md). A **Node** might also have any number of **Controls**, these are controls on the **Node** that do not have ports. You can collapse a **Node** by clicking the **Collapse** button in the top-right corner of the **Node**. This will hide all unconnected ports. For components of a **Node** see: * [Port](Port.md) -* [Edge](Edge.md) +* [Wire](Wire.md) There are many available **Nodes** in Shader Graph. For a full list of all available **Nodes** see the [Node Library](Node-Library.md). @@ -25,7 +25,7 @@ Right clicking on a **Node** will open a context menu. This menu contains many o | Item | Description | |:------------|:------------| | Copy Shader | Copies the generated HLSL code at this stage in the graph to the clipboard | -| Disconnect All | Removes all edges from all ports on the **Node(s)** | +| Disconnect All | Removes all wires from all ports on the **Node(s)** | | Cut | Cuts selected **Node(s)** to the clipboard | | Copy | Copies selected **Nodes(s)** to the clipboard | | Paste | Pastes **Node(s)** in the clipboard | diff --git a/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md b/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md index 7f48676d22f..9b65e8bbbfd 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md +++ b/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md @@ -2,9 +2,9 @@ ## Description -Some input [Ports](Port.md) might have **Port Bindings**. This means there is an expectation of the data that should be supplied to the [Port](Port.md), such as a **Normal Vector** or **UV**. However, a **Port Binding** only affects a [Port](Port.md) that does not have a connected [Edge](Edge.md). These [Ports](Port.md) still have a regular [Data Type](Data-Types.md) that define what [Edges](Edge.md) can be connected to them. +Some input [Ports](Port.md) might have **Port Bindings**. This means there is an expectation of the data that should be supplied to the [Port](Port.md), such as a **Normal Vector** or **UV**. However, a **Port Binding** only affects a [Port](Port.md) that does not have a connected [Wire](Wire.md). These [Ports](Port.md) still have a regular [Data Type](Data-Types.md) that define what [Wires](Wire.md) can be connected to them. -In practice this means that if no [Edge](Edge.md) is connected to the [Port](Port.md) the default data used in that port will be taken from its **Port Binding**. A full list of **Port Bindings** and their associated default options is found below. +In practice this means that if no [Wire](Wire.md) is connected to the [Port](Port.md) the default data used in that port will be taken from its **Port Binding**. A full list of **Port Bindings** and their associated default options is found below. ## Port Bindings List diff --git a/Packages/com.unity.shadergraph/Documentation~/Port.md b/Packages/com.unity.shadergraph/Documentation~/Port.md index 2c8b29b8310..8fc4c2db66e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Port.md +++ b/Packages/com.unity.shadergraph/Documentation~/Port.md @@ -2,14 +2,14 @@ ## Description -A **Port** defines an input or output on a [Node](Node.md). Connecting [Edges](Edge.md) to a **Port** allows data to flow through the Shader Graph node network. +A **Port** defines an input or output on a [Node](Node.md). Connecting [Wires](Wire.md) to a **Port** allows data to flow through the Shader Graph node network. -Each **Port** has a [Data Type](Data-Types.md) which defines what edges can be connected to it. Each data type has an associated color for identifying its type. +Each **Port** has a [Data Type](Data-Types.md) which defines what wires can be connected to it. Each data type has an associated color for identifying its type. -Only one edge can be connected to any input **Port** but multiple edges can be connected to an output **Port**. +Only one wire can be connected to any input **Port** but multiple wires can be connected to an output **Port**. -You can open a contextual [Create Node Menu](Create-Node-Menu.md) by dragging an edge from a **Port** with left mouse button and releasing it in an empty area of the workspace. +You can open a contextual [Create Node Menu](Create-Node-Menu.md) by dragging a wire from a **Port** with left mouse button and releasing it in an empty area of the workspace. ### Default Inputs -Each **Input Port**, a **Port** on the left side of a node implying that it is for inputting data into the node, has a **Default Input**. This appears as a small field connected to the **Port** when there is no edge connected. This field will display an input for the ports data type unless the **Port** has a [Port Binding](Port-Bindings.md). If a **Port** does have a port binding the default input field might display a special field, such as a dropdown for selecting UV channels, or just a label to help you understand the intended input, such as coordinate space labels for geometry data. +Each **Input Port**, a **Port** on the left side of a node implying that it is for inputting data into the node, has a **Default Input**. This appears as a small field connected to the **Port** when there is no wire connected. This field will display an input for the ports data type unless the **Port** has a [Port Binding](Port-Bindings.md). If a **Port** does have a port binding the default input field might display a special field, such as a dropdown for selecting UV channels, or just a label to help you understand the intended input, such as coordinate space labels for geometry data. diff --git a/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md b/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md index 50cc3676d9c..954a88b46c9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md +++ b/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md @@ -32,7 +32,7 @@ To set the default precision for the entire graph to **Single** or **Half**, ope Select a node to access its precision setting. The precision you set for a node determines the precision of the data types which that node uses for its calculations. ### Precision Inheritance -All nodes use the **Inherit** precision mode by default. In this mode, a node that has one or more edge connections takes on the precision mode of an incoming [edge](Edge.md). Nodes that do not have any edge connections take on **Graph Precision**. If you change the **Graph Precision** mode, the precision of those nodes also changes. +All nodes use the **Inherit** precision mode by default. In this mode, a node that has one or more wire connections takes on the precision mode of an incoming [wire](Wire.md). Nodes that do not have any wire connections take on **Graph Precision**. If you change the **Graph Precision** mode, the precision of those nodes also changes. | **Inputs on the node** | **Final precision determined by inheritance** | |------------------------------------|--------------------------------------------| @@ -49,7 +49,7 @@ All nodes use the **Inherit** precision mode by default. In this mode, a node th Simple inheritance refers to the inheritance behaviour of a node with only one precision type on its inputs. -In the figure below, Node A has the **Inherit** mode. Because it has no incoming edge, it takes the **Graph Precision**, which is **Half**. Node B also has the **Inherit** mode, so it inherits the **Half** precision mode from Node A. +In the figure below, Node A has the **Inherit** mode. Because it has no incoming wire, it takes the **Graph Precision**, which is **Half**. Node B also has the **Inherit** mode, so it inherits the **Half** precision mode from Node A. ![Diagram showing a simple precision inheritance.](images/precisionmodes1.png) @@ -59,7 +59,7 @@ Complex inheritance refers to the inheritance behaviour of a node with multiple A node reads precision settings from each input port. If you connect a node to several others with a variety of precision modes, the node with the highest resolution determines the precision mode for the group. -In the figure below, node D has the **Inherit** mode. It receives input from the adjacent edges via inputs 1 and 2. Node B passes the **Half** mode through input 1. Node C passes the **Single** mode through input 2. Because **Single** is 32-bit and **Half** only 16-bit, **Single** takes precedence, so Node D uses **Single** precision. +In the figure below, node D has the **Inherit** mode. It receives input from the adjacent wires via inputs 1 and 2. Node B passes the **Half** mode through input 1. Node C passes the **Single** mode through input 2. Because **Single** is 32-bit and **Half** only 16-bit, **Single** takes precedence, so Node D uses **Single** precision. ![Diagram showing a complex precision inheritance.](images/precisionmodes2.png) diff --git a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md index 119ae437aeb..4a82b2d65c4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -23,7 +23,7 @@ * [Node](Node.md) * [Port](Port.md) * [Custom Port Menu](Custom-Port-Menu.md) - * [Edge](Edge.md) + * [Wire](Wire.md) * [Sub Graphs](Sub-graphs.md) * [Introduction to Sub Graphs](Sub-graph.md) * [Create a Sub Graph](Create-Sub-Graph.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md index 43fdcfb6533..5beb6285692 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md @@ -2,7 +2,7 @@ ## Description -Defines a **Vector 2** value in the shader. If [Ports](Port.md) **X** and **Y** are not connected with [Edges](Edge.md) this [Node](Node.md) defines a constant **Vector 2**, otherwise this [Node](Node.md) can be used to combine various **Float** values. +Defines a **Vector 2** value in the shader. If [Ports](Port.md) **X** and **Y** are not connected with [Wires](Wire.md) this [Node](Node.md) defines a constant **Vector 2**, otherwise this [Node](Node.md) can be used to combine various **Float** values. ## Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md index 6c817c8ac82..763c3b168a3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md @@ -2,7 +2,7 @@ ## Description -Defines a **Vector 3** value in the shader. If [Ports](Port.md) **X**, **Y** and **Z** are not connected with [Edges](Edge.md) this [Node](Node.md) defines a constant **Vector 3**, otherwise this [Node](Node.md) can be used to combine various **Float** values. +Defines a **Vector 3** value in the shader. If [Ports](Port.md) **X**, **Y** and **Z** are not connected with [Wires](Wire.md) this [Node](Node.md) defines a constant **Vector 3**, otherwise this [Node](Node.md) can be used to combine various **Float** values. ## Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md index 9e22dd0c932..5e173241d8e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md @@ -2,7 +2,7 @@ ## Description -Defines a **Vector 4** value in the shader. If [Ports](Port.md) **X**, **Y**, **Z** and **W** are not connected with [Edges](Edge.md) this [Node](Node.md) defines a constant **Vector 4**, otherwise this [Node](Node.md) can be used to combine various **Float** values. +Defines a **Vector 4** value in the shader. If [Ports](Port.md) **X**, **Y**, **Z** and **W** are not connected with [Wires](Wire.md) this [Node](Node.md) defines a constant **Vector 4**, otherwise this [Node](Node.md) can be used to combine various **Float** values. ## Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/Wire.md b/Packages/com.unity.shadergraph/Documentation~/Wire.md new file mode 100644 index 00000000000..1c0bdbfff51 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/Wire.md @@ -0,0 +1,11 @@ +# Wire + +## Description + +A **Wire** defines a connection between two [Ports](Port.md). **Wires** define how data flows through the [Shader Graph](index.md) node network. They can only be connected between an input [Port](Port.md) and an output [Port](Port.md). + +Each **Wire** has a [Data Type](Data-Types.md) which defines what [Ports](Port.md) it can be connected to. Each [Data Type](Data-Types.md) has an associated color for identifying its type. + +You can create a new **Wire** by clicking and dragging from a [Port](Port.md) with the left mouse button. Wires can be deleted with Delete (Windows), Command + Backspace (OSX) or from the context menu by right clicking on the wire. + +You can open a contextual [Create Node Menu](Create-Node-Menu.md) by dragging a **Wire** from a [Port](Port.md) with the left mouse button and releasing it in an empty area of the workspace. From 23fed537a49b09ebde321cbd35597021ef90e404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Duverne?= Date: Fri, 8 May 2026 08:25:05 +0000 Subject: [PATCH 5/5] [Port] [6000.0] Added navigation to Shader Graph preferences ref page from the Unity Manual --- .../Shader-Graph-Preferences.md | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md index 02dbbad75cc..f548dbd33ec 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Preferences.md @@ -1,18 +1,15 @@ -# Shader Graph Preferences +# Shader Graph preferences reference -Use the Shader Graph preferences to define shader graph settings for your system. To access the Shader Graph system preferences, do the following: +Define preferences for Shader Graph behaviors in your project and your shader creation workflows. -1. From the main menu select **Edit** > **Preferences** (macOS: **Unity** > **Settings**). The **Preferences** window is displayed. -2. Select **Shader Graph**. +To open the preferences, go to **Edit** > **Preferences** > **Shader Graph** (macOS: **Unity** > **Settings** > **Shader Graph**). -## Settings - -| Name | Description | -|:--------------------------|:----------------------------------------| -| **Preview Variant Limit** | Set the maximum number of variants allowed in local projects. This is a local version of the **Shader Variant Limit** in the project settings. If your graph exceeds this maximum value, Unity returns the following error:
_Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants or increase the **Shader Variant Limit** in Preferences > Shader Graph._
For more information about shader variants, refer to [Making multiple shader program variants](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html). For more information about the Shader Variant Limit, refer to [Shader graph project settings](Shader-Graph-Project-Settings.md)| -| **Automatically Add and Remove Block Nodes** | Automatically add [Block nodes](Block-Node.md) to, or remove them from, the [Master Stack](Master-Stack.md) as needed. If you select this option, any [Block nodes](Block-Node.md) that your Shader graph needs are added to the [Master Stack](Master-Stack.md) automatically. Any incompatible [Block nodes](Block-Node.md) that have no incoming connections will be removed from the [Master Stack](Master-Stack.md). If you don't select this option, no [Block nodes](Block-Node.md) are added to, or removed from, the [Master Stack](Master-Stack.md) automatically. | -| **Enable Deprecated Nodes** | Disable warnings for deprecated nodes and properties. If you select this option, Shader Graph doesn't display warnings if your graph contains deprecated nodes or properties. If you don't select this option, Shader Graph displays warnings for deprecated nodes and properties, and any new nodes and properties you create use the latest version. | -| **Zoom Step Size** | Control how much the camera in Shader Graph zooms each time you roll the mouse wheel. This makes it easier to control the difference in zoom speed between the touchpad and mouse. A touchpad simulates hundreds of steps, which causes very fast zooms, whereas a mouse wheel steps once with each click. | +| Property | Description | +| :--- | :--- | +| **Preview Variant Limit** | Sets the maximum number of variants allowed in local projects. This is a local version of the **Shader Variant Limit** in the project settings. If your graph exceeds this maximum value, Unity returns the following error:
_Validation: Graph is generating too many variants. Either delete Keywords, reduce Keyword variants, or increase the **Shader Variant Limit** in Preferences > Shader Graph._
For more information about shader variants, refer to [Making multiple shader program variants](https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html). For more information about the Shader Variant Limit, refer to [Shader graph project settings](Shader-Graph-Project-Settings.md) | +| **Automatically Add and Remove Block Nodes** | Adds to the [Master Stack](Master-Stack.md) any needed [Block nodes](Block-Node.md) and removes from the Master Stack any Block nodes with no incoming connections. | +| **Enable Deprecated Nodes** | Disables warnings for deprecated nodes and properties. When enabled, Shader Graph doesn't display warnings if your graph contains deprecated nodes or properties. When disabled, Shader Graph displays warnings for deprecated nodes and properties, and the new nodes and properties you create use the latest version. | +| **Zoom Step Size** | Adjusts how much the Shader Graph camera zooms with each mouse wheel movement. This helps balance zoom speed, since touchpads can zoom much faster than regular mouse wheels.
Only affects materials created automatically, such as when you make a new shader graph from a Decal Projector or Fullscreen Renderer Feature. | ## Additional resources