From 32f7e2558224799ebde821eef0826311dedf6def Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 10 Sep 2026 11:52:05 +0000 Subject: [PATCH 01/18] [Port] [6000.0] [docg-9065] Fix one minus keyboard shortcut in shadergraph docs. --- .../com.unity.shadergraph/Documentation~/Keyboard-shortcuts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Keyboard-shortcuts.md b/Packages/com.unity.shadergraph/Documentation~/Keyboard-shortcuts.md index 0f5c9f1894f..45afedd2f09 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Keyboard-shortcuts.md +++ b/Packages/com.unity.shadergraph/Documentation~/Keyboard-shortcuts.md @@ -74,7 +74,7 @@ The following table lists the keyboard shortcuts you can use to add nodes in Sha | Negate | Alt + - | Option + - | | Normal Vector | Alt + N | Option + N | | Normalize | Alt + Z | Option + Z | -| One Minus | Alt + \| | Option + \| | +| One Minus | Alt + I | Option + I | | Position | Alt + V | Option + V | | Power | Alt + P | Option + P | | Remap | Alt + R | Option + R | From e1c035ee1a0acdacfb76ab289f3240c09a3b1025 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 10 Sep 2026 11:52:05 +0000 Subject: [PATCH 02/18] [Port] [6000.0] ScriptableRenderFeture - Fix Null reference exception --- .../Runtime/ScriptableRendererData.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererData.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererData.cs index 2bb9245be4a..091f77fad6e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererData.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRendererData.cs @@ -113,9 +113,9 @@ public bool TryGetRendererFeature(out T rendererFeature) where T : Scriptable { foreach (var target in rendererFeatures) { - if (target.GetType() == typeof(T)) + if (target is T feature) { - rendererFeature = target as T; + rendererFeature = feature; return true; } } From fb57b2cbce46c81bae67014f31f255e1b0ab57aa Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 12 Sep 2026 23:52:48 +0000 Subject: [PATCH 03/18] [Port] [6000.0] [Particles] Don't use _FADING_ON keyword if camera fade is off --- .../Editor/ShaderGUI/ParticleGUI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs index 21d91b45c6b..92121ec28d2 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/ParticleGUI.cs @@ -621,7 +621,7 @@ public static void SetMaterialKeywords(Material material) material.SetFloat("_DistortionStrengthScaled", material.GetFloat("_DistortionStrength") * 0.1f); } - var useFading = (useSoftParticles || useCameraFading) && !hasZWrite; + var useFading = useCameraFading && !hasZWrite; CoreUtils.SetKeyword(material, "_FADING_ON", useFading); } } From 70ec77ec9fdf239890cdf4658aa297b7e84ac82f Mon Sep 17 00:00:00 2001 From: April Roszkowski Date: Wed, 16 Sep 2026 13:33:59 +0000 Subject: [PATCH 04/18] [6000.0][UUM-151674] Add buffer bounds checks to `GenSdfRayMap.compute` --- .../Shaders/SDFBaker/GenSdfRayMap.compute | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/Packages/com.unity.visualeffectgraph/Shaders/SDFBaker/GenSdfRayMap.compute b/Packages/com.unity.visualeffectgraph/Shaders/SDFBaker/GenSdfRayMap.compute index 36ca56d6788..d6247994654 100644 --- a/Packages/com.unity.visualeffectgraph/Shaders/SDFBaker/GenSdfRayMap.compute +++ b/Packages/com.unity.visualeffectgraph/Shaders/SDFBaker/GenSdfRayMap.compute @@ -205,7 +205,7 @@ RWStructuredBuffer Result ; #define groupthreads 512 groupshared uint2 bucket[groupthreads]; -void PrefixSum(uint id, uint gid, uint x) +void PrefixSum(uint id, uint gid, uint x, bool valid) { uint thid = id; //load input into shared memory @@ -269,7 +269,9 @@ void PrefixSum(uint id, uint gid, uint x) } n = !n; } - Result[thid] = bucket[gid].y; //Careful, works for groupthreads = 512 (2^(2n+1)) + + if (valid) + Result[thid] = bucket[gid].y; //Careful, works for groupthreads = 512 (2^(2n+1)) } uint numElem; uint dispatchWidth; @@ -279,30 +281,34 @@ void InBucketSum(uint3 GTid: SV_GroupThreadID, uint GI: SV_GroupIndex, uint3 gro uint x; const uint id = GTid.x + groupId.x * groupthreads + groupId.y * dispatchWidth * groupthreads; - if(id >= numElem) + bool valid = id < numElem; + UNITY_BRANCH + if(!valid) { x = 0u; } else{ x = Input[id]; } - PrefixSum(id, GI, x); + PrefixSum(id, GI, x, valid); } [numthreads(groupthreads, 1, 1)] void BlockSums(uint3 DTid: SV_DispatchThreadID, uint GI: SV_GroupIndex) { - uint x ; - if((DTid.x + 1) * groupthreads -1 >= numElem ) + uint x; + uint idx = (DTid.x + 1) * groupthreads - 1; + bool validWrite = DTid.x * groupthreads < numElem; + UNITY_BRANCH + if (idx >= numElem) { x = 0u; } else { - uint id = (DTid.x + 1) * groupthreads - 1; - x = Input[id] + inputCounter[id]; // Change the type of x here if scan other types + x = Input[idx] + inputCounter[idx]; // Change the type of x here if scan other types } - PrefixSum(DTid.x, GI, x); + PrefixSum(DTid.x, GI, x, validWrite); } bool exclusive; From 4559141a1977d9191da340b1a2363649bf5c655b Mon Sep 17 00:00:00 2001 From: Marta Malberti Date: Fri, 18 Sep 2026 01:36:23 +0000 Subject: [PATCH 05/18] [Port] [6000.0] [DOCG-9101] Add links to example nodes on Shader Graph node pages --- .../com.unity.shadergraph/Documentation~/Absolute-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Add-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/All-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Ambient-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/And-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Any-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Arccosine-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Arcsine-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Arctangent-Node.md | 4 ++++ .../Documentation~/Arctangent2-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Baked-GI-Node.md | 4 ++++ .../Documentation~/Bitangent-Vector-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Blackbody-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Blend-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Block-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Boolean-Node.md | 3 +++ .../com.unity.shadergraph/Documentation~/Branch-Node.md | 4 ++++ .../Documentation~/Branch-On-Input-Connection-Node.md | 4 ++++ .../Calculate-Level-Of-Detail-Texture-2D-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Camera-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Ceiling-Node.md | 4 ++++ .../Documentation~/Channel-Mask-Node.md | 4 ++++ .../Documentation~/Channel-Mixer-Node.md | 4 ++++ .../Documentation~/Checkerboard-Node.md | 4 ++++ .../Documentation~/Circle-Pupil-Animation-Node.md | 6 +++++- Packages/com.unity.shadergraph/Documentation~/Clamp-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Color-Mask-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Color-Node.md | 4 ++++ .../Documentation~/Colorspace-Conversion-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Combine-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Comparison-Node.md | 4 ++++ .../Documentation~/Compute-Deformation-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Constant-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Contrast-Node.md | 4 ++++ .../Documentation~/Cornea-Refraction-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Cosine-Node.md | 4 ++++ .../Documentation~/Cross-Product-Node.md | 4 ++++ .../Documentation~/Cubemap-Asset-Node.md | 4 ++++ .../Documentation~/Custom-Color-Buffer-Node.md | 4 ++++ .../Documentation~/Custom-Function-Node.md | 4 ++++ .../Documentation~/Custom-Render-Texture-Self-Node.md | 4 ++++ .../Documentation~/Custom-Render-Texture-Size-Node.md | 6 +++++- Packages/com.unity.shadergraph/Documentation~/DDX-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/DDXY-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/DDY-Node.md | 4 ++++ .../Documentation~/Degrees-To-Radians-Node.md | 4 ++++ .../Documentation~/Dielectric-Specular-Node.md | 4 ++++ .../Documentation~/Diffusion-Profile-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Distance-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Dither-Node.md | 3 +++ .../com.unity.shadergraph/Documentation~/Divide-Node.md | 4 ++++ .../Documentation~/Dot-Product-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Dropdown-Node.md | 6 +++++- .../com.unity.shadergraph/Documentation~/Ellipse-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Emission-Node.md | 1 + .../Documentation~/Exponential-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Exposure-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Eye-Index-Node.md | 4 ++++ .../Documentation~/Eye-Surface-Type-Debug-Node.md | 4 ++++ .../Documentation~/Fade-Transition-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Flip-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Flipbook-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Float-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Floor-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Fog-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Fraction-Node.md | 4 ++++ .../Documentation~/Fresnel-Effect-Node.md | 4 ++++ .../Documentation~/Fresnel-Equation-Node.md | 4 ++++ .../Documentation~/Gather-Texture-2D-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Gradient-Node.md | 4 ++++ .../Documentation~/Gradient-Noise-Node.md | 6 +++++- .../Documentation~/HD-Custom-Depth-Node.md | 4 ++++ .../Documentation~/HD-Sample-Buffer-Node.md | 4 ++++ .../Documentation~/HD-Scene-Color-Node.md | 1 + .../Documentation~/HD-Scene-Depth-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Hue-Node.md | 4 ++++ .../Documentation~/Hyperbolic-Cosine-Node.md | 4 ++++ .../Documentation~/Hyperbolic-Sine-Node.md | 4 ++++ .../Documentation~/Hyperbolic-Tangent-Node.md | 4 ++++ .../Documentation~/Instance-ID-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Integer-Node.md | 4 ++++ .../Documentation~/Inverse-Lerp-Node.md | 4 ++++ .../Documentation~/Invert-Colors-Node.md | 4 ++++ .../Documentation~/Iris-Limbal-Ring-Node.md | 4 ++++ .../Documentation~/Iris-Offset-Node.md | 4 ++++ .../Documentation~/Iris-Out-Of-Bound-Color-Clamp-Node.md | 4 ++++ .../Documentation~/Iris-UV-Location-Node.md | 4 ++++ .../Documentation~/Is-Front-Face-Node.md | 4 ++++ .../Documentation~/Is-Infinite-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Is-NaN-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Keyword-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Length-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md | 4 ++++ .../Documentation~/Linear-Blend-Skinning-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Log-Node.md | 4 ++++ .../Documentation~/Main-Light-Direction-Node.md | 4 ++++ .../Documentation~/Material-Quality-Keyword-Node.md | 1 + .../com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md | 4 ++++ .../Documentation~/Matrix-Construction-Node.md | 4 ++++ .../Documentation~/Matrix-Determinant-Node.md | 4 ++++ .../Documentation~/Matrix-Split-Node.md | 4 ++++ .../Documentation~/Matrix-Transpose-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Maximum-Node.md | 4 ++++ .../Documentation~/Metal-Reflectance-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Minimum-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Modulo-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Multiply-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Nand-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Negate-Node.md | 4 ++++ .../Documentation~/Noise-Sine-Wave-Node.md | 4 ++++ .../Documentation~/Normal-Blend-Node.md | 4 ++++ .../Documentation~/Normal-From-Height-Node.md | 4 ++++ .../Documentation~/Normal-From-Texture-Node.md | 4 ++++ .../Documentation~/Normal-Reconstruct-Z-Node.md | 4 ++++ .../Documentation~/Normal-Strength-Node.md | 4 ++++ .../Documentation~/Normal-Unpack-Node.md | 4 ++++ .../Documentation~/Normal-Vector-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Normalize-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Not-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Object-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/One-Minus-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Or-Node.md | 4 ++++ .../Documentation~/Parallax-Mapping-Node.md | 4 ++++ .../Documentation~/Parallax-Occlusion-Mapping-Node.md | 4 ++++ .../Documentation~/Polar-Coordinates-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Polygon-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Position-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Posterize-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Power-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Preview-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Projection-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Property-Node.md | 4 ++++ .../Documentation~/Radial-Shear-Node.md | 4 ++++ .../Documentation~/Radians-To-Degrees-Node.md | 4 ++++ .../Documentation~/Random-Range-Node.md | 4 ++++ .../Documentation~/Raytracing-Quality-Keyword-Node.md | 1 + .../com.unity.shadergraph/Documentation~/Reciprocal-Node.md | 4 ++++ .../Documentation~/Reciprocal-Square-Root-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Rectangle-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Redirect-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Reflection-Node.md | 4 ++++ .../Documentation~/Reflection-Probe-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Refract-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Rejection-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Remap-Node.md | 6 +++++- .../Documentation~/Replace-Color-Node.md | 4 ++++ .../Documentation~/Rotate-About-Axis-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Rotate-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Round-Node.md | 4 ++++ .../Documentation~/Rounded-Polygon-Node.md | 4 ++++ .../Documentation~/Rounded-Rectangle-Node.md | 4 ++++ .../Documentation~/Sample-Cubemap-Node.md | 4 ++++ .../Documentation~/Sample-Gradient-Node.md | 4 ++++ .../Documentation~/Sample-Reflected-Cubemap-Node.md | 4 ++++ .../Documentation~/Sample-Texture-2D-Array-Node.md | 4 ++++ .../Documentation~/Sample-Texture-2D-LOD-Node.md | 4 ++++ .../Documentation~/Sample-Texture-2D-Node.md | 4 ++++ .../Documentation~/Sample-Texture-3D-Node.md | 4 ++++ .../Documentation~/Sample-Virtual-Texture-Node.md | 4 ++++ .../Documentation~/Sampler-State-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Saturate-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Saturation-Node.md | 4 ++++ .../Documentation~/Sawtooth-Wave-Node.md | 4 ++++ .../Documentation~/Scene-Color-Node.md | 4 ++++ .../Documentation~/Scene-Depth-Difference-Node.md | 4 ++++ .../Documentation~/Scene-Depth-Node.md | 6 +++++- .../Documentation~/Sclera-Iris-Blend-Node.md | 4 ++++ .../Documentation~/Sclera-Limbal-Ring-Node.md | 4 ++++ .../Documentation~/Sclera-UV-Location-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Screen-Node.md | 4 ++++ .../Documentation~/Screen-Position-Node.md | 3 +++ Packages/com.unity.shadergraph/Documentation~/Sign-Node.md | 4 ++++ .../Documentation~/Simple-Noise-Node.md | 6 +++++- Packages/com.unity.shadergraph/Documentation~/Sine-Node.md | 4 ++++ .../Documentation~/Slice-Index-Cubemap-Face-Node.md | 6 +++++- .../com.unity.shadergraph/Documentation~/Slider-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Smoothstep-Node.md | 4 ++++ .../Documentation~/Sphere-Mask-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Spherize-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Split-Node.md | 4 ++++ .../Documentation~/Split-Texture-Transform-Node.md | 4 ++++ .../Documentation~/Square-Root-Node.md | 4 ++++ .../Documentation~/Square-Wave-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Step-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Sub-graph-Node.md | 1 + .../com.unity.shadergraph/Documentation~/Subtract-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Swizzle-Node.md | 5 +++++ .../com.unity.shadergraph/Documentation~/Tangent-Node.md | 4 ++++ .../Documentation~/Tangent-Vector-Node.md | 4 ++++ .../Documentation~/Texture-2D-Array-Asset-Node.md | 4 ++++ .../Documentation~/Texture-2D-Asset-Node.md | 4 ++++ .../Documentation~/Texture-3D-Asset-Node.md | 4 ++++ .../Documentation~/Texture-Size-Node.md | 4 ++++ .../Documentation~/ThreadMapDetail-Node.md | 4 ++++ .../Documentation~/Tiling-And-Offset-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Time-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Transform-Node.md | 4 ++++ .../Documentation~/Transformation-Matrix-Node.md | 4 ++++ .../Documentation~/Triangle-Wave-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Triplanar-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Truncate-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/Twirl-Node.md | 4 ++++ Packages/com.unity.shadergraph/Documentation~/UV-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/UVCombine-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Vector-2-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Vector-3-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Vector-4-Node.md | 4 ++++ .../Documentation~/Vertex-Color-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Vertex-ID-Node.md | 4 ++++ .../Documentation~/View-Direction-Node.md | 4 ++++ .../Documentation~/View-Vector-Node.md | 4 ++++ .../com.unity.shadergraph/Documentation~/Voronoi-Node.md | 4 ++++ .../Documentation~/White-Balance-Node.md | 4 ++++ .../Documentation~/snippets/nodes-example-samples.md | 1 + 216 files changed, 852 insertions(+), 8 deletions(-) create mode 100644 Packages/com.unity.shadergraph/Documentation~/snippets/nodes-example-samples.md diff --git a/Packages/com.unity.shadergraph/Documentation~/Absolute-Node.md b/Packages/com.unity.shadergraph/Documentation~/Absolute-Node.md index 10940ffff81..4bffaa24e2d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Absolute-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Absolute-Node.md @@ -21,3 +21,7 @@ void Unity_Absolute_float4(float4 In, out float4 Out) Out = abs(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Add-Node.md b/Packages/com.unity.shadergraph/Documentation~/Add-Node.md index 09ffadd29cb..2fdec805229 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Add-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Add-Node.md @@ -22,3 +22,7 @@ void Unity_Add_float4(float4 A, float4 B, out float4 Out) Out = A + B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/All-Node.md b/Packages/com.unity.shadergraph/Documentation~/All-Node.md index 497ce27dc84..0246b374222 100644 --- a/Packages/com.unity.shadergraph/Documentation~/All-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/All-Node.md @@ -21,3 +21,7 @@ void Unity_All_float4(float4 In, out float Out) Out = all(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Ambient-Node.md b/Packages/com.unity.shadergraph/Documentation~/Ambient-Node.md index dc5780d6832..21fd1dd7b62 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Ambient-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Ambient-Node.md @@ -32,3 +32,7 @@ float3 _Ambient_ColorSky = SHADERGRAPH_AMBIENT_SKY; float3 _Ambient_Equator = SHADERGRAPH_AMBIENT_EQUATOR; float3 _Ambient_Ground = SHADERGRAPH_AMBIENT_GROUND; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/And-Node.md b/Packages/com.unity.shadergraph/Documentation~/And-Node.md index 97303ed9353..6ce43e90ade 100644 --- a/Packages/com.unity.shadergraph/Documentation~/And-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/And-Node.md @@ -20,3 +20,7 @@ void Unity_And(float A, float B, out float Out) Out = A && B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Any-Node.md b/Packages/com.unity.shadergraph/Documentation~/Any-Node.md index 0b574a856e4..117f0d06f42 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Any-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Any-Node.md @@ -21,3 +21,7 @@ void Unity_Any_float4(float4 In, out float Out) Out = any(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Arccosine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Arccosine-Node.md index 42fdb90c8a5..07f5f478bc3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Arccosine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Arccosine-Node.md @@ -21,3 +21,7 @@ void Unity_Arccosine_float4(float4 In, out float4 Out) Out = acos(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Arcsine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Arcsine-Node.md index 2cffd495d70..61105d53739 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Arcsine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Arcsine-Node.md @@ -21,3 +21,7 @@ void Unity_Arcsine_float4(float4 In, out float4 Out) Out = asin(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Arctangent-Node.md b/Packages/com.unity.shadergraph/Documentation~/Arctangent-Node.md index 447d0ae951d..7a233aaccfe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Arctangent-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Arctangent-Node.md @@ -21,3 +21,7 @@ void Unity_Arctangent_float4(float4 In, out float4 Out) Out = atan(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Arctangent2-Node.md b/Packages/com.unity.shadergraph/Documentation~/Arctangent2-Node.md index b788986085f..bf0b850e011 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Arctangent2-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Arctangent2-Node.md @@ -22,3 +22,7 @@ void Unity_Arctangent2_float4(float4 A, float4 B, out float4 Out) Out = atan2(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Baked-GI-Node.md b/Packages/com.unity.shadergraph/Documentation~/Baked-GI-Node.md index 1a75b2837d7..a695e61cbab 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Baked-GI-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Baked-GI-Node.md @@ -38,3 +38,7 @@ void Unity_BakedGI_float(float3 Position, float3 Normal, float2 StaticUV, float2 Out = SHADERGRAPH_BAKED_GI(Position, Normal, StaticUV, DynamicUV, false); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Bitangent-Vector-Node.md b/Packages/com.unity.shadergraph/Documentation~/Bitangent-Vector-Node.md index 012e2aca2d4..b885d015c6a 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Bitangent-Vector-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Bitangent-Vector-Node.md @@ -15,3 +15,7 @@ Provides access to the mesh vertex or fragment's **Bitangent Vector**, depending | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| | Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **Bitangent Vector** to output. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Blackbody-Node.md b/Packages/com.unity.shadergraph/Documentation~/Blackbody-Node.md index 4ffb597394e..6055e819853 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Blackbody-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Blackbody-Node.md @@ -31,3 +31,7 @@ void Unity_Blackbody_float(float Temperature, out float3 Out) Out = color; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Blend-Node.md b/Packages/com.unity.shadergraph/Documentation~/Blend-Node.md index de920606c65..dcd7ae1f2a0 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Blend-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Blend-Node.md @@ -255,3 +255,7 @@ void Unity_Blend_Overwrite_float4(float4 Base, float4 Blend, float Opacity, out Out = lerp(Base, Blend, Opacity); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Block-Node.md b/Packages/com.unity.shadergraph/Documentation~/Block-Node.md index 6df0e78eadf..a99e3a19450 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Block-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Block-Node.md @@ -5,3 +5,7 @@ Block nodes are a specific type of node for the [Master Stack](Master-Stack.md). | Page | Description | | :--- | :--- | | [Built-In Blocks](Built-In-Blocks.md) | Block nodes that are always available, regardless of the active render pipeline. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md b/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md index 40196324ee1..c215414eb32 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md @@ -24,3 +24,6 @@ The following basic test code represents one possible outcome of this node with float _Boolean = 0; ``` +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Branch-Node.md b/Packages/com.unity.shadergraph/Documentation~/Branch-Node.md index 460dd770d6b..f353f04df1c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Branch-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Branch-Node.md @@ -23,3 +23,7 @@ void Unity_Branch_float4(float Predicate, float4 True, float4 False, out float4 Out = Predicate ? True : False; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md b/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md index a4091e64296..d790e3bda41 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Branch-On-Input-Connection-Node.md @@ -39,3 +39,7 @@ The Branch On Input Connection [!include[nodes-single-output](./snippets/nodes-s - [Branch node](Branch-Node.md) - [Subgraph node](Sub-graph-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md index 313e7481c60..b8e5e8b3300 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Calculate-Level-Of-Detail-Texture-2D-Node.md @@ -69,3 +69,7 @@ In the following example, a Calculate Level of Detail Texture 2D node calculates - [Sampler State node](Sampler-State-Node.md) - [Gather Texture 2D node](Gather-Texture-2D-Node.md) - [Texture 2D Asset node](Texture-2D-Asset-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Camera-Node.md b/Packages/com.unity.shadergraph/Documentation~/Camera-Node.md index 7fa343c192a..4abcb8311f1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Camera-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Camera-Node.md @@ -36,3 +36,7 @@ float _Camera_ZBufferSign = _ProjectionParams.x; float _Camera_Width = unity_OrthoParams.x; float _Camera_Height = unity_OrthoParams.y; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Ceiling-Node.md b/Packages/com.unity.shadergraph/Documentation~/Ceiling-Node.md index c8d3d3e0a3a..88ea32d9e6f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Ceiling-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Ceiling-Node.md @@ -21,3 +21,7 @@ void Unity_Ceiling_float4(float4 In, out float4 Out) Out = ceil(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Channel-Mask-Node.md b/Packages/com.unity.shadergraph/Documentation~/Channel-Mask-Node.md index d23593229f0..01d5ba918d4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Channel-Mask-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Channel-Mask-Node.md @@ -27,3 +27,7 @@ void Unity_ChannelMask_RedGreen_float4(float4 In, out float4 Out) Out = float4(0, 0, In.b, In.a); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md b/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md index d45d90c2953..2653672862c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md @@ -36,3 +36,7 @@ void Unity_ChannelMixer_float(float3 In, float3 _ChannelMixer_Red, float3 _Chann Out = float3(dot(In, _ChannelMixer_Red), dot(In, _ChannelMixer_Green), dot(In, _ChannelMixer_Blue)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Checkerboard-Node.md b/Packages/com.unity.shadergraph/Documentation~/Checkerboard-Node.md index 8d6388d8d73..6ecec849070 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Checkerboard-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Checkerboard-Node.md @@ -33,3 +33,7 @@ void Unity_Checkerboard_float(float2 UV, float3 ColorA, float3 ColorB, float2 Fr Out = lerp(ColorA, ColorB, alpha.xxx); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Circle-Pupil-Animation-Node.md b/Packages/com.unity.shadergraph/Documentation~/Circle-Pupil-Animation-Node.md index 953c09123af..7bf730fad78 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Circle-Pupil-Animation-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Circle-Pupil-Animation-Node.md @@ -16,4 +16,8 @@ This node applies a deformation to a normalized IrisUV coordinate to simulate th | **Pupil Radius** | Input | float | Radius of the pupil in the iris texture as a percentage. | | **Pupil Aperture** | Input | float | Set the current diameter of the pupil opening. | | **Maximal Pupil Aperture** | Input | float | Define the largest size the pupil opening can reach. | -| **Minimal Pupil Aperture** | Input | float | Define the smallest size the pupil opening can reach. | \ No newline at end of file +| **Minimal Pupil Aperture** | Input | float | Define the smallest size the pupil opening can reach. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Clamp-Node.md b/Packages/com.unity.shadergraph/Documentation~/Clamp-Node.md index 6ba0031ae2b..fc5feb0ad79 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Clamp-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Clamp-Node.md @@ -23,3 +23,7 @@ void Unity_Clamp_float4(float4 In, float4 Min, float4 Max, out float4 Out) Out = clamp(In, Min, Max); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Color-Mask-Node.md b/Packages/com.unity.shadergraph/Documentation~/Color-Mask-Node.md index 6dd860abeb3..b1be74c0ec1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Color-Mask-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Color-Mask-Node.md @@ -25,3 +25,7 @@ void Unity_ColorMask_float(float3 In, float3 MaskColor, float Range, float Fuzzi Out = saturate(1 - (Distance - Range) / max(Fuzziness, 1e-5)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/Color-Node.md index ba9dcb722d4..5ca2047b41c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Color-Node.md @@ -26,3 +26,7 @@ The following example code represents one possible outcome of this node. ``` float4 _Color = IsGammaSpace() ? float4(1, 2, 3, 4) : float4(SRGBToLinear(float3(1, 2, 3)), 4); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Colorspace-Conversion-Node.md b/Packages/com.unity.shadergraph/Documentation~/Colorspace-Conversion-Node.md index a993c4ddcb3..3e5ec7d0090 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Colorspace-Conversion-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Colorspace-Conversion-Node.md @@ -126,3 +126,7 @@ void Unity_ColorspaceConversion_HSV_HSV_float(float3 In, out float3 Out) Out = In; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Combine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Combine-Node.md index a7034bd83ed..4aa96a48ce1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Combine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Combine-Node.md @@ -28,3 +28,7 @@ void Unity_Combine_float(float R, float G, float B, float A, out float4 RGBA, ou RG = float2(R, G); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md b/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md index 34a352b124e..42406623625 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md @@ -75,3 +75,7 @@ void Unity_Comparison_GreaterOrEqual_float(float A, float B, out float Out) Out = A >= B ? 1 : 0; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Compute-Deformation-Node.md b/Packages/com.unity.shadergraph/Documentation~/Compute-Deformation-Node.md index e57aca9f2de..5ec8bbcd750 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Compute-Deformation-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Compute-Deformation-Node.md @@ -10,3 +10,7 @@ This node lets you pass compute deformed vertex data to a vertex shader, and onl | Position | Output | Vector3 | Vertex | Outputs the deformed vertex position. | | Normal | Output | Vector3 | Vertex | Outputs the deformed vertex normal. | | Tangent | Output | Vector3 | Vertex | Outputs the deformed vertex tangent. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Constant-Node.md b/Packages/com.unity.shadergraph/Documentation~/Constant-Node.md index 133e095c03f..03bf688ca32 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Constant-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Constant-Node.md @@ -49,3 +49,7 @@ float _Constant_E = 2.718282; ``` float _Constant_SQRT2 = 1.414214; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Contrast-Node.md b/Packages/com.unity.shadergraph/Documentation~/Contrast-Node.md index 90a19718d82..70121a9e315 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Contrast-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Contrast-Node.md @@ -23,3 +23,7 @@ void Unity_Contrast_float(float3 In, float Contrast, out float3 Out) Out = (In - midpoint) * Contrast + midpoint; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Cornea-Refraction-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cornea-Refraction-Node.md index 946d4585cf8..a0a8621c6c9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cornea-Refraction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cornea-Refraction-Node.md @@ -18,3 +18,7 @@ This node performs the refraction of the view ray in object space and returns th | **Cornea IOR** | Input | float | The index of refraction of the eye (**1.333** by default). | | **Iris Plane Offset** | Input | float | Distance between the end of the cornea and the iris plane. For the default model, this value should be **0.02** | | **RefractedPositionOS** | Output | Vector3 | Position of the refracted point on the iris plane in object space. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md index 60872a1cd29..45db54e57f3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cosine-Node.md @@ -21,3 +21,7 @@ void Unity_Cosine_float4(float4 In, out float4 Out) Out = cos(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Cross-Product-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cross-Product-Node.md index 66dd3443f70..3cb3a9babe2 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cross-Product-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cross-Product-Node.md @@ -22,3 +22,7 @@ void Unity_CrossProduct_float(float3 A, float3 B, out float3 Out) Out = cross(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md index 1b8a40870a6..a4af5ab8272 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md @@ -15,3 +15,7 @@ Defines a constant **Cubemap Asset** for use in the shader. To sample the **Cube | Control | Description | |:--- |:---| | (Cubemap)| Defines the cubemap asset from the project. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Color-Buffer-Node.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Color-Buffer-Node.md index c9a51f67c79..25776a20018 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Color-Buffer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Color-Buffer-Node.md @@ -25,3 +25,7 @@ void Unity_CustomDepth_LinearEye_float(float4 UV, out float Out) Out = SampleCustomColor(UV.xy); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md index 909746678c6..81382f7cc4d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Function-Node.md @@ -225,3 +225,7 @@ However, you should manually upgrade Custom Function nodes that produce texture From version 10.3, you can access data associated with textures via `myInputTex.samplerstate` and `myInputTex.texelSize`. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Self-Node.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Self-Node.md index 1089b0016f3..cf5720059b6 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Self-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Self-Node.md @@ -21,3 +21,7 @@ The following example code represents one possible outcome of this node. ``` UnityBuildTexture2DStructNoScale(_SelfTexture2D) ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Size-Node.md b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Size-Node.md index 967862280f0..f46d3c392a9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Size-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Custom-Render-Texture-Size-Node.md @@ -20,4 +20,8 @@ The following example code represents one possible outcome of this node. ``` _CustomRenderTextureWidth -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/DDX-Node.md b/Packages/com.unity.shadergraph/Documentation~/DDX-Node.md index 39fcc7f44f9..c94b7d55d1d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/DDX-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/DDX-Node.md @@ -21,3 +21,7 @@ void Unity_DDX_float4(float4 In, out float4 Out) Out = ddx(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/DDXY-Node.md b/Packages/com.unity.shadergraph/Documentation~/DDXY-Node.md index e17c66f42fd..c78406716ae 100644 --- a/Packages/com.unity.shadergraph/Documentation~/DDXY-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/DDXY-Node.md @@ -21,3 +21,7 @@ void Unity_DDXY_float4(float4 In, out float4 Out) Out = ddxy(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/DDY-Node.md b/Packages/com.unity.shadergraph/Documentation~/DDY-Node.md index 5618b83b111..ecd5159672b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/DDY-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/DDY-Node.md @@ -21,3 +21,7 @@ void Unity_DDY_float4(float4 In, out float4 Out) Out = ddy(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Degrees-To-Radians-Node.md b/Packages/com.unity.shadergraph/Documentation~/Degrees-To-Radians-Node.md index ea6fcfe7e66..918f91bf7cf 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Degrees-To-Radians-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Degrees-To-Radians-Node.md @@ -23,3 +23,7 @@ void Unity_DegreesToRadians_float4(float4 In, out float4 Out) Out = radians(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md index 969c297fd12..c4063bacf61 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md @@ -57,3 +57,7 @@ float _DielectricSpecular_Out = 0.040; float _DielectricSpecular_IOR = 1; float _DielectricSpecular_Out = pow(_Node_IOR - 1, 2) / pow(_DielectricSpecular_IOR + 1, 2); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Diffusion-Profile-Node.md b/Packages/com.unity.shadergraph/Documentation~/Diffusion-Profile-Node.md index cbf498235bf..49de8edfd29 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Diffusion-Profile-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Diffusion-Profile-Node.md @@ -19,3 +19,7 @@ The Diffusion Profile Node allows you to sample a [Diffusion Profile](https://do The output of this Node is a float value that represents a Diffusion Profile. The Shader can use this value to find settings for the Diffusion Profile Asset that this value represents. If you modify the output value, the Shader can no longer use it to find the settings for the Diffusion Profile Asset. You can use this behavior to enable and disable Diffusion Profiles in your Shader Graph. To disable a Diffusion Profile, multiply the output by **0**. To enable a Diffusion Profile, multiply the output by **1**. This allows you to use multiple Diffusion Profiles in different parts of your Shader Graph. Be aware that the High Definition Render Pipeline (HDRP) does not support blending between Diffusion Profiles. This is because HDRP can only evaluate a single Diffusion Profile per pixel. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Distance-Node.md b/Packages/com.unity.shadergraph/Documentation~/Distance-Node.md index 33486e932f9..c79c51532f1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Distance-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Distance-Node.md @@ -22,3 +22,7 @@ void Unity_Distance_float4(float4 A, float4 B, out float Out) Out = distance(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Dither-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dither-Node.md index 63b8a9e161f..319334f3ac9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dither-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dither-Node.md @@ -34,3 +34,6 @@ void Unity_Dither_float4(float4 In, float4 ScreenPosition, out float4 Out) } ``` +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Divide-Node.md b/Packages/com.unity.shadergraph/Documentation~/Divide-Node.md index 08570fe75f0..c0627bad2ed 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Divide-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Divide-Node.md @@ -22,3 +22,7 @@ void Unity_Divide_float4(float4 A, float4 B, out float4 Out) Out = A / B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Dot-Product-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dot-Product-Node.md index b7ea4e1a26a..6b6fe6a2338 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dot-Product-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dot-Product-Node.md @@ -26,3 +26,7 @@ void Unity_DotProduct_float4(float4 A, float4 B, out float Out) Out = dot(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md index 338871e09e2..83eeb6bc3a5 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dropdown-Node.md @@ -29,4 +29,8 @@ It has one output port: [!include[nodes-related](./snippets/nodes-related.md)] Subgraph Dropdown node: -- [Subgraph node](Sub-graph-Node.md) \ No newline at end of file +- [Subgraph node](Sub-graph-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Ellipse-Node.md b/Packages/com.unity.shadergraph/Documentation~/Ellipse-Node.md index 5ccf3b56feb..ab461992299 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Ellipse-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Ellipse-Node.md @@ -26,3 +26,7 @@ void Unity_Ellipse_float(float2 UV, float Width, float Height, out float4 Out) Out = saturate((1 - d) / fwidth(d)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Emission-Node.md b/Packages/com.unity.shadergraph/Documentation~/Emission-Node.md index 94c2c1f3537..0a0de4dd9c5 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Emission-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Emission-Node.md @@ -40,3 +40,4 @@ float3 Unity_HDRP_GetEmissionHDRColor_float(float3 ldrColor, float luminanceInte ## Additional resources - [Add light emission to a material](https://docs.unity3d.com/Manual/StandardShaderMaterialParameterEmission.html) +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Exponential-Node.md b/Packages/com.unity.shadergraph/Documentation~/Exponential-Node.md index e0063ab55bc..1c74e06aaa8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Exponential-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Exponential-Node.md @@ -41,3 +41,7 @@ void Unity_Exponential2_float4(float4 In, out float4 Out) Out = exp2(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Exposure-Node.md b/Packages/com.unity.shadergraph/Documentation~/Exposure-Node.md index d754dbe716c..3ea9eaf5d7a 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Exposure-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Exposure-Node.md @@ -22,3 +22,7 @@ Use the **Type** property to select which exposure value to get. The options are - **Inverse Current Multiplier**: Gets the inverse of the camera's exposure value from the current frame. - **Previous Multiplier**: Gets the camera's exposure value from the previous frame. - **Inverse Previous Multiplier**: Gets the inverse of the camera's exposure value from the previous frame. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Eye-Index-Node.md b/Packages/com.unity.shadergraph/Documentation~/Eye-Index-Node.md index ad888ae2474..3e0564bc59f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Eye-Index-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Eye-Index-Node.md @@ -10,3 +10,7 @@ Provides access to the **Eye Index** when stereo rendering is enabled. The **Eye | Name | Direction | Type | Binding | Description | |:-------|:-----------|:------|:--------|:------------| | Out | Output | Float | None | **Eye Index** for the camera of a stereo draw. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Eye-Surface-Type-Debug-Node.md b/Packages/com.unity.shadergraph/Documentation~/Eye-Surface-Type-Debug-Node.md index c57ef70622c..7ce6e95a583 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Eye-Surface-Type-Debug-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Eye-Surface-Type-Debug-Node.md @@ -18,3 +18,7 @@ Debug node that allows you to visually validate the current pupil radius. | **Pupil Radius** | Input | float | Radius of the pupil in the iris texture as a percentage. | | **IsActive** | Input | bool | Flag that defines if the node should be active. | | **SurfaceColor** | Output | Color | Final Diffuse color of the Eye. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Fade-Transition-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fade-Transition-Node.md index 1e8afb66a35..2936133bd50 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fade-Transition-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fade-Transition-Node.md @@ -32,3 +32,7 @@ float Result = Unity_FadeTransitionNode_ApplyFade_float( _FadeValue, _FadeContrast); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Flip-Node.md b/Packages/com.unity.shadergraph/Documentation~/Flip-Node.md index 7f95d41eb6d..c4231cf1590 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Flip-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Flip-Node.md @@ -32,3 +32,7 @@ void Unity_Flip_float4(float4 In, float4 Flip, out float4 Out) Out = (Flip * -2 + 1) * In; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Flipbook-Node.md b/Packages/com.unity.shadergraph/Documentation~/Flipbook-Node.md index b8dc6e0fba1..86bbbdc1624 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Flipbook-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Flipbook-Node.md @@ -42,3 +42,7 @@ void Unity_Flipbook_float(float2 UV, float Width, float Height, float Tile, floa Out = (UV + float2(tileX, tileY)) * tileCount; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Float-Node.md b/Packages/com.unity.shadergraph/Documentation~/Float-Node.md index 7873e4b52d7..9f4b2adfb05 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Float-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Float-Node.md @@ -18,3 +18,7 @@ The following example code represents one possible outcome of this node. ``` float _Vector1_Out = X; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Floor-Node.md b/Packages/com.unity.shadergraph/Documentation~/Floor-Node.md index 83bc63a6c80..e0fb482ea07 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Floor-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Floor-Node.md @@ -21,3 +21,7 @@ void Unity_Floor_float4(float4 In, out float4 Out) Out = floor(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Fog-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fog-Node.md index 3b8e77515e4..fc9345eb1d8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fog-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fog-Node.md @@ -31,3 +31,7 @@ void Unity_Fog_float(float3 Position, out float4 Color, out float Density) SHADERGRAPH_FOG(Position, Color, Density); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Fraction-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fraction-Node.md index 0fe0900ac45..1aacec1b139 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fraction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fraction-Node.md @@ -27,3 +27,7 @@ void Unity_Fraction_float4(float4 In, out float4 Out) Out = frac(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Effect-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Effect-Node.md index 01ec6529f21..433f9a38956 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Effect-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Effect-Node.md @@ -30,3 +30,7 @@ void Unity_FresnelEffect_float(float3 Normal, float3 ViewDir, float Power, out f Out = pow((1.0 - saturate(dot(normalize(Normal), normalize(ViewDir)))), Power); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md index d5aeeefed59..1d0762c4f13 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md @@ -59,3 +59,7 @@ void Unity_FresnelEquation_DielectricGeneric(out float3 Fresnel, float cos0, flo FresnelValue = F_FresnelConductor(iorMedium/iorSource, iorMediumK/iorSource, cos0); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md index 1861ccd516e..56fe8f03fac 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Gather-Texture-2D-Node.md @@ -71,3 +71,7 @@ By changing the value provided to the T port on the Lerp node, you can change wh - [Sample Texture 2D LOD node](Sample-Texture-2D-LOD-Node.md) - [Sampler State node](Sampler-State-Node.md) - [Texture 2D Asset node](Texture-2D-Asset-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md b/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md index 1c1ab010eaa..f322838c482 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md @@ -48,3 +48,7 @@ Gradient Unity_Gradient_float() Gradient _Gradient = Unity_Gradient_float(); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Gradient-Noise-Node.md b/Packages/com.unity.shadergraph/Documentation~/Gradient-Noise-Node.md index 9e70c130cad..889b207eb37 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Gradient-Noise-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Gradient-Noise-Node.md @@ -51,4 +51,8 @@ void Unity_GradientNoise_float(float2 UV, float Scale, out float Out) { Out = unity_gradientNoise(UV * Scale) + 0.5; } -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/HD-Custom-Depth-Node.md b/Packages/com.unity.shadergraph/Documentation~/HD-Custom-Depth-Node.md index 741b89e9633..dd5e8d997c5 100644 --- a/Packages/com.unity.shadergraph/Documentation~/HD-Custom-Depth-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/HD-Custom-Depth-Node.md @@ -32,3 +32,7 @@ void Unity_CustomDepth_LinearEye_float(float4 UV, out float Out) Out = LinearEyeDepth(SampleCustomDepth(UV.xy), _ZBufferParams); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/HD-Sample-Buffer-Node.md b/Packages/com.unity.shadergraph/Documentation~/HD-Sample-Buffer-Node.md index a000aabae3a..bdd2a2870e6 100644 --- a/Packages/com.unity.shadergraph/Documentation~/HD-Sample-Buffer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/HD-Sample-Buffer-Node.md @@ -37,3 +37,7 @@ float4 Unity_HDRP_SampleBuffer_float(float2 uv, SamplerState samplerState) return SAMPLE_TEXTURE2D_X_LOD(_CustomPostProcessInput, samplerState, uv * _RTHandlePostProcessScale.xy, 0); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Color-Node.md index 37a660a7696..77027227f8c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Color-Node.md @@ -33,3 +33,4 @@ If you use your own custom render pipeline, you must define the behavior of the - [Scene Color Node](Scene-Color-Node.md) - [Custom pass buffers and pyramids](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Custom-Pass-buffers-pyramids.html) +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Depth-Node.md b/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Depth-Node.md index da0681ff289..1dca6d33f74 100644 --- a/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Depth-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/HD-Scene-Depth-Node.md @@ -31,3 +31,7 @@ You can only use the HD Scene Depth node in the Fragment Shader Stage and with n ## Notes To use the HD Scene Depth node in a Custom Render Pipeline, you need to explicitly define its behavior, otherwise it returns white. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Hue-Node.md b/Packages/com.unity.shadergraph/Documentation~/Hue-Node.md index 264f43014c6..8e84294237f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Hue-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Hue-Node.md @@ -72,3 +72,7 @@ void Unity_Hue_Radians_float(float3 In, float Offset, out float3 Out) Out = hsv.z * lerp(K2.xxx, saturate(P2 - K2.xxx), hsv.y); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Cosine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Cosine-Node.md index fa0ce52351b..79a0dcd7f42 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Cosine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Cosine-Node.md @@ -21,3 +21,7 @@ void Unity_HyperbolicCosine_float4(float4 In, out float4 Out) Out = cosh(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Sine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Sine-Node.md index 5a07d9cfda9..5e80d7ca671 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Sine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Sine-Node.md @@ -21,3 +21,7 @@ void Unity_HyperbolicSine_float4(float4 In, out float4 Out) Out = sinh(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Tangent-Node.md b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Tangent-Node.md index f64cfa75720..3ea0986b349 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Tangent-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Hyperbolic-Tangent-Node.md @@ -21,3 +21,7 @@ void Unity_HyperbolicTangent_float4(float4 In, out float4 Out) Out = tanh(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Instance-ID-Node.md b/Packages/com.unity.shadergraph/Documentation~/Instance-ID-Node.md index 7cfe35368d4..39f79f819ff 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Instance-ID-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Instance-ID-Node.md @@ -15,3 +15,7 @@ When Unity uses dynamic instancing, instance IDs might not be consistent across | Name | Direction | Type | Binding | Description | |:-------|:-----------|:------|:--------|:------------| | Out | Output | Float | None | **Instance ID** for mesh of a given instanced draw call. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md b/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md index e4a5dbff735..2668a26b4f8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float _Integer = 1; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Inverse-Lerp-Node.md b/Packages/com.unity.shadergraph/Documentation~/Inverse-Lerp-Node.md index f8f4704f68d..b9aa631b149 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Inverse-Lerp-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Inverse-Lerp-Node.md @@ -27,3 +27,7 @@ void Unity_InverseLerp_float4(float4 A, float4 B, float4 T, out float4 Out) Out = (T - A)/(B - A); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Invert-Colors-Node.md b/Packages/com.unity.shadergraph/Documentation~/Invert-Colors-Node.md index 66123428f10..2df8c83c435 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Invert-Colors-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Invert-Colors-Node.md @@ -32,3 +32,7 @@ void Unity_InvertColors_float4(float4 In, float4 InvertColors, out float4 Out) Out = abs(InvertColors - In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Iris-Limbal-Ring-Node.md b/Packages/com.unity.shadergraph/Documentation~/Iris-Limbal-Ring-Node.md index 53cc1fce95f..380852b1282 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Iris-Limbal-Ring-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Iris-Limbal-Ring-Node.md @@ -18,3 +18,7 @@ Calculates the intensity of the Limbal ring, a darkening feature of eyes. | **LimbalRingFade** | Input | float | Normalized [0, 1] value that defines strength of the fade out of the limbal ring. | | **LimbalRingIntensity** | Input | float | Positive value that defines how dark the limbal ring is. | | **Iris Limbal Ring Color** | Output | Color | Intensity of the limbal ring. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Iris-Offset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Iris-Offset-Node.md index 0ab7fb021a2..96c29736622 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Iris-Offset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Iris-Offset-Node.md @@ -15,3 +15,7 @@ Applies an offset to the center of the Iris as real world eyes are never symmetr | **IrisUV** | Input | Vector2 | Normalized UV coordinates to sample either a texture or procedurally generate an Iris Texture. | | **IrisOffset** | Input | Vector2 | Normalized [0, 1]x[0,1] value that defines on each axis the intensity of the offset of the Center of the pupil. | | **IrisUV** | Output | Vector2 | Normalized UV coordinates to sample either a texture or procedurally generate an Iris Texture. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Iris-Out-Of-Bound-Color-Clamp-Node.md b/Packages/com.unity.shadergraph/Documentation~/Iris-Out-Of-Bound-Color-Clamp-Node.md index 02ef815ead7..992d51f1263 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Iris-Out-Of-Bound-Color-Clamp-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Iris-Out-Of-Bound-Color-Clamp-Node.md @@ -16,3 +16,7 @@ Clamps the color of the Iris to a given color. This is useful in case the refrac | **Iris Color** | Input | Color | Previously sampled or generated color of the Iris. | | **Clamp Color** | Input | Color | The color to clamp the Iris to. | | **Iris Color** | Output | Color | Result Iris color for the rest of the pipeline. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Iris-UV-Location-Node.md b/Packages/com.unity.shadergraph/Documentation~/Iris-UV-Location-Node.md index 36407685e06..5d3d0537863 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Iris-UV-Location-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Iris-UV-Location-Node.md @@ -15,3 +15,7 @@ This node converts the object position of the cornea/iris to a UV Sampling coord | **Position OS** | Input | Vector3 | Position on the iris Plane in object space. | | **Iris Radius** | Input | float | The radius of the Iris in the used model. For the default model, this value should be **0.225**. | | **IrisUV** | Output | Vector2 | ormalized UV coordinates that can be used to sample either a texture or procedurally generate an Iris Texture. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Is-Front-Face-Node.md b/Packages/com.unity.shadergraph/Documentation~/Is-Front-Face-Node.md index 587416c9237..173ad9d0df4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Is-Front-Face-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Is-Front-Face-Node.md @@ -11,3 +11,7 @@ NOTE: This [Node](Node.md) can only be used in the **Fragment** [Shader Stage](S | Name | Direction | Type | Binding | Description | |:------------ |:-------------|:-----|:---|:---| | Out | Output | Boolean | None | Output value | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Is-Infinite-Node.md b/Packages/com.unity.shadergraph/Documentation~/Is-Infinite-Node.md index dc30409b1c4..0e6fed4529d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Is-Infinite-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Is-Infinite-Node.md @@ -21,3 +21,7 @@ void Unity_IsInfinite_float(float In, out float Out) Out = isinf(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Is-NaN-Node.md b/Packages/com.unity.shadergraph/Documentation~/Is-NaN-Node.md index 990f985845f..acb784cd5c9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Is-NaN-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Is-NaN-Node.md @@ -21,3 +21,7 @@ void Unity_IsNan_float(float In, out float Out) Out = (In < 0.0 || In > 0.0 || In == 0.0) ? 0 : 1; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md b/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md index 765401ff4cb..6e1932ddda3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Keyword-Node.md @@ -7,3 +7,7 @@ You can use a Keyword node to create a static branch in your Shader Graph that r Because each Keyword node references a specific Keyword, you must first define at least one Keyword on the Blackboard. Drag a Keyword from the Blackboard to the workspace to make a Keyword node that corresponds to that Keyword. You can also right-click anywhere on the workspace, and use the **Create Node** menu to make a new Keyword node. Under **Keywords**, there is a list of Keywords that you defined on the Blackboard. Click on a Keyword in that list to create a corresponding Keyword node. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Length-Node.md b/Packages/com.unity.shadergraph/Documentation~/Length-Node.md index f691d539fc3..7576ea1cbfe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Length-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Length-Node.md @@ -31,3 +31,7 @@ void Unity_Length_float4(float4 In, out float Out) Out = length(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md b/Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md index 47de1677e45..aed00cc752e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Lerp-Node.md @@ -35,3 +35,7 @@ void Unity_Lerp_float4(float4 A, float4 B, float4 T, out float4 Out) Out = lerp(A, B, T); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Linear-Blend-Skinning-Node.md b/Packages/com.unity.shadergraph/Documentation~/Linear-Blend-Skinning-Node.md index 6af3d752a57..c60a4f6001c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Linear-Blend-Skinning-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Linear-Blend-Skinning-Node.md @@ -13,3 +13,7 @@ This node lets you apply Linear Blend Vertex Skinning, and only works with the [ | Position | Output | Vector3 | Vertex | Outputs the skinned vertex position. | | Normal | Output | Vector3 | Vertex | Outputs the skinned vertex normal. | | Tangent | Output | Vector3 | Vertex | Outputs the skinned vertex tangent. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Log-Node.md b/Packages/com.unity.shadergraph/Documentation~/Log-Node.md index 0d5b38c5410..661d08074a7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Log-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Log-Node.md @@ -55,3 +55,7 @@ void Unity_Log10_float4(float4 In, out float4 Out) Out = log10(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md b/Packages/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md index e6d03689054..4b2f9843b65 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Main-Light-Direction-Node.md @@ -10,3 +10,7 @@ The main directional light is the one casting shadows if there is any. Otherwise | Name | Direction | Type | Description | | :------------ | :-------- | :------------- | :-------------------------------------------------------- | | **Direction** | Output | Vector3 | The normalized direction of the sun light in world space. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Material-Quality-Keyword-Node.md b/Packages/com.unity.shadergraph/Documentation~/Material-Quality-Keyword-Node.md index 87627bd4e61..5d919c17c2d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Material-Quality-Keyword-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Material-Quality-Keyword-Node.md @@ -11,3 +11,4 @@ To manually set the quality level from a C# script, use the `UnityEngine.Renderi ## Additional resources: * [Keywords](Keywords.md) +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md index b5fed26f801..1565822d05e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float2x2 _Matrix2x2 = float2x2(1, 0, 0, 1); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md index 071fd6ac21b..6df871b3cc1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float3x3 _Matrix3x3 = float3x3(1, 0, 0, 0, 1, 0, 0, 0, 1); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md index 4d1ba1d3766..836891f82a7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float4x4 _Matrix4x4 = float4x4(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md index 42b2e7403fe..39e21229dc8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md @@ -56,3 +56,7 @@ void Unity_MatrixConstruction_Column_float(float4 M0, float4 M1, float4 M2, floa Out2x2 = float2x2(M0.x, M1.x, M0.y, M1.y); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Determinant-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Determinant-Node.md index b88be350dc5..13cb4539cfe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Determinant-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Determinant-Node.md @@ -21,3 +21,7 @@ void Unity_MatrixDeterminant_float4x4(float4x4 In, out float Out) Out = determinant(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md index d0b82c8a50b..d5dad28c067 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md @@ -39,3 +39,7 @@ float2 _MatrixSplit_M1 = float2(In[1].r, In[1].g); float2 _MatrixSplit_M2 = float2(0, 0); float2 _MatrixSplit_M3 = float2(0, 0); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Transpose-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Transpose-Node.md index 3ab69044934..dd1df0926ed 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Transpose-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Transpose-Node.md @@ -21,3 +21,7 @@ void Unity_MatrixTranspose_float4x4(float4x4 In, out float4x4 Out) Out = transpose(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Maximum-Node.md b/Packages/com.unity.shadergraph/Documentation~/Maximum-Node.md index 0fed2dfc480..42dfe52e87b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Maximum-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Maximum-Node.md @@ -22,3 +22,7 @@ void Unity_Maximum_float4(float4 A, float4 B, out float4 Out) Out = max(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Metal-Reflectance-Node.md b/Packages/com.unity.shadergraph/Documentation~/Metal-Reflectance-Node.md index 477e8772a88..c6c547666e8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Metal-Reflectance-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Metal-Reflectance-Node.md @@ -71,3 +71,7 @@ float3 _MetalReflectance_Out = float3(0.662, 0.655, 0.634); ``` float3 _MetalReflectance_Out = float3(0.672, 0.637, 0.585); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Minimum-Node.md b/Packages/com.unity.shadergraph/Documentation~/Minimum-Node.md index 4e0672dd99d..12db5dcde94 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Minimum-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Minimum-Node.md @@ -22,3 +22,7 @@ void Unity_Minimum_float4(float4 A, float4 B, out float4 Out) Out = min(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Modulo-Node.md b/Packages/com.unity.shadergraph/Documentation~/Modulo-Node.md index 23f21ea93a6..26c5bce8794 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Modulo-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Modulo-Node.md @@ -22,3 +22,7 @@ void Unity_Modulo_float4(float4 A, float4 B, out float4 Out) Out = fmod(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Multiply-Node.md b/Packages/com.unity.shadergraph/Documentation~/Multiply-Node.md index c18ca63b174..9cfa05e645c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Multiply-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Multiply-Node.md @@ -42,3 +42,7 @@ void Unity_Multiply_float4x4_float4x4(float4x4 A, float4x4 B, out float4x4 Out) Out = mul(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Nand-Node.md b/Packages/com.unity.shadergraph/Documentation~/Nand-Node.md index 12f627b688d..2d6fd5c2001 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Nand-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Nand-Node.md @@ -22,3 +22,7 @@ void Unity_Nand_float(float A, float B, out float Out) Out = !A && !B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Negate-Node.md b/Packages/com.unity.shadergraph/Documentation~/Negate-Node.md index 09fac3ac57f..e95a98f0495 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Negate-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Negate-Node.md @@ -21,3 +21,7 @@ void Unity_Negate_float4(float4 In, out float4 Out) Out = -1 * In; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Noise-Sine-Wave-Node.md b/Packages/com.unity.shadergraph/Documentation~/Noise-Sine-Wave-Node.md index 90c87d81f21..4cfbc98772d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Noise-Sine-Wave-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Noise-Sine-Wave-Node.md @@ -24,3 +24,7 @@ void Unity_NoiseSineWave_float4(float4 In, float2 MinMax, out float4 Out) Out = sinIn + noise; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-Blend-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-Blend-Node.md index a835dd89f65..c180e37ff87 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-Blend-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-Blend-Node.md @@ -47,3 +47,7 @@ void Unity_NormalBlend_Reoriented_float(float3 A, float3 B, out float3 Out) Out = (t / t.z) * dot(t, u) - u; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-From-Height-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-From-Height-Node.md index 84cbadacb40..e430582a1ac 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-From-Height-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-From-Height-Node.md @@ -64,3 +64,7 @@ void Unity_NormalFromHeight_World_float(float In, float Strength, float3 Positio Out = normalize(TangentMatrix[2].xyz - (Strength * surfGrad)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-From-Texture-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-From-Texture-Node.md index 8399665b5ef..655ddff06d3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-From-Texture-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-From-Texture-Node.md @@ -37,3 +37,7 @@ void Unity_NormalFromTexture_float(Texture texture, SamplerState Sampler, float2 Out = normalize(cross(va, vb)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-Reconstruct-Z-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-Reconstruct-Z-Node.md index d615c7c1c18..99f65f53fce 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-Reconstruct-Z-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-Reconstruct-Z-Node.md @@ -23,3 +23,7 @@ void Unity_NormalReconstructZ_float(float2 In, out float3 Out) Out = normalize(normalVector); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-Strength-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-Strength-Node.md index bf4b84ea74c..e6ee31fa543 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-Strength-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-Strength-Node.md @@ -22,3 +22,7 @@ void Unity_NormalStrength_float(float3 In, float Strength, out float3 Out) Out = {precision}3(In.rg * Strength, lerp(1, In.b, saturate(Strength))); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-Unpack-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-Unpack-Node.md index 986a96dca3a..c3b9e246f39 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-Unpack-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-Unpack-Node.md @@ -42,3 +42,7 @@ void Unity_NormalUnpackRGB_float(float4 In, out float3 Out) Out = UnpackNormalmapRGB(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normal-Vector-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normal-Vector-Node.md index cf6c4c9dca8..c21c99985e1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normal-Vector-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normal-Vector-Node.md @@ -20,3 +20,7 @@ The **Space** dropdown determines the coordinate space of the normal vector. | **View** | Returns the vertex or fragment normal in view space, where up is the up direction of the camera. | | **World** | Returns the vertex or fragment normal in world space, where up is the up direction of the scene. | | **Tangent** | Returns the vertex or fragment normal in tangent space, where up is away from the surface of the mesh. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Normalize-Node.md b/Packages/com.unity.shadergraph/Documentation~/Normalize-Node.md index dc83b70bc68..900959c2050 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Normalize-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Normalize-Node.md @@ -21,3 +21,7 @@ void Unity_Normalize_float4(float4 In, out float4 Out) Out = normalize(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Not-Node.md b/Packages/com.unity.shadergraph/Documentation~/Not-Node.md index bd098259e76..30e9c555add 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Not-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Not-Node.md @@ -16,3 +16,7 @@ The following example code represents one possible outcome of this node. ``` Out = !In; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Object-Node.md b/Packages/com.unity.shadergraph/Documentation~/Object-Node.md index c01fb9d4348..a07371bf0fc 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Object-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Object-Node.md @@ -36,3 +36,7 @@ float3 _Object_WorldBoundsMin = SHADERGRAPH_RENDERER_BOUNDS_MIN; float3 _Object_WorldBoundsMax = SHADERGRAPH_RENDERER_BOUNDS_MAX; float3 _Object_BoundsSize = (SHADERGRAPH_RENDERER_BOUNDS_MAX - SHADERGRAPH_RENDERER_BOUNDS_MIN); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/One-Minus-Node.md b/Packages/com.unity.shadergraph/Documentation~/One-Minus-Node.md index 88b202cb54f..e28ed002b9c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/One-Minus-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/One-Minus-Node.md @@ -21,3 +21,7 @@ void Unity_OneMinus_float4(float4 In, out float4 Out) Out = 1 - In; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Or-Node.md b/Packages/com.unity.shadergraph/Documentation~/Or-Node.md index 7cbcc0378e6..9430d49617e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Or-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Or-Node.md @@ -22,3 +22,7 @@ void Unity_Or_float(float In, out float Out) Out = A || B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Parallax-Mapping-Node.md b/Packages/com.unity.shadergraph/Documentation~/Parallax-Mapping-Node.md index e7ebc621b07..3b8407594fd 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Parallax-Mapping-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Parallax-Mapping-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float2 _ParallaxMapping_ParallaxUVs = UVs.xy + ParallaxMapping(Heightmap, Heightmap_Sampler, IN.TangentSpaceViewDirection, Amplitude * 0.01, UVs.xy); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Parallax-Occlusion-Mapping-Node.md b/Packages/com.unity.shadergraph/Documentation~/Parallax-Occlusion-Mapping-Node.md index 6a3d9c7e835..24469ea0d76 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Parallax-Occlusion-Mapping-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Parallax-Occlusion-Mapping-Node.md @@ -48,3 +48,7 @@ float2 _ParallaxOcclusionMapping_ParallaxUVs = UVs.xy + ParallaxOcclusionMapping float _ParallaxOcclusionMapping_PixelDepthOffset = (ParallaxOcclusionMapping_MaxHeight - ParallaxOcclusionMapping_OutHeight * ParallaxOcclusionMapping_MaxHeight) / max(ParallaxOcclusionMapping_NdotV, 0.0001); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Polar-Coordinates-Node.md b/Packages/com.unity.shadergraph/Documentation~/Polar-Coordinates-Node.md index 580730e5454..3707ab2e545 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Polar-Coordinates-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Polar-Coordinates-Node.md @@ -31,3 +31,7 @@ void Unity_PolarCoordinates_float(float2 UV, float2 Center, float RadialScale, f Out = float2(radius, angle); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Polygon-Node.md b/Packages/com.unity.shadergraph/Documentation~/Polygon-Node.md index ebd510ac50e..b9a273944c4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Polygon-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Polygon-Node.md @@ -34,3 +34,7 @@ void Unity_Polygon_float(float2 UV, float Sides, float Width, float Height, out Out = saturate((1 - distance) / fwidth(distance)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Position-Node.md b/Packages/com.unity.shadergraph/Documentation~/Position-Node.md index 901138afbf2..05139b272e0 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Position-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Position-Node.md @@ -19,3 +19,7 @@ The **Space** dropdown determines the coordinate space of the output position. | **World** | Returns the vertex or fragment position in the world, in meters. If you use the High Definition Render Pipeline (HDRP), **World** returns the position [relative to the camera](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?preview=1&subfolder=/manual/Camera-Relative-Rendering.html). | | **Tangent** | Returns the vertex or fragment position relative to the tangent of the surface, in meters. For more information, refer to [Normal maps](https://docs.unity3d.com/6000.3/Documentation/Manual/StandardShaderMaterialParameterNormalMapLanding.html). | | **Absolute World**| Returns the vertex or fragment position in the world, in meters. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Posterize-Node.md b/Packages/com.unity.shadergraph/Documentation~/Posterize-Node.md index 0f51078c949..5286ca496d0 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Posterize-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Posterize-Node.md @@ -26,3 +26,7 @@ void Unity_Posterize_float4(float4 In, float4 Steps, out float4 Out) Out = floor(In / (1 / Steps)) * (1 / Steps); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Power-Node.md b/Packages/com.unity.shadergraph/Documentation~/Power-Node.md index 9aa411221b8..6577f5964ff 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Power-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Power-Node.md @@ -24,3 +24,7 @@ void Unity_Power_float4(float4 A, float4 B, out float4 Out) Out = pow(A, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Preview-Node.md b/Packages/com.unity.shadergraph/Documentation~/Preview-Node.md index 232cd73dfb7..83af11c1e7d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Preview-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Preview-Node.md @@ -24,3 +24,7 @@ void Unity_Preview_float4(float4 In, out float4 Out) Out = In; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Projection-Node.md b/Packages/com.unity.shadergraph/Documentation~/Projection-Node.md index 3f6e58c5b9f..8122ea43745 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Projection-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Projection-Node.md @@ -22,3 +22,7 @@ void Unity_Projection_float4(float4 A, float4 B, out float4 Out) Out = B * dot(A, B) / dot(B, B); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Property-Node.md b/Packages/com.unity.shadergraph/Documentation~/Property-Node.md index b1664651226..4b09b8a4167 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Property-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Property-Node.md @@ -1,3 +1,7 @@ # Property node Returns the value of the associated [Blackboard](Blackboard.md) Property. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Radial-Shear-Node.md b/Packages/com.unity.shadergraph/Documentation~/Radial-Shear-Node.md index cf94cf64808..a4628816ae2 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Radial-Shear-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Radial-Shear-Node.md @@ -27,3 +27,7 @@ void Unity_RadialShear_float(float2 UV, float2 Center, float Strength, float2 Of Out = UV + float2(delta.y, -delta.x) * delta_offset + Offset; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Radians-To-Degrees-Node.md b/Packages/com.unity.shadergraph/Documentation~/Radians-To-Degrees-Node.md index 0a924149fe8..594b5121264 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Radians-To-Degrees-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Radians-To-Degrees-Node.md @@ -21,3 +21,7 @@ void Unity_RadiansToDegrees_float4(float4 In, out float4 Out) Out = degrees(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Random-Range-Node.md b/Packages/com.unity.shadergraph/Documentation~/Random-Range-Node.md index db703898b05..5a213c0222a 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Random-Range-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Random-Range-Node.md @@ -26,3 +26,7 @@ void Unity_RandomRange_float(float2 Seed, float Min, float Max, out float Out) Out = lerp(Min, Max, randomno); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Raytracing-Quality-Keyword-Node.md b/Packages/com.unity.shadergraph/Documentation~/Raytracing-Quality-Keyword-Node.md index a4862b487cc..b655c9fcd79 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Raytracing-Quality-Keyword-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Raytracing-Quality-Keyword-Node.md @@ -9,3 +9,4 @@ Refer to `https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-defi ## Additional resources: * [Keywords](Keywords.md) +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Node.md b/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Node.md index 69ac552a62b..54d70e20149 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Node.md @@ -38,3 +38,7 @@ void Unity_Reciprocal_Fast_float4(float4 In, out float4 Out) Out = rcp(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Square-Root-Node.md b/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Square-Root-Node.md index 3b0ad9d806e..59b46fb068b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Square-Root-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Reciprocal-Square-Root-Node.md @@ -21,3 +21,7 @@ void Unity_ReciprocalSquareRoot_float4(float4 In, out float4 Out) Out = rsqrt(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md index b453bd94122..33b3d4a040e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md @@ -33,3 +33,7 @@ void Unity_Rectangle_float(float2 UV, float Width, float Height, out float Out) Out = saturate(min(d.x, d.y)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Redirect-Node.md b/Packages/com.unity.shadergraph/Documentation~/Redirect-Node.md index c3c68f89e81..3da2128650b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Redirect-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Redirect-Node.md @@ -6,3 +6,7 @@ Redirect nodes don't appear in the node search. To add a redirect node, do one o - Double click on a wire. - Right click on a wire and select **Add Redirect Node**. - Select a wire and press `Ctrl/Cmd + R` on the keyboard. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Reflection-Node.md b/Packages/com.unity.shadergraph/Documentation~/Reflection-Node.md index c3d27128345..99e48fbbef8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Reflection-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Reflection-Node.md @@ -22,3 +22,7 @@ void Unity_Reflection_float4(float4 In, float4 Normal, out float4 Out) Out = reflect(In, Normal); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Reflection-Probe-Node.md b/Packages/com.unity.shadergraph/Documentation~/Reflection-Probe-Node.md index d99faed6102..e714b3d5a60 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Reflection-Probe-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Reflection-Probe-Node.md @@ -32,3 +32,7 @@ void Unity_ReflectionProbe_float(float3 ViewDir, float3 Normal, float LOD, out f Out = SHADERGRAPH_REFLECTION_PROBE(ViewDir, Normal, LOD); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md b/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md index f39b0b57576..e0980452c23 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md @@ -60,3 +60,7 @@ void Unity_RefractSafe(float3 Incident, float3 Normal, float IORInput, float IOR (k >= 0.0 ? saturate(F_FresnelDielectric(internalIORMedium/internalIORSource, -cos0)) : 1.0); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rejection-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rejection-Node.md index 4b4092475a0..97ac4abc8f8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rejection-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rejection-Node.md @@ -22,3 +22,7 @@ void Unity_Rejection_float4(float4 A, float4 B, out float4 Out) Out = A - (B * dot(A, B) / dot(B, B)) } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md b/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md index 8e0e6e3f639..a9239fa35c7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md @@ -20,4 +20,8 @@ void Unity_Remap_float4(float4 In, float2 InMinMax, float2 OutMinMax, out float4 { Out = OutMinMax.x + (In - InMinMax.x) * (OutMinMax.y - OutMinMax.x) / (InMinMax.y - InMinMax.x); } -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Replace-Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/Replace-Color-Node.md index e85467cf9c0..a5e6d3ed640 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Replace-Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Replace-Color-Node.md @@ -26,3 +26,7 @@ void Unity_ReplaceColor_float(float3 In, float3 From, float3 To, float Range, fl Out = lerp(To, In, saturate((Distance - Range) / max(Fuzziness, 1e-5f))); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rotate-About-Axis-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rotate-About-Axis-Node.md index fef208686c8..bfca12c7feb 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rotate-About-Axis-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rotate-About-Axis-Node.md @@ -61,3 +61,7 @@ void Unity_RotateAboutAxis_Degrees_float(float3 In, float3 Axis, float Rotation, Out = mul(rot_mat, In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rotate-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rotate-Node.md index a9851024b0c..65fed0673c8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rotate-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rotate-Node.md @@ -59,3 +59,7 @@ void Unity_Rotate_Degrees_float(float2 UV, float2 Center, float Rotation, out fl Out = UV; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Round-Node.md b/Packages/com.unity.shadergraph/Documentation~/Round-Node.md index 80b124f94c5..9c9b29dc3a8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Round-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Round-Node.md @@ -21,3 +21,7 @@ void Unity_Round_float4(float4 In, out float4 Out) Out = round(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rounded-Polygon-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rounded-Polygon-Node.md index 4c64a4f4d6a..fdf63ae8271 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rounded-Polygon-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rounded-Polygon-Node.md @@ -80,3 +80,7 @@ void RoundedPolygon_Func_float(float2 UV, float Width, float Height, float Sides Out = saturate((1 - Out) / fwidth(Out)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md index f43d5783719..f442b01cbc1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rounded-Rectangle-Node.md @@ -32,3 +32,7 @@ void Unity_RoundedRectangle_float(float2 UV, float Width, float Height, float Ra Out = saturate((1 - d) / fwidth(d)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md index e97442f47b7..b52e8f7c7b8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Cubemap-Node.md @@ -23,3 +23,7 @@ The following example code represents one possible outcome of this node. ``` float4 _SampleCubemap_Out = SAMPLE_TEXTURECUBE_LOD(Cubemap, Sampler, Dir, LOD); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Gradient-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Gradient-Node.md index 65f124ec8b3..a0acd805a94 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Gradient-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Gradient-Node.md @@ -39,3 +39,7 @@ void Unity_SampleGradient_float(float4 Gradient, float Time, out float4 Out) Out = float4(color, alpha); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md index 310b40907fe..9121c721ad1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Reflected-Cubemap-Node.md @@ -24,3 +24,7 @@ The following example code represents one possible outcome of this node. ``` float4 _SampleCubemap_Out = SAMPLE_TEXTURECUBE_LOD(Cubemap, Sampler, reflect(-ViewDir, Normal), LOD); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md index 7551dc32f7e..6c6cbb936b1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Array-Node.md @@ -77,3 +77,7 @@ float _SampleTexture2DArray_A = _SampleTexture2DArray_RGBA.a; - [Sample Texture 2D node](Sample-Texture-2D-Node.md) - [Sample Texture 3D node](Sample-Texture-3D-Node.md) - [Sampler State node](Sampler-State-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-LOD-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-LOD-Node.md index aff1599bd2e..c436c9b5047 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-LOD-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-LOD-Node.md @@ -58,3 +58,7 @@ float _SampleTexture2DLOD_G = _SampleTexture2DLOD_RGBA.g; float _SampleTexture2DLOD_B = _SampleTexture2DLOD_RGBA.b; float _SampleTexture2DLOD_A = _SampleTexture2DLOD_RGBA.a; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md index f07eee8dea4..5d261125a34 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md @@ -98,3 +98,7 @@ float _SampleTexture2D_A = _SampleTexture2D_RGBA.a; - [Sample Texture 2D Array node](Sample-Texture-2D-Array-Node.md) - [Sample Texture 3D node](Sample-Texture-3D-Node.md) - [Sampler State node](Sampler-State-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md index db38515f6fb..58365856efa 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Texture-3D-Node.md @@ -90,3 +90,7 @@ float4 _SampleTexture3D_Out = SAMPLE_TEXTURE3D(Texture, Sampler, UV); - [Sample Texture 2D Array node](Sample-Texture-2D-Array-Node.md) - [Sample Texture 2D node](Sample-Texture-2D-Node.md) - [Sampler State node](Sampler-State-Node.md) + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sample-Virtual-Texture-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sample-Virtual-Texture-Node.md index 5d706fa5e53..ea19b944084 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sample-Virtual-Texture-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sample-Virtual-Texture-Node.md @@ -69,3 +69,7 @@ float4 SampleVirtualTexture(float2 uv, VTPropertyWithTextureType vtProperty, out return GetResolveOutput(info); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sampler-State-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sampler-State-Node.md index fcfc4def2a9..6495e1fd29f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sampler-State-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sampler-State-Node.md @@ -36,3 +36,7 @@ The following example code represents one possible outcome of this node. ``` SamplerState _SamplerState_Out = _SamplerState_Linear_Repeat_sampler; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Saturate-Node.md b/Packages/com.unity.shadergraph/Documentation~/Saturate-Node.md index 8d5ad56ac19..55367d7c74e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Saturate-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Saturate-Node.md @@ -21,3 +21,7 @@ void Unity_Saturate_float4(float4 In, out float4 Out) Out = saturate(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Saturation-Node.md b/Packages/com.unity.shadergraph/Documentation~/Saturation-Node.md index fcb734e3bd1..17ed47c713c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Saturation-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Saturation-Node.md @@ -23,3 +23,7 @@ void Unity_Saturation_float(float3 In, float Saturation, out float3 Out) Out = luma.xxx + Saturation.xxx * (In - luma.xxx); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sawtooth-Wave-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sawtooth-Wave-Node.md index 22f1c8d000e..d18a4044498 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sawtooth-Wave-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sawtooth-Wave-Node.md @@ -21,3 +21,7 @@ void Unity_SawtoothWave_float4(float4 In, out float4 Out) Out = 2 * (In - floor(0.5 + In)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Scene-Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/Scene-Color-Node.md index e863aab4c58..a900cfe62fd 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Scene-Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Scene-Color-Node.md @@ -40,3 +40,7 @@ void Unity_SceneColor_float(float4 UV, out float3 Out) Out = SHADERGRAPH_SAMPLE_SCENE_COLOR(UV); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Difference-Node.md b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Difference-Node.md index ee7ed98b9dc..ea27f5ecb28 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Difference-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Difference-Node.md @@ -17,3 +17,7 @@ The Scene Depth Difference node returns the difference in depth between a world | **Linear 01** | Returns the distance in linear normalized space. The minimum distance is 0, and the maximum distance is 1. | | **Raw** | Returns the distance in the non-linear space the depth buffer uses. The minimum distance is 0, and the maximum distance is 1. | | **Eye** | Returns the distance in meters. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md index 9b62cfe227f..1231620992b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md @@ -41,4 +41,8 @@ void Unity_SceneDepth_Raw_float(float4 UV, out float Out) { Out = SHADERGRAPH_SAMPLE_SCENE_DEPTH(UV); } -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sclera-Iris-Blend-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sclera-Iris-Blend-Node.md index df0bde7c17f..596319cb393 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sclera-Iris-Blend-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sclera-Iris-Blend-Node.md @@ -28,3 +28,7 @@ This node blends all the properties of the Iris and the Sclera so that they can | **Specular Normal** | Output | Vector3 | Normal of the specular lobes. | | **EyeSmoothness** | Output | float | Final smoothness of the Eye. | | **SurfaceDiffusionProfile** | Output | Diffusion Profile | Diffusion profile of the target fragment. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sclera-Limbal-Ring-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sclera-Limbal-Ring-Node.md index 5c19eea0772..1fa995ebfa1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sclera-Limbal-Ring-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sclera-Limbal-Ring-Node.md @@ -19,3 +19,7 @@ Calculates the intensity of the Sclera ring, a darkening feature of eyes. | **LimbalRingFade** | Input | float | Normalized [0, 1] value that defines strength of the fade out of the limbal ring.** | | **LimbalRing Intensity** | Input | float | Positive value that defines how dark the limbal ring is. | | **Iris Limbal Ring Color** | Output | Color | Intensity of the limbal ring (blackscale). | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sclera-UV-Location-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sclera-UV-Location-Node.md index aca7d2975dd..b28be366233 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sclera-UV-Location-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sclera-UV-Location-Node.md @@ -14,3 +14,7 @@ This node converts the object position of the sclera to a UV Sampling coordinate | -------------- | ------------- | ------- | ------------------------------------------------------------ | | **PositionOS** | Input | Vector3 | **Position of the fragment to shade in object space.** | | **ScleraUV** | Output | Vector2 | Normalized UV coordinates that can be used to sample either a texture or procedurally generate a Sclera Texture. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Screen-Node.md b/Packages/com.unity.shadergraph/Documentation~/Screen-Node.md index 2be18e2df22..f19a33389d0 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Screen-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Screen-Node.md @@ -24,3 +24,7 @@ The following example code represents one possible outcome of this node. float _Screen_Width = _ScreenParams.x; float _Screen_Height = _ScreenParams.y; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Screen-Position-Node.md b/Packages/com.unity.shadergraph/Documentation~/Screen-Position-Node.md index 776491e134f..d1321505ac1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Screen-Position-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Screen-Position-Node.md @@ -61,3 +61,6 @@ float4 Out = frac(float4((IN.NDCPosition.x * 2 - 1) * _ScreenParams.x / _ScreenP float4 Out = float4(IN.PixelPosition.xy, 0, 0); ``` +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sign-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sign-Node.md index 1e3b9be5038..e4532cdef50 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sign-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sign-Node.md @@ -21,3 +21,7 @@ void Unity_Sign_float4(float4 In, out float4 Out) Out = sign(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md b/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md index b554309e144..c3ead08d469 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md @@ -74,4 +74,8 @@ void Unity_SimpleNoise_float(float2 UV, float Scale, out float Out) Out = t; } -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sine-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sine-Node.md index e3a4819c0f6..33396671809 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sine-Node.md @@ -21,3 +21,7 @@ void Unity_Sine_float4(float4 In, out float4 Out) Out = sin(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Slice-Index-Cubemap-Face-Node.md b/Packages/com.unity.shadergraph/Documentation~/Slice-Index-Cubemap-Face-Node.md index 24626b92cb1..4228107e1d8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Slice-Index-Cubemap-Face-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Slice-Index-Cubemap-Face-Node.md @@ -19,4 +19,8 @@ The following example code represents one possible outcome of this node. ``` _CustomRenderTextureCubeFace -``` \ No newline at end of file +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md b/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md index 7cd0030551c..89317c27aa8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md @@ -25,3 +25,7 @@ The following example code represents one possible outcome of this node. ``` float _Slider_Out = 1.0; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Smoothstep-Node.md b/Packages/com.unity.shadergraph/Documentation~/Smoothstep-Node.md index 71ebdb0e577..a9d415f8664 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Smoothstep-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Smoothstep-Node.md @@ -25,3 +25,7 @@ void Unity_Smoothstep_float4(float4 Edge1, float4 Edge2, float4 In, out float4 O Out = smoothstep(Edge1, Edge2, In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sphere-Mask-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sphere-Mask-Node.md index ab0344327ab..a929c2999f9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sphere-Mask-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sphere-Mask-Node.md @@ -24,3 +24,7 @@ void Unity_SphereMask_float4(float4 Coords, float4 Center, float Radius, float H Out = 1 - saturate((distance(Coords, Center) - Radius) / (1 - Hardness)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Spherize-Node.md b/Packages/com.unity.shadergraph/Documentation~/Spherize-Node.md index 6c7510e7e3c..e4016db9eb9 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Spherize-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Spherize-Node.md @@ -28,3 +28,7 @@ void Unity_Spherize_float(float2 UV, float2 Center, float Strength, float2 Offse Out = UV + delta * delta_offset + Offset; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Split-Node.md b/Packages/com.unity.shadergraph/Documentation~/Split-Node.md index 03e39492baf..3707ba0a074 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Split-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Split-Node.md @@ -24,3 +24,7 @@ float _Split_G = In[1]; float _Split_B = 0; float _Split_A = 0; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md b/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md index 6a619f89c58..cab89f536b2 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md @@ -17,3 +17,7 @@ Another term you may hear for tiling in this context is scale. Both terms refer | Tiling | Output | Vector 2 | Amount of tiling to apply per channel, set via the Material Inspector. | | Offset | Output | Vector 2 | Amount of offset to apply per channel, set via the Material Inspector. | | Texture Only | Output | Vector 2 | The input Texture2D, without tiling and offset data. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Square-Root-Node.md b/Packages/com.unity.shadergraph/Documentation~/Square-Root-Node.md index f12db540ce8..0b4d70c99bb 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Square-Root-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Square-Root-Node.md @@ -21,3 +21,7 @@ void Unity_SquareRoot_float4(float4 In, out float4 Out) Out = sqrt(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Square-Wave-Node.md b/Packages/com.unity.shadergraph/Documentation~/Square-Wave-Node.md index 9e7e79a0cd9..eeb2bae45cf 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Square-Wave-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Square-Wave-Node.md @@ -21,3 +21,7 @@ void Unity_SquareWave_float4(float4 In, out float4 Out) Out = 1.0 - 2.0 * round(frac(In)); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Step-Node.md b/Packages/com.unity.shadergraph/Documentation~/Step-Node.md index 16e13135d8f..2f73a39e72d 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Step-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Step-Node.md @@ -22,3 +22,7 @@ void Unity_Step_float4(float4 Edge, float4 In, out float4 Out) Out = step(Edge, In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Sub-graph-Node.md b/Packages/com.unity.shadergraph/Documentation~/Sub-graph-Node.md index 3024c39e775..d3b9ba53842 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sub-graph-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sub-graph-Node.md @@ -11,3 +11,4 @@ Some built-in nodes are Sub Graph nodes, for example the [ThreadMapDetail node]( ## Additional resources - [Sub Graphs](Sub-graph.md) +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Subtract-Node.md b/Packages/com.unity.shadergraph/Documentation~/Subtract-Node.md index 4d1e18ee7e9..3cfbe4e1c15 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Subtract-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Subtract-Node.md @@ -22,3 +22,7 @@ void Unity_Subtract_float4(float4 A, float4 B, out float4 Out) Out = A - B; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Swizzle-Node.md b/Packages/com.unity.shadergraph/Documentation~/Swizzle-Node.md index de11714c7b6..27c18a3cf58 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Swizzle-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Swizzle-Node.md @@ -35,3 +35,8 @@ The following example code represents one possible outcome of this node. ``` float4 _Swizzle_Out = In.wzyx; +``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Tangent-Node.md b/Packages/com.unity.shadergraph/Documentation~/Tangent-Node.md index 0777f091392..58c5b490276 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Tangent-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Tangent-Node.md @@ -21,3 +21,7 @@ void Unity_Tangent_float4(float4 In, out float4 Out) Out = tan(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Tangent-Vector-Node.md b/Packages/com.unity.shadergraph/Documentation~/Tangent-Vector-Node.md index 99124620033..67e88f87dcb 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Tangent-Vector-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Tangent-Vector-Node.md @@ -13,3 +13,7 @@ Provides access to the mesh vertex or fragment's **Tangent Vector**. The coordin | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| | Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **Tangent Vector** to output. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Array-Asset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Array-Asset-Node.md index b9eda3a25ff..42d5fba24ad 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Array-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Array-Asset-Node.md @@ -24,3 +24,7 @@ The following example code represents one possible outcome of this node. TEXTURE2D_ARRAY(_Texture2DArrayAsset); SAMPLER(sampler_Texture2DArrayAsset); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md index 8868ed3c05b..301a0af5959 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md @@ -24,3 +24,7 @@ The following example code represents one possible outcome of this node. TEXTURE2D(_Texture2DAsset); SAMPLER(sampler_Texture2DAsset); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md index efa5a10b0b7..0c3387c58e7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md @@ -24,3 +24,7 @@ The following example code represents one possible outcome of this node. TEXTURE3D(_Texture3DAsset); SAMPLER(sampler_Texture3DAsset); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Texture-Size-Node.md b/Packages/com.unity.shadergraph/Documentation~/Texture-Size-Node.md index e7028fd57a9..f8212d1364e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-Size-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-Size-Node.md @@ -42,3 +42,7 @@ The following example code represents one possible outcome of this node. float _TexelSize_Width = Texture_TexelSize.z; float _TexelSize_Height = Texture_TexelSize.w; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md b/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md index c765cd3af94..caebd4a75e0 100644 --- a/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md @@ -62,3 +62,7 @@ To view these Shader Graphs: 2. Next to the **Shader** dropdown, select **Edit**. Your chosen Fabric's Shader Graph opens. You can view the ThreadMapDetail node, its Subgraph, and the other nodes that create HDRP's Fabric shaders. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Tiling-And-Offset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Tiling-And-Offset-Node.md index 3ba01582f96..74f53bcb962 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Tiling-And-Offset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Tiling-And-Offset-Node.md @@ -23,3 +23,7 @@ void Unity_TilingAndOffset_float(float2 UV, float2 Tiling, float2 Offset, out fl Out = UV * Tiling + Offset; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Time-Node.md b/Packages/com.unity.shadergraph/Documentation~/Time-Node.md index a7f3155fbc4..4e2bc7a6890 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Time-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Time-Node.md @@ -25,3 +25,7 @@ float Time_CosineTime = _CosTime.w; float Time_DeltaTime = unity_DeltaTime.x; float Time_SmoothDelta = unity_DeltaTime.z; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Transform-Node.md b/Packages/com.unity.shadergraph/Documentation~/Transform-Node.md index bed7279fbed..59b0ae8c524 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Transform-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Transform-Node.md @@ -270,3 +270,7 @@ float3 _Transform_Out = result.xyz / result.w; ``` float3 _Transform_Out = GetAbsolutePositionWS(ComputeWorldSpacePosition(In.xy, In.z, UNITY_MATRIX_I_VP)); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md b/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md index 6031cfed947..c7bf7c1c7a4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Transformation-Matrix-Node.md @@ -62,3 +62,7 @@ float4x4 _TransformationMatrix_Out = UNITY_MATRIX_VP; ``` float4x4 _TransformationMatrix_Out = UNITY_MATRIX_I_VP; ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Triangle-Wave-Node.md b/Packages/com.unity.shadergraph/Documentation~/Triangle-Wave-Node.md index ec800d6f26a..bc848958ffe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Triangle-Wave-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Triangle-Wave-Node.md @@ -21,3 +21,7 @@ void Unity_TriangleWave_float4(float4 In, out float4 Out) Out = 2.0 * abs( 2 * (In - floor(0.5 + In)) ) - 1.0; } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Triplanar-Node.md b/Packages/com.unity.shadergraph/Documentation~/Triplanar-Node.md index f1e68e56b99..f5a77ad6143 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Triplanar-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Triplanar-Node.md @@ -73,3 +73,7 @@ float4 Out = float4(normalize(Node_X.zyx * Node_Blend.x + Node_Y.xzy * Node_Blen float3x3 Node_Transform = float3x3(IN.WorldSpaceTangent, IN.WorldSpaceBiTangent, IN.WorldSpaceNormal); Out.rgb = TransformWorldToTangent(Out.rgb, Node_Transform); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Truncate-Node.md b/Packages/com.unity.shadergraph/Documentation~/Truncate-Node.md index aaeb3d0b01d..9dbdc443cc4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Truncate-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Truncate-Node.md @@ -21,3 +21,7 @@ void Unity_Truncate_float4(float4 In, out float4 Out) Out = trunc(In); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Twirl-Node.md b/Packages/com.unity.shadergraph/Documentation~/Twirl-Node.md index e89f217b61a..0f0d4053155 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Twirl-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Twirl-Node.md @@ -28,3 +28,7 @@ void Unity_Twirl_float(float2 UV, float2 Center, float Strength, float2 Offset, Out = float2(x + Center.x + Offset.x, y + Center.y + Offset.y); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/UV-Node.md b/Packages/com.unity.shadergraph/Documentation~/UV-Node.md index 013dd2bbf9e..09432983940 100644 --- a/Packages/com.unity.shadergraph/Documentation~/UV-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/UV-Node.md @@ -15,3 +15,7 @@ UV coordinates usually have two channels, but the UV node outputs four channels | **Name** | **Type** | **Options** | **Description** | |:------------ |:-------------|:-----|:---| | **Channel** | Dropdown | **UV0**, **UV1**, **UV2**, **UV3**, **UV4**, **UV5**, **UV6**, **UV7** | Selects the coordinate set to output. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/UVCombine-Node.md b/Packages/com.unity.shadergraph/Documentation~/UVCombine-Node.md index 0382d1ecc90..a02514b063a 100644 --- a/Packages/com.unity.shadergraph/Documentation~/UVCombine-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/UVCombine-Node.md @@ -46,3 +46,7 @@ To view these Shader Graphs: 2. Next to the **Shader** dropdown, select **Edit**. Your chosen Fabric's Shader Graph opens. You can view the UVCombine node, its Subgraph, and the other nodes that create HDRP's Fabric shaders. + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md index 5beb6285692..d147e37f18a 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-2-Node.md @@ -19,3 +19,7 @@ The following example code represents one possible outcome of this node. ``` float2 _Vector2_Out = float2(X, Y); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md index 763c3b168a3..bb62c675959 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-3-Node.md @@ -20,3 +20,7 @@ The following example code represents one possible outcome of this node. ``` float3 _Vector3_Out = float3(X, Y, Z); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md index 5e173241d8e..dbc9e2905c4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vector-4-Node.md @@ -21,3 +21,7 @@ The following example code represents one possible outcome of this node. ``` float4 _Vector4_Out = float4(X, Y, Z, W); ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Vertex-Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vertex-Color-Node.md index d3aff333053..0db11068a80 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vertex-Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vertex-Color-Node.md @@ -9,3 +9,7 @@ Provides access to the mesh vertex or fragment's **Vertex Color** value. | Name | Direction | Type | Binding | Description | |:------------ |:-------------|:-----|:---|:---| | Out | Output | Vector 4 | None | **Vertex Color** for the Mesh Vertex/Fragment. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Vertex-ID-Node.md b/Packages/com.unity.shadergraph/Documentation~/Vertex-ID-Node.md index b684c849537..b007f48b7cf 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Vertex-ID-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Vertex-ID-Node.md @@ -9,3 +9,7 @@ Provides access to the mesh vertex or fragment's **Vertex ID** value. | Name | Direction | Type | Binding | Description | |:-------|:-----------|:------|:--------|:------------| | Out | Output | Float | None | **Vertex ID** for the Mesh Vertex/Fragment. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/View-Direction-Node.md b/Packages/com.unity.shadergraph/Documentation~/View-Direction-Node.md index 31cd3f67efc..8fb9dc7fb22 100644 --- a/Packages/com.unity.shadergraph/Documentation~/View-Direction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/View-Direction-Node.md @@ -21,3 +21,7 @@ If you want to keep using the old behavior in URP outside of object space, repla | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| | Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/View-Vector-Node.md b/Packages/com.unity.shadergraph/Documentation~/View-Vector-Node.md index b717f8170b7..6bff7f89e00 100644 --- a/Packages/com.unity.shadergraph/Documentation~/View-Vector-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/View-Vector-Node.md @@ -18,3 +18,7 @@ Select a **Space** to modify the output value's coordinate space. | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| | Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. | + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/Voronoi-Node.md b/Packages/com.unity.shadergraph/Documentation~/Voronoi-Node.md index 1250c9bbe7d..36f91277b64 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Voronoi-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Voronoi-Node.md @@ -58,3 +58,7 @@ void Unity_Voronoi_float(float2 UV, float AngleOffset, float CellDensity, out fl } } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/White-Balance-Node.md b/Packages/com.unity.shadergraph/Documentation~/White-Balance-Node.md index 088842764e1..1a9691caaa3 100644 --- a/Packages/com.unity.shadergraph/Documentation~/White-Balance-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/White-Balance-Node.md @@ -61,3 +61,7 @@ void Unity_WhiteBalance_float(float3 In, float Temperature, float Tint, out floa Out = mul(LMS_2_LIN_MAT, lms); } ``` + +## Additional resources + +[!include[nodes-example-samples](./snippets/nodes-example-samples.md)] diff --git a/Packages/com.unity.shadergraph/Documentation~/snippets/nodes-example-samples.md b/Packages/com.unity.shadergraph/Documentation~/snippets/nodes-example-samples.md new file mode 100644 index 00000000000..b00973e2fa3 --- /dev/null +++ b/Packages/com.unity.shadergraph/Documentation~/snippets/nodes-example-samples.md @@ -0,0 +1 @@ +- [Node Reference sample](Shader-Graph-Sample-Node-Reference.md) From d44474b11b8956d741dbde5abee781c37062db74 Mon Sep 17 00:00:00 2001 From: Erik Hakala Date: Tue, 22 Sep 2026 08:57:41 +0000 Subject: [PATCH 06/18] [6000.0] Fix shadergraph compilation failure on uv4 input semantic differences. --- .../ShaderGraph/Includes/MotionVectorPass.hlsl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/MotionVectorPass.hlsl b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/MotionVectorPass.hlsl index e1c3a831dd1..016367f1398 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/MotionVectorPass.hlsl +++ b/Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/MotionVectorPass.hlsl @@ -3,11 +3,21 @@ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl" +// TODO: URP target should generate MotionVectorPassAttributes accurately based on usage. +// NOTE: SkinnedMeshRenderer hardcodes TexCoord4 to float3. struct MotionVectorPassAttributes { +#if defined(ATTRIBUTES_NEED_TEXCOORD4) + float4 previousPositionOS : TEXCOORD4; // SG declared TexCoord4 as float4 +#else float3 previousPositionOS : TEXCOORD4; // Contains previous frame local vertex position (for skinned meshes) +#endif #if defined (_ADD_PRECOMPUTED_VELOCITY) + #if defined(ATTRIBUTES_NEED_TEXCOORD5) + float4 alembicMotionVectorOS : TEXCOORD5; // SG declared TexCoord5 as float4 + #else float3 alembicMotionVectorOS : TEXCOORD5; // Alembic precomputed object space motion vector (offset from last frame's position) + #endif #endif }; @@ -98,7 +108,7 @@ void vert( #endif #else const bool hasDeformation = unity_MotionVectorsParams.x == 1; // Mesh has skinned deformation - float3 previousPositionOS = hasDeformation ? passInput.previousPositionOS : input.positionOS; + float3 previousPositionOS = hasDeformation ? passInput.previousPositionOS.xyz : input.positionOS; #if defined(AUTOMATIC_TIME_BASED_MOTION_VECTORS) && defined(GRAPH_VERTEX_USES_TIME_PARAMETERS_INPUT) const bool applyDeformation = true; @@ -124,9 +134,9 @@ void vert( // overwritten by Compute Deform node ApplyPreviousFrameDeformedVertexPosition(input.vertexID, previousPositionOS); #endif - + #if defined (_ADD_PRECOMPUTED_VELOCITY) - previousPositionOS -= passInput.alembicMotionVectorOS; + previousPositionOS -= passInput.alembicMotionVectorOS.xyz; #endif mvOutput.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, float4(currentFrameMvData.positionWS, 1.0f)); From 8bea48a55ebb27cb9a2a99694f8728f7102d1c28 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Thu, 24 Sep 2026 10:42:11 +0000 Subject: [PATCH 07/18] [Port] [6000.0] Fix seams with box projection in URP on platforms supporting half precision --- .../ShaderLibrary/GlobalIllumination.hlsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl index 9ec19923a89..60757175b24 100644 --- a/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl +++ b/Packages/com.unity.render-pipelines.universal/ShaderLibrary/GlobalIllumination.hlsl @@ -217,7 +217,7 @@ half3 BoxProjectedCubemapDirection(half3 reflectionWS, float3 positionWS, float4 if (cubemapPositionWS.w > 0.0f) { float3 boxMinMax = (reflectionWS > 0.0f) ? boxMax.xyz : boxMin.xyz; - half3 rbMinMax = half3(boxMinMax - positionWS) / reflectionWS; + half3 rbMinMax = (reflectionWS != 0.0f) ? half3(boxMinMax - positionWS) / reflectionWS : HALF_MAX; half fa = half(min(min(rbMinMax.x, rbMinMax.y), rbMinMax.z)); From b1db0c0dd5a5c1a42dd168e522319f7cf2a98646 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 26 Sep 2026 21:38:31 +0000 Subject: [PATCH 08/18] [Port] [6000.0] Set HideAndDontSave on blit meshes so they survive scene reload --- .../Runtime/Utilities/Blitter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs index 616a310741e..9b714cc5894 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blitter.cs @@ -123,7 +123,7 @@ public static void Initialize(Shader blitPS, Shader blitColorAndDepthPS) { if (!s_TriangleMesh) { - s_TriangleMesh = new Mesh(); + s_TriangleMesh = new Mesh { hideFlags = HideFlags.HideAndDontSave }; s_TriangleMesh.vertices = GetFullScreenTriangleVertexPosition(nearClipZ); s_TriangleMesh.uv = GetFullScreenTriangleTexCoord(); s_TriangleMesh.triangles = new int[3] { 0, 1, 2 }; @@ -131,7 +131,7 @@ public static void Initialize(Shader blitPS, Shader blitColorAndDepthPS) } if (!s_QuadMesh) { - s_QuadMesh = new Mesh(); + s_QuadMesh = new Mesh { hideFlags = HideFlags.HideAndDontSave }; s_QuadMesh.vertices = GetQuadVertexPosition(nearClipZ); s_QuadMesh.uv = GetQuadTexCoord(); s_QuadMesh.triangles = new int[6] { 0, 1, 2, 0, 2, 3 }; From 493ccf5288fc5e34f42b0cb57ca8ce323e19472b Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 3 Oct 2026 07:35:29 +0000 Subject: [PATCH 09/18] [Port] [6000.0] [7000.0][UUM-150232] [2D] Respect Disable Depth and Stencil Buffers in URP 2D --- .../2D/Rendergraph/DrawNormal2DPass.cs | 2 +- .../2D/Rendergraph/DrawRenderer2DPass.cs | 2 +- .../2D/Rendergraph/Renderer2DRendergraph.cs | 40 ++-- .../Runtime/Passes/DrawScreenSpaceUIPass.cs | 4 +- .../Runtime/Passes/RenderObjectsPass.cs | 5 +- .../Runtime/ScriptableRenderer.cs | 8 +- .../CommonAssets/UniversalRPAsset.asset | 5 +- .../064_RenderObjectsRendererFeature.meta | 8 + .../064_RenderObjectsRendererFeature.unity | 3 + ...64_RenderObjectsRendererFeature.unity.meta | 7 + ...4_RenderObjectsFeature Renderer Data.asset | 103 +++++++++ ...derObjectsFeature Renderer Data.asset.meta | 8 + .../Runtime/Renderer2DBackbufferDepthTests.cs | 197 ++++++++++++++++++ .../Renderer2DBackbufferDepthTests.cs.meta | 11 + .../Test/Runtime/Renderer2DDepthUsageTests.cs | 137 ++++++++++++ .../Runtime/Renderer2DDepthUsageTests.cs.meta | 11 + 16 files changed, 531 insertions(+), 20 deletions(-) create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs.meta diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs index 4aa68d730fd..71d5d6e55f7 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawNormal2DPass.cs @@ -53,7 +53,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData builder.SetRenderAttachment(universal2DResourceData.normalsTexture[batchIndex], 0); // Depth needed for sprite mask stencil or z test for 3d meshes - if (Renderer2D.IsDepthUsageAllowed(frameData, rendererData)) + if (commonResourceData.activeDepthTexture.IsValid()) { var depth = universal2DResourceData.normalsDepth.IsValid() ? universal2DResourceData.normalsDepth : commonResourceData.activeDepthTexture; builder.SetRenderAttachmentDepth(depth); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs index dc0455681cf..cb6df6a7ace 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/DrawRenderer2DPass.cs @@ -172,7 +172,7 @@ public void Render(RenderGraph graph, ContextContainer frameData, Renderer2DData // Set color and depth attachments builder.SetRenderAttachment(commonResourceData.activeColorTexture, 0); - if (Renderer2D.IsDepthUsageAllowed(frameData, rendererData)) + if (commonResourceData.activeDepthTexture.IsValid()) builder.SetRenderAttachmentDepth(commonResourceData.activeDepthTexture); builder.AllowGlobalStateModification(true); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs index 66cbcd5f448..355bc94e44d 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs @@ -65,12 +65,16 @@ internal static bool IsDepthUsageAllowed(ContextContainer frameData, Renderer2DD { UniversalCameraData cameraData = frameData.Get(); + // Renderer2DData.useDepthStencilBuffer bool allowDepth = rendererData.useDepthStencilBuffer; // 3D Render Textures with depth/stencil buffer are not supported if (cameraData.targetTexture != null) allowDepth &= cameraData.targetTexture.dimension != TextureDimension.Tex3D; + // The back buffer has none when PlayerSettings.disableDepthAndStencilBuffers is enabled on a graphics API that acts on it + allowDepth &= Graphics.backBufferHasDepthStencil; + return allowDepth; } @@ -309,6 +313,7 @@ void CreateResources(RenderGraph renderGraph) // RTHandles do not support combining color and depth in the same texture so we create them separately m_CreateDepthTexture |= createColorTexture; + m_CreateDepthTexture &= IsDepthUsageAllowed(frameData, m_Renderer2DData); // Camera Target Color if (createColorTexture) @@ -374,9 +379,12 @@ void CreateResources(RenderGraph renderGraph) if (m_CreateColorTexture) { importSummary.cameraColorParams.discardOnLastUse = lastCameraInTheStack; - importSummary.cameraDepthParams.discardOnLastUse = lastCameraInTheStack; - commonResourceData.cameraColor = renderGraph.ImportTexture(currentRenderGraphCameraColorHandle, importSummary.cameraColorParams); + } + + if (m_CreateDepthTexture) + { + importSummary.cameraDepthParams.discardOnLastUse = lastCameraInTheStack; commonResourceData.cameraDepth = renderGraph.ImportTexture(m_RenderGraphCameraDepthHandle, importSummary.cameraDepthParams); } @@ -400,17 +408,21 @@ void CreateResources(RenderGraph renderGraph) RTHandleStaticHelpers.SetRTHandleUserManagedWrapper(ref m_RenderGraphBackbufferColorHandle, targetColorId); } - if (m_RenderGraphBackbufferDepthHandle == null) - { - m_RenderGraphBackbufferDepthHandle = RTHandles.Alloc(targetDepthId, "Backbuffer depth"); - } - else if (m_RenderGraphBackbufferDepthHandle.nameID != targetDepthId) + commonResourceData.backBufferColor = renderGraph.ImportTexture(m_RenderGraphBackbufferColorHandle, importSummary.importInfo, importSummary.backBufferColorParams); + + if (IsDepthUsageAllowed(frameData, m_Renderer2DData)) { - RTHandleStaticHelpers.SetRTHandleUserManagedWrapper(ref m_RenderGraphBackbufferDepthHandle, targetDepthId); - } + if (m_RenderGraphBackbufferDepthHandle == null) + { + m_RenderGraphBackbufferDepthHandle = RTHandles.Alloc(targetDepthId, "Backbuffer depth"); + } + else if (m_RenderGraphBackbufferDepthHandle.nameID != targetDepthId) + { + RTHandleStaticHelpers.SetRTHandleUserManagedWrapper(ref m_RenderGraphBackbufferDepthHandle, targetDepthId); + } - commonResourceData.backBufferColor = renderGraph.ImportTexture(m_RenderGraphBackbufferColorHandle, importSummary.importInfo, importSummary.backBufferColorParams); - commonResourceData.backBufferDepth = renderGraph.ImportTexture(m_RenderGraphBackbufferDepthHandle, importSummary.importInfoDepth, importSummary.backBufferDepthParams); + commonResourceData.backBufferDepth = renderGraph.ImportTexture(m_RenderGraphBackbufferDepthHandle, importSummary.importInfoDepth, importSummary.backBufferDepthParams); + } var postProcessDesc = PostProcessPass.GetCompatibleDescriptor(cameraTargetDescriptor, cameraTargetDescriptor.width, cameraTargetDescriptor.height, cameraTargetDescriptor.graphicsFormat); commonResourceData.afterPostProcessColor = UniversalRenderer.CreateRenderGraphTexture(renderGraph, postProcessDesc, "_AfterPostProcessTexture", true); @@ -427,11 +439,15 @@ void CreateCameraNormalsTextures(RenderGraph renderGraph, RenderTextureDescripto desc.graphicsFormat = RendererLighting.GetRenderTextureFormat(); desc.autoGenerateMips = false; desc.msaaSamples = descriptor.msaaSamples; + bool useNormals = false; for (int i = 0; i < resourceData.normalsTexture.Length; ++i) + { + useNormals |= m_LayerBatches[i].useNormals; resourceData.normalsTexture[i] = UniversalRenderer.CreateRenderGraphTexture(renderGraph, desc, "_NormalMap", true, RendererLighting.k_NormalClearColor); + } - if (IsDepthUsageAllowed(frameData, m_Renderer2DData)) + if (useNormals && IsDepthUsageAllowed(frameData, m_Renderer2DData)) { // Normals pass can reuse active depth if same dimensions, if not create a new depth texture #if !(ENABLE_VR && ENABLE_XR_MODULE) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs index d648934bca3..35f95726bd5 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/DrawScreenSpaceUIPass.cs @@ -235,7 +235,9 @@ internal void RenderOverlay(RenderGraph renderGraph, ContextContainer frameData, builder.UseAllGlobalTextures(true); builder.SetRenderAttachment(colorBuffer, 0); - builder.SetRenderAttachmentDepth(depthBuffer, AccessFlags.ReadWrite); + + if (depthBuffer.IsValid()) + builder.SetRenderAttachmentDepth(depthBuffer, AccessFlags.ReadWrite); passData.rendererList = renderGraph.CreateUIOverlayRendererList(cameraData.camera, UISubset.UIToolkit_UGUI); builder.UseRendererList(passData.rendererList); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs index 8e2d8ca9d88..1fdf6fa543c 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/Passes/RenderObjectsPass.cs @@ -288,7 +288,10 @@ public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer passData.color = resourceData.activeColorTexture; builder.SetRenderAttachment(resourceData.activeColorTexture, 0, AccessFlags.Write); if (cameraData.imageScalingMode != ImageScalingMode.Upscaling || passData.renderPassEvent != RenderPassEvent.AfterRenderingPostProcessing) - builder.SetRenderAttachmentDepth(resourceData.activeDepthTexture, AccessFlags.Write); + { + if (resourceData.activeDepthTexture.IsValid()) + builder.SetRenderAttachmentDepth(resourceData.activeDepthTexture, AccessFlags.Write); + } TextureHandle mainShadowsTexture = resourceData.mainShadowsTexture; TextureHandle additionalShadowsTexture = resourceData.additionalShadowsTexture; diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs index b31ab780e88..615b74ad7ba 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/ScriptableRenderer.cs @@ -1017,7 +1017,8 @@ internal void DrawRenderGraphGizmos(RenderGraph renderGraph, ContextContainer fr Profiling.drawGizmos)) { builder.UseTexture(color, AccessFlags.Write); - builder.UseTexture(depth, AccessFlags.ReadWrite); + if (depth.IsValid()) + builder.UseTexture(depth, AccessFlags.ReadWrite); passData.gizmoRenderList = renderGraph.CreateGizmoRendererList(cameraData.camera, gizmoSubset); passData.color = color; @@ -1029,7 +1030,10 @@ internal void DrawRenderGraphGizmos(RenderGraph renderGraph, ContextContainer fr { using (new ProfilingScope(rgContext.cmd, Profiling.drawGizmos)) { - rgContext.cmd.SetRenderTarget(data.color, data.depth); + if (data.depth.IsValid()) + rgContext.cmd.SetRenderTarget(data.color, data.depth); + else + rgContext.cmd.SetRenderTarget(data.color); rgContext.cmd.DrawRendererList(data.gizmoRenderList); } }); diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset index a5549566925..035b6545c71 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset @@ -26,6 +26,7 @@ MonoBehaviour: - {fileID: 11400000, guid: eae387d1d2a20a946ae2441e0319f1a0, type: 2} - {fileID: 11400000, guid: ab4527fe9ad5ef949bffe9447fabcfa2, type: 2} - {fileID: 11400000, guid: 01e79ba8f42c808448b7542939affccb, type: 2} + - {fileID: 11400000, guid: 47f3a0f49714d5f47948925871b58f11, type: 2} m_DefaultRendererIndex: 2 m_RequireDepthTexture: 0 m_RequireOpaqueTexture: 0 @@ -61,7 +62,6 @@ MonoBehaviour: m_AdditionalLightsShadowResolutionTierHigh: 512 m_ReflectionProbeBlending: 0 m_ReflectionProbeBoxProjection: 0 - m_ReflectionProbeAtlas: 1 m_ShadowDistance: 56 m_ShadowCascadeCount: 4 m_Cascade2Split: 0.25 @@ -138,7 +138,8 @@ MonoBehaviour: m_PrefilterScreenCoord: 0 m_PrefilterNativeRenderPass: 0 m_PrefilterUseLegacyLightmaps: 0 - m_PrefilterBicubicLightmapSampling: 0 + m_PrefilterReflectionProbeBlending: 0 + m_PrefilterReflectionProbeBoxProjection: 0 m_ShaderVariantLogLevel: 0 m_ShadowCascades: 3 m_Textures: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.meta new file mode 100644 index 00000000000..ee7194ae5df --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 482f5f7db6d987e429befdd7278a5d9c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity new file mode 100644 index 00000000000..cf14227b0ca --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:103c6c2281c4caec3a8fa7df1e2b0e3e6967c5b0f254502a0a000688903d64c0 +size 13028 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity.meta new file mode 100644 index 00000000000..b74731493a8 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e65c52bd72bcbed4d8916dfcf926bb4c +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset new file mode 100644 index 00000000000..c5dfdc96bd3 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset @@ -0,0 +1,103 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5415328978193341103 +MonoBehaviour: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 6b3d386ba5cd94485973aee1479b272e, type: 3} + m_Name: RenderObjects + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.RenderObjects + m_Active: 1 + settings: + passTag: RenderObjects + Event: 500 + filterSettings: + RenderQueueType: 1 + LayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + PassNames: [] + overrideMaterial: {fileID: 0} + overrideMaterialPassIndex: 0 + overrideShader: {fileID: 0} + overrideShaderPassIndex: 0 + overrideMode: 1 + overrideDepthState: 0 + depthCompareFunction: 4 + enableWrite: 1 + stencilSettings: + overrideStencilState: 0 + stencilReference: 0 + stencilReadMask: 15 + stencilWriteMask: 15 + stencilCompareFunction: 8 + passOperation: 0 + failOperation: 0 + zFailOperation: 0 + cameraSettings: + overrideCamera: 0 + restoreCamera: 1 + offset: {x: 0, y: 0, z: 0, w: 0} + cameraFieldOfView: 60 + depthInputAttachment: 0 +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11145981673336645838492a2d98e247, type: 3} + m_Name: 064_RenderObjectsFeature Renderer Data + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.2D.Runtime::UnityEngine.Rendering.Universal.Renderer2DData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: + - {fileID: -5415328978193341103} + m_RendererFeatureMap: 5125e868fce2d8b4l + m_LayerMask: + serializedVersion: 2 + m_Bits: 0 + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 1, z: 0} + m_HDREmulationScale: 1 + m_LightRenderTextureScale: 0.5 + m_LightBlendStyles: + - name: Multiply + maskTextureChannel: 0 + blendMode: 1 + - name: Additive + maskTextureChannel: 0 + blendMode: 0 + - name: Multiply with Mask + maskTextureChannel: 1 + blendMode: 1 + - name: Additive with Mask + maskTextureChannel: 1 + blendMode: 0 + m_UseDepthStencilBuffer: 0 + m_UseCameraSortingLayersTexture: 0 + m_CameraSortingLayersTextureBound: -1 + m_CameraSortingLayerDownsamplingMethod: 0 + m_MaxLightRenderTextureCount: 16 + m_MaxShadowRenderTextureCount: 1 + m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + m_DefaultMaterialType: 0 + m_DefaultCustomMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset.meta new file mode 100644 index 00000000000..756a3402a97 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/064_RenderObjectsRendererFeature/064_RenderObjectsFeature Renderer Data.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47f3a0f49714d5f47948925871b58f11 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs new file mode 100644 index 00000000000..d708515ed32 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs @@ -0,0 +1,197 @@ +using System.Collections; +using System.Collections.Generic; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEngine.Rendering.RenderGraphModule; +using UnityEngine.Rendering.Universal; +using UnityEngine.TestTools; + +// Verifies what the 2D renderer actually puts in the frame's resources when depth usage is disallowed: the +// back buffer depth must not be imported, and the rest of the frame must still record without errors (the +// overlay UI pass in particular reads UniversalResourceData.backBufferDepth and has to cope with it being +// invalid). +// +// A back buffer with no depth/stencil is not something a test can arrange - it is decided when the surface is +// created - so the disallowed case is driven here through the renderer's own "Depth/Stencil Buffer" setting, +// which reaches the exact same branch in Renderer2D.CreateRenderGraphCameraRenderTargets. The back buffer's own +// contribution to the decision is covered by Renderer2DDepthUsageTests. +// +// All of this is render graph territory: this project also runs its graphics tests in Compatibility Mode, where +// the pipeline builds the frame through the legacy Setup/Execute path and none of these resources exist, so the +// fixture skips itself there. +[TestFixture] +class Renderer2DBackbufferDepthTests +{ + const int k_Renderer2DIndex = 2; // 2D Renderer. See the list of Renderers in CommonAssets/UniversalRPAsset. + + readonly List m_DisabledCameras = new List(); + readonly BackbufferDepthProbePass m_ProbePass = new BackbufferDepthProbePass(); + + GameObject m_CameraObj; + Camera m_Camera; + UniversalAdditionalCameraData m_CameraData; + Renderer2DData m_RendererData; + bool m_PreviousUseDepthStencilBuffer; + + [SetUp] + public void SetUp() + { + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + { + Assert.Ignore("These tests only run when URP is the active render pipeline."); + return; + } + + // Under XR the renderer imports the XR-owned render target rather than the back buffer, so there is + // nothing to assert about the back buffer depth here. + if (XRGraphicsAutomatedTests.enabled) + { + Assert.Ignore("XR is active; the 2D renderer does not import the back buffer depth in that case."); + return; + } + + // In Compatibility Mode the pipeline runs the legacy Setup/Execute path instead of + // Renderer2D.CreateRenderGraphCameraRenderTargets, so the frame has no UniversalResourceData to probe and + // nothing here to assert. useRenderGraph is the flag the pipeline actually dispatches on: it is cached when + // the pipeline is created, so it can differ from RenderGraphSettings.enableRenderCompatibilityMode once + // RenderGraphGraphicsAutomatedTests.enabled has been flipped without recreating the pipeline - which is what + // the graphics test fixtures in this project do. + if (!UniversalRenderPipeline.useRenderGraph) + { + Assert.Ignore("Compatibility Mode (Render Graph disabled) is active; the 2D renderer does not build the frame's render graph resources."); + return; + } + + Assert.Greater(urpAsset.rendererDataList.Length, k_Renderer2DIndex, "The render pipeline asset no longer has a renderer at the 2D renderer index. Update this test to match."); + m_RendererData = urpAsset.rendererDataList[k_Renderer2DIndex] as Renderer2DData; + Assert.NotNull(m_RendererData, $"Renderer {k_Renderer2DIndex} of the render pipeline asset is not a 2D renderer. Update this test to match."); + m_PreviousUseDepthStencilBuffer = m_RendererData.useDepthStencilBuffer; + + // Frame isolation: only the test camera should render while the probe is installed. + foreach (var camera in Object.FindObjectsByType(FindObjectsInactive.Exclude, FindObjectsSortMode.None)) + { + if (!camera.enabled) + continue; + + camera.enabled = false; + m_DisabledCameras.Add(camera); + } + + m_CameraObj = new GameObject("Backbuffer Depth Test Camera"); + m_Camera = m_CameraObj.AddComponent(); + m_CameraData = m_CameraObj.AddComponent(); + + // Render straight to the back buffer: no target texture, no stack and no post-processing, so the + // renderer does not create intermediate targets. + m_Camera.targetTexture = null; + m_Camera.allowHDR = false; + m_CameraData.SetRenderer(k_Renderer2DIndex); + m_CameraData.renderType = CameraRenderType.Base; + m_CameraData.renderPostProcessing = false; + + RenderPipelineManager.beginCameraRendering += OnBeginCameraRendering; + } + + [TearDown] + public void TearDown() + { + RenderPipelineManager.beginCameraRendering -= OnBeginCameraRendering; + + if (m_RendererData != null) + Renderer2DDepthUsageTests.SetUseDepthStencilBuffer(m_RendererData, m_PreviousUseDepthStencilBuffer); + + if (m_CameraObj != null) + Object.DestroyImmediate(m_CameraObj); + + foreach (var camera in m_DisabledCameras) + { + if (camera != null) + camera.enabled = true; + } + m_DisabledCameras.Clear(); + } + + [UnityTest] + public IEnumerator BackbufferDepthIsImportedWhenDepthUsageIsAllowed() + { + Renderer2DDepthUsageTests.SetUseDepthStencilBuffer(m_RendererData, true); + + yield return RecordFrame(); + + // With the renderer setting on, the import follows the back buffer: there is nothing to import on a + // build where PlayerSettings.disableDepthAndStencilBuffers left it without a depth/stencil buffer. + Assert.AreEqual(Graphics.backBufferHasDepthStencil, m_ProbePass.backBufferDepthIsValid, + "The imported back buffer depth did not match whether the back buffer has a depth/stencil buffer."); + } + + [UnityTest] + public IEnumerator BackbufferDepthIsNotImportedWhenDepthUsageIsDisallowed() + { + Renderer2DDepthUsageTests.SetUseDepthStencilBuffer(m_RendererData, false); + + yield return RecordFrame(); + + Assert.IsFalse(m_ProbePass.backBufferDepthIsValid, "The 2D renderer imported the back buffer depth even though depth usage is disallowed."); + } + + [UnityTest] + public IEnumerator RenderingSucceedsWhenDepthUsageIsDisallowed() + { + Renderer2DDepthUsageTests.SetUseDepthStencilBuffer(m_RendererData, false); + + // Passes that read the back buffer depth - the overlay UI pass above all - must skip themselves rather + // than record against an invalid handle. Any error or exception they log fails this test. + yield return RecordFrame(); + yield return null; + } + + // Renders frames until the probe pass has recorded one with the current settings. + IEnumerator RecordFrame() + { + // The settings change lands on the next frame the renderer records, so drop the in-flight one first. + yield return null; + + m_ProbePass.Reset(); + yield return null; + + Assert.IsTrue(m_ProbePass.recorded, "The probe pass never recorded; the 2D renderer did not render the test camera."); + } + + void OnBeginCameraRendering(ScriptableRenderContext context, Camera camera) + { + if (camera != m_Camera) + return; + + m_CameraData.scriptableRenderer.EnqueuePass(m_ProbePass); + } + + // Reads the frame's back buffer depth handle at record time; it adds no render pass of its own. + class BackbufferDepthProbePass : ScriptableRenderPass + { + public bool recorded; + public bool backBufferDepthIsValid; + + public BackbufferDepthProbePass() + { + // The 2D renderer maps any event up to BeforeRenderingTransparents onto + // RenderPassEvent2D.BeforeRendering, which it records right after CreateResources - so the probe + // sees the back buffer depth as CreateResources left it. + renderPassEvent = RenderPassEvent.AfterRenderingOpaques; + } + + public void Reset() + { + recorded = false; + backBufferDepthIsValid = false; + } + + public override void RecordRenderGraph(RenderGraph renderGraph, ContextContainer frameData) + { + var resourceData = frameData.Get(); + + recorded = true; + backBufferDepthIsValid = resourceData.backBufferDepth.IsValid(); + } + } +} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs.meta new file mode 100644 index 00000000000..1a278427739 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DBackbufferDepthTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: cd25264fd81a45d1b14927bef89166c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs new file mode 100644 index 00000000000..669d1f79e4b --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs @@ -0,0 +1,137 @@ +using System.Reflection; +using NUnit.Framework; +using UnityEngine; +using UnityEngine.Experimental.Rendering; +using UnityEngine.Rendering; +using UnityEngine.Rendering.Universal; + +// Covers Renderer2D.IsDepthUsageAllowed, which decides whether the 2D renderer uses a depth/stencil buffer at +// all. It combines three conditions: the renderer's own "Depth/Stencil Buffer" setting, a 3D render texture +// target (which cannot carry depth/stencil), and whether the back buffer has a depth/stencil buffer. +// +// The renderer setting is driven here by writing Renderer2DData's serialized field. The back buffer's state is +// not something the test can set - it is decided when the surface is created, from +// PlayerSettings.disableDepthAndStencilBuffers on the graphics APIs that act on it - so expectations are +// stated against Graphics.backBufferHasDepthStencil, which is what that condition contributes wherever the +// test happens to run. That keeps every case meaningful in the editor and in player builds alike. +[TestFixture] +class Renderer2DDepthUsageTests +{ + const string k_UseDepthStencilBufferField = "m_UseDepthStencilBuffer"; + const int k_Renderer2DIndex = 2; // 2D Renderer. See the list of Renderers in CommonAssets/UniversalRPAsset. + + ContextContainer m_FrameData; + UniversalCameraData m_CameraData; + Renderer2DData m_RendererData; + RenderTexture m_TargetTexture; + bool m_PreviousUseDepthStencilBuffer; + + [SetUp] + public void SetUp() + { + // Use the pipeline asset's 2D renderer data rather than ScriptableObject.CreateInstance: a fresh instance + // has no light blend styles outside the editor (they are only built by editor-only code), and + // Renderer2DData.OnEnable dereferences them when URP_COMPATIBILITY_MODE is defined. + if (GraphicsSettings.currentRenderPipeline is not UniversalRenderPipelineAsset urpAsset) + { + Assert.Ignore("These tests only run when URP is the active render pipeline."); + return; + } + + Assert.Greater(urpAsset.rendererDataList.Length, k_Renderer2DIndex, "The render pipeline asset no longer has a renderer at the 2D renderer index. Update this test to match."); + m_RendererData = urpAsset.rendererDataList[k_Renderer2DIndex] as Renderer2DData; + Assert.NotNull(m_RendererData, $"Renderer {k_Renderer2DIndex} of the render pipeline asset is not a 2D renderer. Update this test to match."); + m_PreviousUseDepthStencilBuffer = m_RendererData.useDepthStencilBuffer; + + m_FrameData = new ContextContainer(); + m_CameraData = m_FrameData.Create(); + } + + [TearDown] + public void TearDown() + { + if (m_CameraData != null) + m_CameraData.targetTexture = null; + + if (m_TargetTexture != null) + { + m_TargetTexture.Release(); + Object.DestroyImmediate(m_TargetTexture); + m_TargetTexture = null; + } + + // The renderer data belongs to the pipeline asset, so restore it rather than destroy it. + if (m_RendererData != null) + SetUseDepthStencilBuffer(m_RendererData, m_PreviousUseDepthStencilBuffer); + + m_FrameData?.Dispose(); + } + + [Test] + public void IsDepthUsageAllowed_FollowsTheRendererDepthStencilBufferSetting([Values(false, true)] bool useDepthStencilBuffer) + { + SetUseDepthStencilBuffer(m_RendererData, useDepthStencilBuffer); + + bool expected = useDepthStencilBuffer && Graphics.backBufferHasDepthStencil; + + Assert.AreEqual(expected, Renderer2D.IsDepthUsageAllowed(m_FrameData, m_RendererData)); + } + + [Test] + public void IsDepthUsageAllowed_FollowsTheBackBufferDepthStencil() + { + // With every other condition asking for depth, the back buffer decides. A build with + // PlayerSettings.disableDepthAndStencilBuffers enabled on a graphics API that acts on it lands here + // with no depth/stencil; everywhere else, including the editor, the back buffer keeps one. + SetUseDepthStencilBuffer(m_RendererData, true); + + Assert.AreEqual(Graphics.backBufferHasDepthStencil, Renderer2D.IsDepthUsageAllowed(m_FrameData, m_RendererData)); + } + + [Test] + public void IsDepthUsageAllowed_IsNotVetoedBy2DRenderTextureTargets() + { + // Only 3D render textures veto depth; a 2D one leaves the decision to the other conditions. + SetUseDepthStencilBuffer(m_RendererData, true); + m_CameraData.targetTexture = CreateTargetTexture(TextureDimension.Tex2D); + + Assert.AreEqual(Graphics.backBufferHasDepthStencil, Renderer2D.IsDepthUsageAllowed(m_FrameData, m_RendererData)); + } + + [Test] + public void IsDepthUsageAllowed_IsNotAllowedFor3DRenderTextureTargets() + { + // 3D render textures cannot have a depth/stencil buffer, so this vetoes the decision on its own even + // with everything else asking for depth. + SetUseDepthStencilBuffer(m_RendererData, true); + m_CameraData.targetTexture = CreateTargetTexture(TextureDimension.Tex3D); + + Assert.IsFalse(Renderer2D.IsDepthUsageAllowed(m_FrameData, m_RendererData)); + } + + RenderTexture CreateTargetTexture(TextureDimension dimension) + { + var descriptor = new RenderTextureDescriptor(4, 4) + { + dimension = dimension, + volumeDepth = dimension == TextureDimension.Tex3D ? 4 : 1, + graphicsFormat = GraphicsFormat.R8G8B8A8_UNorm, + depthStencilFormat = GraphicsFormat.None, + msaaSamples = 1 + }; + + m_TargetTexture = new RenderTexture(descriptor); + return m_TargetTexture; + } + + // Renderer2DData.useDepthStencilBuffer is a read-only view of a serialized field, so the test has to write + // the field. Kept in one place so a rename fails loudly instead of silently skipping the condition. + internal static void SetUseDepthStencilBuffer(Renderer2DData rendererData, bool value) + { + var field = typeof(Renderer2DData).GetField(k_UseDepthStencilBufferField, BindingFlags.Instance | BindingFlags.NonPublic); + Assert.NotNull(field, $"{nameof(Renderer2DData)}.{k_UseDepthStencilBufferField} no longer exists. Update this test to match."); + + field.SetValue(rendererData, value); + Assert.AreEqual(value, rendererData.useDepthStencilBuffer, $"{nameof(Renderer2DData)}.{k_UseDepthStencilBufferField} is no longer what useDepthStencilBuffer returns. Update this test to match."); + } +} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs.meta new file mode 100644 index 00000000000..676971cf07c --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Test/Runtime/Renderer2DDepthUsageTests.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 28c6feeebd6a465fa9afb71cf4aa367d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 6b26b7a285c8c3f8ac80d9fbd797067e2e3e3889 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sun, 4 Oct 2026 06:30:07 +0000 Subject: [PATCH 10/18] [Port] [6000.0] Fix RenderTexture.Create failure on certain Android Vulkan devices --- .../PostProcessing/LensFlareCommonSRP.cs | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs b/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs index 0d8e0f248a0..511f6ea7ff3 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs +++ b/Packages/com.unity.render-pipelines.core/Runtime/PostProcessing/LensFlareCommonSRP.cs @@ -103,30 +103,47 @@ private LensFlareCommonSRP() { } - private static readonly bool s_SupportsLensFlare16bitsFormat = SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.Render); - private static readonly bool s_SupportsLensFlare32bitsFormat = SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render); + static readonly bool s_SupportsLensFlare16bitsFormat = SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.Render); + static readonly bool s_SupportsLensFlare32bitsFormat = SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.Render); + static readonly bool s_SupportsLensFlare16bitsFormatWithLoadStore = SystemInfo.IsFormatSupported(GraphicsFormat.R16_SFloat, GraphicsFormatUsage.LoadStore); + static readonly bool s_SupportsLensFlare32bitsFormatWithLoadStore = SystemInfo.IsFormatSupported(GraphicsFormat.R32_SFloat, GraphicsFormatUsage.LoadStore); - /// - /// Check if we can use an OcclusionRT - /// - /// return true if we can have the OcclusionRT - static public bool IsOcclusionRTCompatible() + // UUM-91313: Some Android Vulkan devices (Adreno 540) don't support R16_SFloat with GraphicsFormatUsage.LoadStore, + // which is required when creating a render texture with enableRandomWrite flag. Random writes are only needed by + // the merge step (compute shader using the texture as UAV), so we enable the flag only if merging is enabled. + static bool requireOcclusionRTRandomWrite => mergeNeeded > 0; + + static bool CheckOcclusionBasedOnDeviceType() { #if UNITY_SERVER return false; #else - return SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES3 && - SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLCore && - SystemInfo.graphicsDeviceType != GraphicsDeviceType.Null && - SystemInfo.graphicsDeviceType != GraphicsDeviceType.WebGPU && - (s_SupportsLensFlare16bitsFormat || s_SupportsLensFlare32bitsFormat); //Caching this, because SupportsRenderTextureFormat allocates memory. Go figure. + return SystemInfo.graphicsDeviceType != GraphicsDeviceType.Null && + SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLES3 && + SystemInfo.graphicsDeviceType != GraphicsDeviceType.OpenGLCore && + SystemInfo.graphicsDeviceType != GraphicsDeviceType.WebGPU; #endif } + /// + /// Check if we can create OcclusionRT texture to be used as render target + /// + /// Returns true if a supported format is found + public static bool IsOcclusionRTCompatible() + { + if (requireOcclusionRTRandomWrite) + { + return CheckOcclusionBasedOnDeviceType() && + (s_SupportsLensFlare16bitsFormatWithLoadStore || s_SupportsLensFlare32bitsFormatWithLoadStore); + } + return CheckOcclusionBasedOnDeviceType() && + (s_SupportsLensFlare16bitsFormat || s_SupportsLensFlare32bitsFormat); + } + static GraphicsFormat GetOcclusionRTFormat() { // SystemInfo.graphicsDeviceType == {GraphicsDeviceType.Direct3D12, GraphicsDeviceType.GameCoreXboxSeries, GraphicsDeviceType.XboxOneD3D12, GraphicsDeviceType.PlayStation5, ...} - if (s_SupportsLensFlare16bitsFormat) + if (requireOcclusionRTRandomWrite ? s_SupportsLensFlare16bitsFormatWithLoadStore : s_SupportsLensFlare16bitsFormat) return GraphicsFormat.R16_SFloat; else // Needed a R32_SFloat for Metal or/and DirectX < 11.3 @@ -150,8 +167,8 @@ static public void Initialize() width: maxLensFlareWithOcclusion, height: Mathf.Max(mergeNeeded * (maxLensFlareWithOcclusionTemporalSample + 1), 1), format: GetOcclusionRTFormat(), - slices: TextureXR.slices, - enableRandomWrite: true, + slices: TextureXR.slices, + enableRandomWrite: requireOcclusionRTRandomWrite, dimension: TextureDimension.Tex2DArray); } } From d5d28c42443ef3dd6b343252035e189f99cf9318 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 6 Oct 2026 00:33:51 +0000 Subject: [PATCH 11/18] [Port] [6000.0] [UUM-151723][7000.0] Fix camera sorting layer texture scaled by 2D Render Scale --- .../2D/Rendergraph/Renderer2DRendergraph.cs | 11 ++-- .../CommonAssets/UniversalRPAsset.asset | 1 + .../Assets/Scenes/019_CameraSortingLayer.meta | 8 +++ .../Scenes/019_CameraSortingLayer.unity | 3 + .../Scenes/019_CameraSortingLayer.unity.meta | 7 +++ .../019_CameraSortingLayer.asset | 57 +++++++++++++++++++ .../019_CameraSortingLayer.asset.meta | 8 +++ .../CameraSortingLayerShadergraph.shadergraph | 3 + ...raSortingLayerShadergraph.shadergraph.meta | 20 +++++++ 9 files changed, 111 insertions(+), 7 deletions(-) create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph.meta diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs index 355bc94e44d..2d3c7257625 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs @@ -300,7 +300,7 @@ void CreateResources(RenderGraph renderGraph) CreateShadowTextures(renderGraph, width, height); if (m_Renderer2DData.useCameraSortingLayerTexture) - CreateCameraSortingLayerTexture(renderGraph, cameraTargetDescriptor, width, height); + CreateCameraSortingLayerTexture(renderGraph, cameraTargetDescriptor); // Create the attachments if (cameraData.renderType == CameraRenderType.Base) // require intermediate textures @@ -510,15 +510,12 @@ void CreateShadowTextures(RenderGraph renderGraph, int width, int height) resourceData.shadowDepth = UniversalRenderer.CreateRenderGraphTexture(renderGraph, shadowDepthDesc, "_ShadowDepth", false, FilterMode.Bilinear); } - void CreateCameraSortingLayerTexture(RenderGraph renderGraph, RenderTextureDescriptor cameraDesc, int width, int height) + void CreateCameraSortingLayerTexture(RenderGraph renderGraph, RenderTextureDescriptor cameraDesc) { Universal2DResourceData resourceData = frameData.Get(); - var desc = new RenderTextureDescriptor(width, height); - desc.graphicsFormat = cameraDesc.graphicsFormat; - - CopyCameraSortingLayerPass.ConfigureDescriptor(m_Renderer2DData.cameraSortingLayerDownsamplingMethod, ref desc, out var filterMode); - RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraSortingLayerHandle, desc, filterMode, TextureWrapMode.Clamp, name: CopyCameraSortingLayerPass.k_CameraSortingLayerTexture); + CopyCameraSortingLayerPass.ConfigureDescriptor(m_Renderer2DData.cameraSortingLayerDownsamplingMethod, ref cameraDesc, out var filterMode); + RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraSortingLayerHandle, cameraDesc, filterMode, TextureWrapMode.Clamp, name: CopyCameraSortingLayerPass.k_CameraSortingLayerTexture); resourceData.cameraSortingLayerTexture = renderGraph.ImportTexture(m_CameraSortingLayerHandle); } diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset index 035b6545c71..d45b9e0e1fe 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/CommonAssets/UniversalRPAsset.asset @@ -27,6 +27,7 @@ MonoBehaviour: - {fileID: 11400000, guid: ab4527fe9ad5ef949bffe9447fabcfa2, type: 2} - {fileID: 11400000, guid: 01e79ba8f42c808448b7542939affccb, type: 2} - {fileID: 11400000, guid: 47f3a0f49714d5f47948925871b58f11, type: 2} + - {fileID: 11400000, guid: 039e24411cea2f6498a6a0733989ae55, type: 2} m_DefaultRendererIndex: 2 m_RequireDepthTexture: 0 m_RequireOpaqueTexture: 0 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.meta new file mode 100644 index 00000000000..243ad472167 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8301aaa07078a7948bc53346a2460432 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity new file mode 100644 index 00000000000..3b228169351 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9af5872da29e4611d3f136f6e78cec328b649b59613184bb1d67bf2b8492f2d +size 15351 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity.meta new file mode 100644 index 00000000000..aabc3170314 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0e9e40b7c057ccd428e42df5b831425f +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset new file mode 100644 index 00000000000..fc160328dcf --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset @@ -0,0 +1,57 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 11145981673336645838492a2d98e247, type: 3} + m_Name: 019_CameraSortingLayer + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.2D.Runtime::UnityEngine.Rendering.Universal.Renderer2DData + debugShaders: + debugReplacementPS: {fileID: 4800000, guid: cf852408f2e174538bcd9b7fda1c5ae7, type: 3} + hdrDebugViewPS: {fileID: 4800000, guid: 573620ae32aec764abd4d728906d2587, type: 3} + probeVolumeSamplingDebugComputeShader: {fileID: 7200000, guid: 53626a513ea68ce47b59dc1299fe3959, type: 3} + probeVolumeResources: + probeVolumeDebugShader: {fileID: 0} + probeVolumeFragmentationDebugShader: {fileID: 0} + probeVolumeOffsetDebugShader: {fileID: 0} + probeVolumeSamplingDebugShader: {fileID: 0} + probeSamplingDebugMesh: {fileID: 0} + probeSamplingDebugTexture: {fileID: 0} + probeVolumeBlendStatesCS: {fileID: 0} + m_RendererFeatures: [] + m_RendererFeatureMap: + m_LayerMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 1, z: 0} + m_HDREmulationScale: 1 + m_LightRenderTextureScale: 1 + m_LightBlendStyles: + - name: Multiply + maskTextureChannel: 0 + blendMode: 1 + - name: Additive + maskTextureChannel: 0 + blendMode: 0 + - name: Multiply with Mask + maskTextureChannel: 1 + blendMode: 1 + - name: Additive with Mask + maskTextureChannel: 1 + blendMode: 0 + m_UseDepthStencilBuffer: 1 + m_UseCameraSortingLayersTexture: 1 + m_CameraSortingLayersTextureBound: -538112021 + m_CameraSortingLayerDownsamplingMethod: 0 + m_MaxLightRenderTextureCount: 16 + m_MaxShadowRenderTextureCount: 1 + m_PostProcessData: {fileID: 11400000, guid: 41439944d30ece34e96484bdb6645b55, type: 2} + m_DefaultMaterialType: 0 + m_DefaultCustomMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset.meta new file mode 100644 index 00000000000..948d4ad539f --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/019_CameraSortingLayer.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 039e24411cea2f6498a6a0733989ae55 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph new file mode 100644 index 00000000000..8c3b52b7e6f --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5d7e24e9ff0e6eac80adcd7d76fc69795ba276d867590945b9b29a38d85bf83 +size 20658 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph.meta new file mode 100644 index 00000000000..342aaff336b --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/019_CameraSortingLayer/CameraSortingLayerShadergraph.shadergraph.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 58348bacb03e6f248929a95f2514d1a3 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} + useAsTemplate: 0 + exposeTemplateAsShader: 0 + indexedData: {instanceID: 0} + template: + name: + category: + description: + icon: {instanceID: 0} + thumbnail: {instanceID: 0} + order: 0 From eacce6e84e35dbbe30d724778d58c5f5679b159c Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 6 Oct 2026 09:06:15 +0000 Subject: [PATCH 12/18] [Port] [6000.0] [URP] [2D] [UUM-145892][7000.0] Fix intermediate texture not created when requested by render pass --- .../Runtime/2D/Renderer2D.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs index af150f75383..588e6017d2e 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Renderer2D.cs @@ -183,6 +183,7 @@ private RenderPassInputSummary GetRenderPassInputs(UniversalCameraData cameraDat inputSummary.requiresDepthTexture |= needsDepth; inputSummary.requiresColorTexture |= needsColor; + inputSummary.requiresColorTexture |= pass.requiresIntermediateTexture; } inputSummary.requiresColorTexture |= cameraData.postProcessEnabled From a6102da72398a88c403606a14adb6370ee0a0a02 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 6 Oct 2026 09:06:15 +0000 Subject: [PATCH 13/18] [Port] [6000.0] [UUM-147747][UUM-148111][7000.0] Fix LineRenderer shader properties not set up on activation --- .../2D/Rendergraph/Renderer2DRendergraph.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs index 2d3c7257625..7b1b03a7cca 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Rendergraph/Renderer2DRendergraph.cs @@ -10,13 +10,16 @@ internal sealed partial class Renderer2D : ScriptableRenderer // TODO RENDERGRAPH: Once all cameras will run in a single RenderGraph we should remove all RTHandles and use per frame RG textures. // We use 2 camera color handles so we can handle the edge case when a pass might want to read and write the same target. // This is not allowed so we just swap the current target, this keeps camera stacking working and avoids an extra blit pass. - static int m_CurrentColorHandle = 0; + static int s_CurrentColorHandle = 0; RTHandle[] m_RenderGraphCameraColorHandles = new RTHandle[] { null, null }; - RTHandle m_RenderGraphCameraDepthHandle; + // Shared across all Renderer2D instances. An overlay camera can be rendered by a different + // Renderer2D than its base camera, so keeping a per-instance copy of the base camera's handle + // leaves the overlay pointing at a stale attachment once the base camera reallocates it. + static RTHandle s_RenderGraphCameraDepthHandle; RTHandle m_RenderGraphBackbufferColorHandle; RTHandle m_RenderGraphBackbufferDepthHandle; RTHandle m_CameraSortingLayerHandle; @@ -47,7 +50,7 @@ private RTHandle currentRenderGraphCameraColorHandle { get { - return m_RenderGraphCameraColorHandles[m_CurrentColorHandle]; + return m_RenderGraphCameraColorHandles[s_CurrentColorHandle]; } } @@ -56,7 +59,7 @@ private RTHandle nextRenderGraphCameraColorHandle { get { - m_CurrentColorHandle = (m_CurrentColorHandle + 1) % 2; + s_CurrentColorHandle = (s_CurrentColorHandle + 1) % 2; return currentRenderGraphCameraColorHandle; } } @@ -351,7 +354,7 @@ void CreateResources(RenderGraph renderGraph) depthDescriptor.graphicsFormat = GraphicsFormat.None; depthDescriptor.depthStencilFormat = CoreUtils.GetDefaultDepthStencilFormat(); - RenderingUtils.ReAllocateHandleIfNeeded(ref m_RenderGraphCameraDepthHandle, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); + RenderingUtils.ReAllocateHandleIfNeeded(ref s_RenderGraphCameraDepthHandle, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); commonResourceData.activeDepthID = ActiveID.Camera; } else @@ -363,7 +366,6 @@ void CreateResources(RenderGraph renderGraph) var baseRenderer = (Renderer2D)baseCameraData.scriptableRenderer; m_RenderGraphCameraColorHandles = baseRenderer.m_RenderGraphCameraColorHandles; - m_RenderGraphCameraDepthHandle = baseRenderer.m_RenderGraphCameraDepthHandle; m_RenderGraphBackbufferColorHandle = baseRenderer.m_RenderGraphBackbufferColorHandle; m_RenderGraphBackbufferDepthHandle = baseRenderer.m_RenderGraphBackbufferDepthHandle; @@ -385,7 +387,7 @@ void CreateResources(RenderGraph renderGraph) if (m_CreateDepthTexture) { importSummary.cameraDepthParams.discardOnLastUse = lastCameraInTheStack; - commonResourceData.cameraDepth = renderGraph.ImportTexture(m_RenderGraphCameraDepthHandle, importSummary.cameraDepthParams); + commonResourceData.cameraDepth = renderGraph.ImportTexture(s_RenderGraphCameraDepthHandle, importSummary.cameraDepthParams); } RenderTargetIdentifier targetColorId = cameraData.targetTexture != null ? new RenderTargetIdentifier(cameraData.targetTexture) : BuiltinRenderTextureType.CameraTarget; @@ -872,7 +874,7 @@ private void CleanupRenderGraphResources() { m_RenderGraphCameraColorHandles[0]?.Release(); m_RenderGraphCameraColorHandles[1]?.Release(); - m_RenderGraphCameraDepthHandle?.Release(); + s_RenderGraphCameraDepthHandle?.Release(); m_RenderGraphBackbufferColorHandle?.Release(); m_RenderGraphBackbufferDepthHandle?.Release(); m_CameraSortingLayerHandle?.Release(); From cf04cb6337eafda828005a57c246ab5ca1d2faa9 Mon Sep 17 00:00:00 2001 From: Samuel Allan Siltanen Date: Fri, 9 Oct 2026 00:27:03 +0000 Subject: [PATCH 14/18] [6000.0] [UUM-117369] [URP] Revert DX11-only copy of _CameraDepthAttachment in Compatibility Mode --- .../Runtime/UniversalRenderer.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs index 0da0636a2b6..f85b88bdeba 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderer.cs @@ -143,7 +143,6 @@ protected internal override bool SupportsCameraNormals() RTHandle m_ColorFrontBuffer; internal RTHandle m_ActiveCameraDepthAttachment; internal RTHandle m_CameraDepthAttachment; - internal RTHandle m_CameraDepthAttachment_D3d_11; RTHandle m_TargetColorHandle; RTHandle m_TargetDepthHandle; internal RTHandle m_DepthTexture; @@ -451,7 +450,6 @@ internal override void ReleaseRenderTargets() m_AdditionalLightsShadowCasterPass?.Dispose(); m_CameraDepthAttachment?.Release(); - m_CameraDepthAttachment_D3d_11?.Release(); m_DepthTexture?.Release(); m_NormalsTexture?.Release(); m_DecalLayersTexture?.Release(); @@ -994,9 +992,6 @@ public override void Setup(ScriptableRenderContext context, ref RenderingData re // Assign camera targets (color and depth) ConfigureCameraTarget(m_ActiveCameraColorAttachment, m_ActiveCameraDepthAttachment); - if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) - cmd.CopyTexture(m_CameraDepthAttachment, m_CameraDepthAttachment_D3d_11); - bool hasPassesAfterPostProcessing = activeRenderPassQueue.Find(x => x.renderPassEvent == RenderPassEvent.AfterRenderingPostProcessing) != null; if (mainLightShadows) @@ -1832,14 +1827,7 @@ void CreateCameraRenderTarget(ScriptableRenderContext context, ref RenderTexture depthDescriptor.graphicsFormat = GraphicsFormat.None; depthDescriptor.depthStencilFormat = cameraDepthAttachmentFormat; RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraDepthAttachment, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment"); - - if (SystemInfo.graphicsDeviceType == GraphicsDeviceType.Direct3D11) - { - RenderingUtils.ReAllocateHandleIfNeeded(ref m_CameraDepthAttachment_D3d_11, depthDescriptor, FilterMode.Point, TextureWrapMode.Clamp, name: "_CameraDepthAttachment_Temp"); - cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment_D3d_11.nameID); - } - else - cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); + cmd.SetGlobalTexture(m_CameraDepthAttachment.name, m_CameraDepthAttachment.nameID); // update the descriptor to match the depth attachment descriptor.depthStencilFormat = depthDescriptor.depthStencilFormat; From 446c01ff8083311232dec0c39a8c66d7239b9ef6 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Mon, 12 Oct 2026 19:56:14 +0000 Subject: [PATCH 15/18] [Port] [6000.0] [UUM-144935][7000.0] Rename Resources folder to ResourceIcons so editor only resources do not get included in build --- .../Editor/2D/Light2DEditor.cs | 43 +++++--- .../Editor/2D/Light2DEditorUtility.cs | 2 + .../2D/{Resources.meta => ResourceIcons.meta} | 2 +- .../Cinemachine.png | 0 .../Cinemachine.png.meta | 0 .../InspectorIcons.meta | 0 .../InspectorIcons/FreeformLight.png | 0 .../InspectorIcons/FreeformLight.png.meta | 0 .../InspectorIcons/GlobalLight.png | 0 .../InspectorIcons/GlobalLight.png.meta | 0 .../InspectorIcons/ParametricLight.png | 0 .../InspectorIcons/ParametricLight.png.meta | 0 .../InspectorIcons/PointLight.png | 0 .../InspectorIcons/PointLight.png.meta | 0 .../InspectorIcons/SpriteLight.png | 0 .../InspectorIcons/SpriteLight.png.meta | 0 .../LightCapBottomLeft.png | 0 .../LightCapBottomLeft.png.meta | 0 .../LightCapBottomRight.png | 0 .../LightCapBottomRight.png.meta | 0 .../LightCapDown.png | 0 .../LightCapDown.png.meta | 0 .../LightCapTopLeft.png | 0 .../LightCapTopLeft.png.meta | 0 .../LightCapTopRight.png | 0 .../LightCapTopRight.png.meta | 0 .../LightCapUp.png | 0 .../LightCapUp.png.meta | 0 .../PixelPerfectCamera.png | 0 .../PixelPerfectCamera.png.meta | 0 .../SceneViewIcons.meta | 0 .../SceneViewIcons/FreeformLight.png | 0 .../SceneViewIcons/FreeformLight.png.meta | 0 .../SceneViewIcons/GlobalLight.png | 0 .../SceneViewIcons/GlobalLight.png.meta | 0 .../SceneViewIcons/ParametricLight.png | 0 .../SceneViewIcons/ParametricLight.png.meta | 0 .../SceneViewIcons/PointLight.png | 0 .../SceneViewIcons/PointLight.png.meta | 0 .../SceneViewIcons/SpriteLight.png | 0 .../SceneViewIcons/SpriteLight.png.meta | 0 .../Editor/2D/Resources/Sparkle.png | 3 - .../Editor/2D/Resources/Sparkle.png.meta | 98 ------------------- .../Runtime/2D/Light2DAuthoring.cs | 2 +- .../Runtime/2D/PixelPerfectCamera.cs | 1 + .../018_PointLightCookie_Compatibility.unity | 2 +- .../Assets/Scenes/023_GizmosRendering.meta | 8 ++ .../Assets/Scenes/023_GizmosRendering.unity | 3 + .../Scenes/023_GizmosRendering.unity.meta | 7 ++ .../023_GizmosRendering/ToggleGizmos.cs | 22 +++++ .../023_GizmosRendering/ToggleGizmos.cs.meta | 2 + 51 files changed, 76 insertions(+), 119 deletions(-) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources.meta => ResourceIcons.meta} (77%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/Cinemachine.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/Cinemachine.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/FreeformLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/FreeformLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/GlobalLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/GlobalLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/ParametricLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/ParametricLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/PointLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/PointLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/SpriteLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/InspectorIcons/SpriteLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapBottomLeft.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapBottomLeft.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapBottomRight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapBottomRight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapDown.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapDown.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapTopLeft.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapTopLeft.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapTopRight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapTopRight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapUp.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/LightCapUp.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/PixelPerfectCamera.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/PixelPerfectCamera.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/FreeformLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/FreeformLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/GlobalLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/GlobalLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/ParametricLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/ParametricLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/PointLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/PointLight.png.meta (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/SpriteLight.png (100%) rename Packages/com.unity.render-pipelines.universal/Editor/2D/{Resources => ResourceIcons}/SceneViewIcons/SpriteLight.png.meta (100%) delete mode 100644 Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png delete mode 100644 Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity.meta create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs create mode 100644 Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs index d990442ce4b..80d39d3fd02 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditor.cs @@ -5,7 +5,6 @@ using UnityEngine; using UnityEngine.Rendering.Universal; - namespace UnityEditor.Rendering.Universal { [CustomEditor(typeof(Light2D))] @@ -53,20 +52,34 @@ private static class Styles { public static readonly GUIContent InnerOuterSpotAngle = EditorGUIUtility.TrTextContent("Inner / Outer Spot Angle", "Adjusts the inner / outer angles of this light to change the angle ranges of this Spot Light’s beam."); - public static Texture lightCapTopRight = Resources.Load("LightCapTopRight"); - public static Texture lightCapTopLeft = Resources.Load("LightCapTopLeft"); - public static Texture lightCapBottomLeft = Resources.Load("LightCapBottomLeft"); - public static Texture lightCapBottomRight = Resources.Load("LightCapBottomRight"); - public static Texture lightCapUp = Resources.Load("LightCapUp"); - public static Texture lightCapDown = Resources.Load("LightCapDown"); - - - public static GUIContent lightTypeFreeform = new GUIContent("Freeform", Resources.Load("InspectorIcons/FreeformLight") as Texture); - public static GUIContent lightTypeSprite = new GUIContent("Sprite", Resources.Load("InspectorIcons/SpriteLight") as Texture); - public static GUIContent lightTypePoint = new GUIContent("Spot", Resources.Load("InspectorIcons/PointLight") as Texture); - public static GUIContent lightTypeGlobal = new GUIContent("Global", Resources.Load("InspectorIcons/GlobalLight") as Texture); - public static GUIContent[] lightTypeOptions = new GUIContent[] { lightTypeFreeform, lightTypeSprite, lightTypePoint, lightTypeGlobal }; - + static Texture s_LightCapTopRight; + static Texture s_LightCapTopLeft; + static Texture s_LightCapBottomLeft; + static Texture s_LightCapBottomRight; + static Texture s_LightCapUp; + static Texture s_LightCapDown; + + public static Texture lightCapTopRight => s_LightCapTopRight ??= LoadIcon("LightCapTopRight.png"); + public static Texture lightCapTopLeft => s_LightCapTopLeft ??= LoadIcon("LightCapTopLeft.png"); + public static Texture lightCapBottomLeft => s_LightCapBottomLeft ??= LoadIcon("LightCapBottomLeft.png"); + public static Texture lightCapBottomRight => s_LightCapBottomRight ??= LoadIcon("LightCapBottomRight.png"); + public static Texture lightCapUp => s_LightCapUp ??= LoadIcon("LightCapUp.png"); + public static Texture lightCapDown => s_LightCapDown ??= LoadIcon("LightCapDown.png"); + + static GUIContent s_LightTypeFreeform; + static GUIContent s_LightTypeSprite; + static GUIContent s_LightTypePoint; + static GUIContent s_LightTypeGlobal; + static GUIContent[] s_LightTypeOptions; + + public static GUIContent lightTypeFreeform => s_LightTypeFreeform ??= new GUIContent("Freeform", LoadInspectorIcon("FreeformLight.png")); + public static GUIContent lightTypeSprite => s_LightTypeSprite ??= new GUIContent("Sprite", LoadInspectorIcon("SpriteLight.png")); + public static GUIContent lightTypePoint => s_LightTypePoint ??= new GUIContent("Spot", LoadInspectorIcon("PointLight.png")); + public static GUIContent lightTypeGlobal => s_LightTypeGlobal ??= new GUIContent("Global", LoadInspectorIcon("GlobalLight.png")); + public static GUIContent[] lightTypeOptions => s_LightTypeOptions ??= new GUIContent[] { lightTypeFreeform, lightTypeSprite, lightTypePoint, lightTypeGlobal }; + + static Texture LoadIcon(string fileName) => AssetDatabase.LoadAssetAtPath(Light2DEditorUtility.ResourcePath + fileName); + static Texture LoadInspectorIcon(string fileName) => LoadIcon("InspectorIcons/" + fileName); public static GUIContent blendingSettingsFoldout = EditorGUIUtility.TrTextContent("Blending", "Options used for blending"); public static GUIContent shadowsSettingsFoldout = EditorGUIUtility.TrTextContent("Shadows", "Options used for shadows"); diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs index 82fde669b49..3c5a983ba9d 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Light2DEditorUtility.cs @@ -6,6 +6,8 @@ namespace UnityEditor.Rendering.Universal { internal static class Light2DEditorUtility { + internal static readonly string ResourcePath = "Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/"; + static Material s_TexCapMaterial = CoreUtils.CreateEngineMaterial(Shader.Find("Hidden/Internal-GUITexture")); static Mesh k_MeshQuad_Cache; static Mesh k_MeshQuad => k_MeshQuad_Cache == null || k_MeshQuad_Cache.Equals(null) ? (k_MeshQuad_Cache = Resources.GetBuiltinResource("Quad.fbx")) : k_MeshQuad_Cache; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons.meta similarity index 77% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons.meta index 23f7cdf8421..9929c29554c 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources.meta +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 95000b81b3fc6af4a916987efa80abbc +guid: 7d62522e622aeff4aad818e5a3124efd folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Cinemachine.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/Cinemachine.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Cinemachine.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/Cinemachine.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Cinemachine.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/Cinemachine.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Cinemachine.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/Cinemachine.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/FreeformLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/FreeformLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/FreeformLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/FreeformLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/FreeformLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/FreeformLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/FreeformLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/FreeformLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/GlobalLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/GlobalLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/GlobalLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/GlobalLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/GlobalLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/GlobalLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/GlobalLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/GlobalLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/ParametricLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/ParametricLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/ParametricLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/ParametricLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/ParametricLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/ParametricLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/ParametricLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/ParametricLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/PointLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/PointLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/PointLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/PointLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/SpriteLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/SpriteLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/SpriteLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/SpriteLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/SpriteLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/SpriteLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/SpriteLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/InspectorIcons/SpriteLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomLeft.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomLeft.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomLeft.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomLeft.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomLeft.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomLeft.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomLeft.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomLeft.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomRight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomRight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomRight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomRight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomRight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomRight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapBottomRight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapBottomRight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapDown.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapDown.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapDown.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapDown.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapDown.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapDown.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapDown.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapDown.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopLeft.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopLeft.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopLeft.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopLeft.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopLeft.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopLeft.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopLeft.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopLeft.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopRight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopRight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopRight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopRight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopRight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopRight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapTopRight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapTopRight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapUp.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapUp.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapUp.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapUp.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapUp.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapUp.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/LightCapUp.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/LightCapUp.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/PixelPerfectCamera.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/PixelPerfectCamera.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/PixelPerfectCamera.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/PixelPerfectCamera.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/PixelPerfectCamera.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/PixelPerfectCamera.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/PixelPerfectCamera.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/PixelPerfectCamera.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/FreeformLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/FreeformLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/FreeformLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/FreeformLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/FreeformLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/FreeformLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/FreeformLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/FreeformLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/GlobalLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/GlobalLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/GlobalLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/GlobalLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/GlobalLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/GlobalLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/GlobalLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/GlobalLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/ParametricLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/ParametricLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/ParametricLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/ParametricLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/ParametricLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/ParametricLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/ParametricLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/ParametricLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/PointLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/PointLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/PointLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/PointLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/PointLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/PointLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/PointLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/PointLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/SpriteLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/SpriteLight.png similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/SpriteLight.png rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/SpriteLight.png diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/SpriteLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/SpriteLight.png.meta similarity index 100% rename from Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/SpriteLight.png.meta rename to Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/SpriteLight.png.meta diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png deleted file mode 100644 index eea0b6e897b..00000000000 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2432c4016903df7a0bd7b9cf422341c4a8d62049d8f41aa68507793b45352c92 -size 3250 diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png.meta deleted file mode 100644 index 4d78d5903a0..00000000000 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/Sparkle.png.meta +++ /dev/null @@ -1,98 +0,0 @@ -fileFormatVersion: 2 -guid: 4a0aca3a5f2effb41b43cc0a1661d845 -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: -1 - aniso: -1 - mipBias: -100 - wrapU: 1 - wrapV: 1 - wrapW: 1 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 1 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - spriteGenerateDepthMesh: 0 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - shadowShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DAuthoring.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DAuthoring.cs index 44b94d6d8e8..7ce0ac31763 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DAuthoring.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Light2DAuthoring.cs @@ -5,7 +5,7 @@ namespace UnityEngine.Rendering.Universal public sealed partial class Light2D { #if UNITY_EDITOR - private const string s_IconsPath = "Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/SceneViewIcons/"; + private const string s_IconsPath = "Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/SceneViewIcons/"; private static readonly string[] s_LightIconFileNames = new[] { "ParametricLight.png", diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs index 5653197fca1..e8c81b48812 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/PixelPerfectCamera.cs @@ -10,6 +10,7 @@ namespace UnityEngine.Rendering.Universal [AddComponentMenu("Rendering/2D/Pixel Perfect Camera")] [RequireComponent(typeof(Camera))] [MovedFrom(true, "UnityEngine.Experimental.Rendering.Universal")] + [Icon("Packages/com.unity.render-pipelines.universal/Editor/2D/ResourceIcons/PixelPerfectCamera.png")] [HelpURL("https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html?subfolder=/manual/2d-pixelperfect.html%23properties")] public class PixelPerfectCamera : MonoBehaviour, IPixelPerfectCamera, ISerializationCallbackReceiver { diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/018_PointLightCookie_Compatibility.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/018_PointLightCookie_Compatibility.unity index 65e68306539..bff8b232465 100644 --- a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/018_PointLightCookie_Compatibility.unity +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/018_PointLightCookie_Compatibility.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:464c8b7302e9f4fd234253abc9a81828c5e2739c496e115f100e8b8f170593fd +oid sha256:50cc9e4ae59b0b707b650b317d32c99c1f93ee98c4e6df80b25e8b6e72b1dc0e size 13182 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.meta new file mode 100644 index 00000000000..b74e0d5d78b --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1fe0ed64202450440a509c37c4420736 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity new file mode 100644 index 00000000000..64f494696a8 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d451315709bc46a21b2712a81e2f133cf13900b5d5862a2b8cfc3b4e9f6913e +size 25498 diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity.meta new file mode 100644 index 00000000000..0d15e1db9cb --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 8428147f42bae7241bba86207b956ad7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs new file mode 100644 index 00000000000..e1e6820c2eb --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs @@ -0,0 +1,22 @@ +using UnityEngine; + +#if UNITY_EDITOR +using UnityEditorInternal; +#endif + +public class ToggleGizmos : MonoBehaviour +{ + private void OnEnable() + { +#if UNITY_EDITOR + InternalEditorUtility.SetShowGizmos(true); +#endif + } + + private void OnDisable() + { +#if UNITY_EDITOR + InternalEditorUtility.SetShowGizmos(false); +#endif + } +} diff --git a/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs.meta b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs.meta new file mode 100644 index 00000000000..ce0202aae28 --- /dev/null +++ b/Tests/SRPTests/Projects/UniversalGraphicsTest_2D/Assets/Scenes/023_GizmosRendering/ToggleGizmos.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 06bd12fbea11bcf4c8fbd8a476119a59 \ No newline at end of file From 3f8ad0be2c3975981c9fe4c65058f44aea959b0b Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Wed, 14 Oct 2026 06:25:24 +0000 Subject: [PATCH 16/18] [Port] [6000.0] [HDRP] Fix dark outline on geometry with MSAA and cloud layer --- .../HDRenderPipeline.RenderGraph.cs | 7 ++- .../ShaderLibrary/CopyDepthBuffer.shader | 53 +++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs index 90794cc86f6..b92d2997487 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs @@ -700,6 +700,7 @@ class CopyXRDepthPassData public TextureHandle output; public Vector2 blitScaleBias; public bool flipY; + public int passIndex; } void CopyDepth(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBuffer, TextureHandle output, bool copyForXR) @@ -714,6 +715,8 @@ void CopyDepth(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBu passData.blitScaleBias = copyForXR ? new Vector2(hdCamera.actualWidth / hdCamera.finalViewport.width, hdCamera.actualHeight / hdCamera.finalViewport.height) : RTHandles.rtHandleProperties.rtHandleScale; passData.flipY = copyForXR; + passData.passIndex = renderGraph.GetTextureDesc(depthBuffer).msaaSamples != MSAASamples.None ? 1 : 0; + Debug.Assert(!(copyForXR && passData.passIndex != 0), "MSAA depth copies do not support XR scaling and Y-flipping."); builder.SetRenderFunc( (CopyXRDepthPassData data, RenderGraphContext ctx) => @@ -724,7 +727,7 @@ void CopyDepth(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthBu mpb.SetVector(HDShaderIDs._BlitScaleBias, data.blitScaleBias); mpb.SetInt(HDShaderIDs._FlipY, data.flipY ? 1 : 0); - CoreUtils.DrawFullScreen(ctx.cmd, data.copyDepth, mpb); + CoreUtils.DrawFullScreen(ctx.cmd, data.copyDepth, mpb, data.passIndex); }); } } @@ -1587,7 +1590,7 @@ TransparentPrepassOutput RenderTransparentPrepass(RenderGraph renderGraph, Culli renderQueueRange: GetTransparentRenderQueueRange(hdCamera, false))); // Copy depth buffer for refraction - CopyDepth(renderGraph, hdCamera, prepassOutput.resolvedDepthBuffer, output.depthBufferPreRefraction, false); + CopyDepth(renderGraph, hdCamera, prepassOutput.depthBuffer, output.depthBufferPreRefraction, false); if (hasWater) { diff --git a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader index 6450e147eeb..961aa0a2b44 100644 --- a/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader +++ b/Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/CopyDepthBuffer.shader @@ -76,6 +76,59 @@ Shader "Hidden/HDRP/CopyDepthBuffer" ENDHLSL } + + Pass + { + Name "Copy Depth MSAA" + + Cull Off + ZTest Always + ZWrite On + Blend Off + ColorMask 0 + + HLSLPROGRAM + #pragma target 4.5 + #pragma editor_sync_compilation + #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch switch2 + #pragma fragment Frag + #pragma vertex Vert + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" + #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl" + + TEXTURE2D_X_MSAA(float, _InputDepthTexture); + + struct Attributes + { + uint vertexID : SV_VertexID; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_Position; + UNITY_VERTEX_OUTPUT_STEREO + }; + + Varyings Vert(Attributes input) + { + Varyings output; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + output.positionCS = GetFullScreenTriangleVertexPosition(input.vertexID); + return output; + } + + // SV_SampleIndex forces per-sample execution so each sample of the destination gets its own source sample. + float Frag(Varyings input, uint sampleIndex : SV_SampleIndex) : SV_Depth + { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + return LOAD_TEXTURE2D_X_MSAA(_InputDepthTexture, int2(input.positionCS.xy), sampleIndex).x; + } + + ENDHLSL + } } Fallback Off } From 6cdaf94cc9caea0f7159b0f5fee4f7293b2f97ed Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Sat, 17 Oct 2026 05:41:13 +0000 Subject: [PATCH 17/18] [Port] [6000.0] Fix speckles/white spots with APV --- .../Lighting/ProbeVolume/ProbeVolume.hlsl | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl index a6aa8090f27..d559552619e 100644 --- a/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl +++ b/Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl @@ -279,11 +279,8 @@ bool LoadCellIndexMetaData(uint cellFlatIdx, out uint chunkIndex, out int stepSi return metaData.x != 0xFFFFFFFF; } -uint GetIndexData(APVResources apvRes, float3 posWS) +uint GetIndexData(APVResources apvRes, float3 entryPos, float3 residualPosWS) { - float3 entryPos = floor(posWS * _APVRcpIndirectionEntryDim); - float3 topLeftEntryWS = entryPos * _APVIndirectionEntryDim; - bool isALoadedCell = all(entryPos >= _APVMinLoadedCellInEntries) && all(entryPos <= _APVMaxLoadedCellInEntries); // Make sure we start from 0 @@ -300,7 +297,6 @@ uint GetIndexData(APVResources apvRes, float3 posWS) uint chunkIdx; if (LoadCellIndexMetaData(flatIdx, chunkIdx, stepSize, minRelativeIdx, sizeOfValid)) { - float3 residualPosWS = posWS - topLeftEntryWS; uint3 localBrickIndex = floor(residualPosWS / (_APVMinBrickSize * stepSize)); localBrickIndex = min(localBrickIndex, (uint3)(3 * 3 * 3 - 1)); // due to floating point issue, we may query an invalid brick localBrickIndex -= minRelativeIdx; // Relative to valid region @@ -349,8 +345,10 @@ APVResources FillAPVResources() bool TryToGetPoolUVWAndSubdiv(APVResources apvRes, float3 posWSForSample, out float3 uvw, out uint subdiv) { - // resolve the index - uint packed_pool_idx = GetIndexData(apvRes, posWSForSample.xyz); + float3 posInEntries = posWSForSample.xyz * _APVRcpIndirectionEntryDim; + float3 entryPos = floor(posInEntries); // integer coord of indirection entry + float3 residualPosWS = min(posInEntries - entryPos, 0.999999) * _APVIndirectionEntryDim; // WS position relative to indirection entry + uint packed_pool_idx = GetIndexData(apvRes, entryPos, residualPosWS); // unpack pool idx // size is encoded in the upper 4 bits @@ -364,8 +362,21 @@ bool TryToGetPoolUVWAndSubdiv(APVResources apvRes, float3 posWSForSample, out fl pool_idx.x = floor(flattened_pool_idx - (pool_idx.y * _APVPoolDim.x)); // calculate uv offset and scale - float brickSizeWS = pow(3.0, subdiv) * _APVMinBrickSize; - float3 offset = frac(posWSForSample.xyz / brickSizeWS); // [0;1] in brick space + float brickSizeWS = round(pow(3.0, subdiv)) * _APVMinBrickSize; + float3 offset = frac(residualPosWS / brickSizeWS); // [0;1] in brick space + + // special case when bricks are large enough to span multiple indirection entries + if (brickSizeWS > _APVIndirectionEntryDim) + { + float entriesPerBrick = round(brickSizeWS * _APVRcpIndirectionEntryDim); + float3 entryOffsetInBrick = entryPos - entriesPerBrick * floor(entryPos / entriesPerBrick); // entryPos mod entriesPerBrick +#if defined(SHADER_API_GAMECORE) + entryOffsetInBrick = select(entryOffsetInBrick >= entriesPerBrick, entryOffsetInBrick - entriesPerBrick, entryOffsetInBrick); +#else + entryOffsetInBrick = (entryOffsetInBrick >= entriesPerBrick) ? (entryOffsetInBrick - entriesPerBrick) : entryOffsetInBrick; +#endif + offset = min((entryOffsetInBrick * _APVIndirectionEntryDim + residualPosWS) / brickSizeWS, 0.9999); + } //offset = clamp( offset, 0.25, 0.75 ); // [0.25;0.75] in brick space (is this actually necessary?) uvw = (pool_idx + 0.5 + (3.0 * offset)) * _APVRcpPoolDim; // add offset with brick footprint converted to text footprint in pool texel space From 8575cbf3409ac25de1271f004556018c0852a312 Mon Sep 17 00:00:00 2001 From: Marta Malberti Date: Sat, 17 Oct 2026 05:41:14 +0000 Subject: [PATCH 18/18] [Port] [6000.0] [DOCG-9120] Add Shader Graph project settings reference page --- .../Shader-Graph-Project-Settings.md | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Project-Settings.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Project-Settings.md index 3780da6fa18..f5fd6698333 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Project-Settings.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Project-Settings.md @@ -1,30 +1,34 @@ # Shader Graph project settings reference -Use the Shader Graph project settings to define shader graph settings for your entire project. To access the Shader Graph project settings, do the following: +Use the Shader Graph project settings to define shader graph settings for your entire project. -1. From the main menu select **Edit** > **Project Settings**. The **Project Settings** window is displayed. -2. Select **ShaderGraph**. +To open these settings, go to **Edit** > **Project Settings** > **ShaderGraph**. +The **ShaderGraph** category in the **Project Settings** window contains the following properties: -| Property | Description | +| **Property** | **Description** | |:-------------------------|:----------- | -| **Shader Variant Limit** | Set the maximum number of variants allowed in the project. 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). | +| **Override Variant Limit** | Overrides the default limit on the number of shader variants Shader Graph generates for the project. When you disable this property, Shader Graph uses a default of 2048 shader variants and ignores the value of **Shader Variant Limit**. Unity disables this property by default. | +| **Shader Variant Limit** | Sets the maximum number of shader variants Shader Graph generates for the project. For more information about reducing shader variants, refer to [Reduce shader variants in URP](https://docs.unity3d.com/Manual/urp/shader-stripping.html).

This property is available only when you enable **Override Variant Limit**. | + ## Custom Interpolator Channel Settings -It's impossible to limit the number of channels users can create in a Shader Graph. Use **Custom Interpolator Channel Settings** to create alerts that let users know when they're close to, or have exceeded, the channel limit for the target platform. Unity uses these settings to help Shader Graph users maintain compatibility with target platforms when using custom interpolators. For more information, refer to [Custom interpolators](Custom-Interpolators.md). +The **Custom Interpolator Channel Settings** section contains the following properties. For more information, refer to [Custom interpolators](Custom-Interpolators.md). -| Property | Description | +| **Property** | **Description** | |:-------------------------|:-----------------------------------| | **Error Threshold** | Specify the number of channels at which users are notified that they're at, or have surpassed, the channel limit. This property has a minimum value of 8 channels and must be higher than **Warning Threshold**. | | **Warning Threshold** | Specify the number of channels at which users are warned that they are close to the channel limit. This property must be lower than **Error Threshold** and between 8 and 32 channels. | -## Heatmap Color Mode Settings +## Heatmap Color Mode Settings + +The **Heatmap Color Mode Settings** section contains the following properties. For more information, refer to [Create a custom Shader Graph Heatmap Values asset](Color-Modes.md#customize-the-heatmap-color-mode). -You can customize the [Heatmap color mode](Color-Modes.md#heatmap-colors) and use different sets of colors with different node assignments according to your project needs. For this, you first have to [create a custom Shader Graph Heatmap Values asset](Color-Modes.md#customize-the-heatmap-color-mode). +The **Heatmap Color Mode Settings** section contains the following properties: -| Property | Description | +| **Property** | **Description** | |:------------------|:-------------------------------------------| | **Custom Values** | Specify the Shader Graph Heatmap Values asset to use for your project, or **None** if you want to use the default values. |