From 2cca8f68679763f41e26936a5d6cb331a63bd0fb Mon Sep 17 00:00:00 2001 From: Kenny Tan Date: Wed, 13 Aug 2025 14:14:42 +0000 Subject: [PATCH 1/7] [2022.3][UUM-112716] Fix Light2D issue on certain android devices --- .../Runtime/2D/Passes/Utility/RendererLighting.cs | 4 ++-- .../Shaders/2D/Light2D-Point-Volumetric.shader | 4 ++-- .../Shaders/2D/Light2D-Point.shader | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs index 6f867d7d74a..845beb5ffcf 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/2D/Passes/Utility/RendererLighting.cs @@ -59,7 +59,7 @@ internal static class RendererLighting private static readonly int k_LightInvMatrixID = Shader.PropertyToID("_LightInvMatrix"); private static readonly int k_InnerRadiusMultID = Shader.PropertyToID("_InnerRadiusMult"); private static readonly int k_OuterAngleID = Shader.PropertyToID("_OuterAngle"); - private static readonly int k_InnerAngleMultID = Shader.PropertyToID("_InnerAngleMult"); + private static readonly int k_InnerAngleID = Shader.PropertyToID("_InnerAngle"); private static readonly int k_LightLookupID = Shader.PropertyToID("_LightLookup"); private static readonly int k_IsFullSpotlightID = Shader.PropertyToID("_IsFullSpotlight"); private static readonly int k_LightZDistanceID = Shader.PropertyToID("_LightZDistance"); @@ -486,7 +486,7 @@ private static void SetPointLightShaderGlobals(IRenderPass2D pass, CommandBuffer cmd.SetGlobalMatrix(k_LightInvMatrixID, lightInverseMatrix); cmd.SetGlobalFloat(k_InnerRadiusMultID, innerRadiusMult); cmd.SetGlobalFloat(k_OuterAngleID, outerAngle); - cmd.SetGlobalFloat(k_InnerAngleMultID, 1 / (outerAngle - innerAngle)); + cmd.SetGlobalFloat(k_InnerAngleID, innerAngle); cmd.SetGlobalTexture(k_LightLookupID, Light2DLookupTexture.GetLightLookupTexture()); cmd.SetGlobalTexture(k_FalloffLookupID, pass.rendererData.fallOffLookup); cmd.SetGlobalFloat(k_FalloffIntensityID, light.falloffIntensity); diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point-Volumetric.shader b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point-Volumetric.shader index beaa6e0eff1..329a5671701 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point-Volumetric.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point-Volumetric.shader @@ -53,7 +53,7 @@ Shader "Hidden/Light2d-Point-Volumetric" float4x4 _LightNoRotInvMatrix; half _LightZDistance; half _OuterAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees - half _InnerAngleMult; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees + half _InnerAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees half _InnerRadiusMult; // 1-0 where 1 is the value at the center and 0 is the value at the outer radius half _InverseHDREmulationScale; half _IsFullSpotlight; @@ -88,7 +88,7 @@ Shader "Hidden/Light2d-Point-Volumetric" half attenuation = saturate(_InnerRadiusMult * lookupValue.r); // This is the code to take care of our inner radius // Spotlight - half spotAttenuation = saturate((_OuterAngle - lookupValue.g + _IsFullSpotlight) * _InnerAngleMult); + half spotAttenuation = saturate((_OuterAngle - lookupValue.g + _IsFullSpotlight) * (1.0f / (_OuterAngle - _InnerAngle))); attenuation = attenuation * spotAttenuation; half2 mappedUV; diff --git a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point.shader b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point.shader index 548876f748c..eec0adb88f4 100644 --- a/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point.shader +++ b/Packages/com.unity.render-pipelines.universal/Shaders/2D/Light2D-Point.shader @@ -63,7 +63,7 @@ Shader "Hidden/Light2D-Point" float4x4 _LightInvMatrix; float4x4 _LightNoRotInvMatrix; half _OuterAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees - half _InnerAngleMult; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees + half _InnerAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees half _InnerRadiusMult; // 1-0 where 1 is the value at the center and 0 is the value at the outer radius half _InverseHDREmulationScale; half _IsFullSpotlight; @@ -97,7 +97,7 @@ Shader "Hidden/Light2D-Point" half attenuation = saturate(_InnerRadiusMult * lookupValue.r); // This is the code to take care of our inner radius // Spotlight - half spotAttenuation = saturate((_OuterAngle - lookupValue.g + _IsFullSpotlight) * _InnerAngleMult); + half spotAttenuation = saturate((_OuterAngle - lookupValue.g + _IsFullSpotlight) * (1.0f / (_OuterAngle - _InnerAngle))); attenuation = attenuation * spotAttenuation; half2 mappedUV; From 9f648a82d4ae58219942c986b7c0799b73bbe58f Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 2/7] [Port] [2022.3] [6000.3][UUM-111256] Fix Blurry and Stretched Light Type Icons in Global Light 2D Inspector (URP 2D Template) --- .../Resources/InspectorIcons/PointLight.png | Bin 722 -> 14193 bytes .../InspectorIcons/PointLight.png.meta | 147 ++++++++++++++++-- 2 files changed, 132 insertions(+), 15 deletions(-) diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png b/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png index 9e8bbecb6a8f5b829357c605649449708e732939..d9f1be528d3211a1281226aea3cca60390d8b629 100644 GIT binary patch literal 14193 zcmb`u1ymf(zAZk32iM^4?k>SygA+8kySo$I-JRf0a1HM6E+K)zo$w~#IrlsF-T%4w zzusG~XLVO~_1?R7{i>?hOjpkrWko3@cszIj0DvSTE&dUl3jf*R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Resources/InspectorIcons/PointLight.png.meta b/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png.meta index 449aeab9206..0f2f9e1acf9 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png.meta +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/Resources/InspectorIcons/PointLight.png.meta @@ -1,9 +1,12 @@ fileFormatVersion: 2 -guid: b3ab972b21db85d48ade9657efdd4771 +guid: 6eaa9958d83ec43499e946a21edba283 TextureImporter: - internalIDToNameTable: [] + internalIDToNameTable: + - first: + 213: 1287649992867056945 + second: PointLight@64_0 externalObjects: {} - serializedVersion: 10 + serializedVersion: 13 mipmaps: mipMapMode: 0 enableMipMap: 0 @@ -20,9 +23,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 + flipGreenChannel: 0 isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -31,16 +37,16 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: -1 + filterMode: 1 aniso: 1 - mipBias: -100 + mipBias: 0 wrapU: 1 wrapV: 1 - wrapW: -1 + wrapW: 1 nPOTScale: 0 lightmap: 0 compressionQuality: 50 - spriteMode: 0 + spriteMode: 2 spriteExtrude: 1 spriteMeshType: 1 alignment: 0 @@ -51,42 +57,150 @@ TextureImporter: alphaUsage: 1 alphaIsTransparency: 1 spriteTessellationDetail: -1 - textureType: 2 + textureType: 8 textureShape: 1 singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 maxTextureSizeSet: 0 compressionQualitySet: 0 textureFormatSet: 0 ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 platformSettings: - - serializedVersion: 3 + - serializedVersion: 4 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 2 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 + - serializedVersion: 4 + buildTarget: CloudRendering + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Switch + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 buildTarget: Standalone maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 2 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreXboxOne + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: GameCoreScarlett + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 overridden: 0 + ignorePlatformSupport: 0 androidETC2FallbackOverride: 0 forceMaximumCompressionQuality_BC6H_BC7: 0 spriteSheet: serializedVersion: 2 - sprites: [] + sprites: + - serializedVersion: 2 + name: PointLight@64_0 + rect: + serializedVersion: 2 + x: 11 + y: 2 + width: 42 + height: 62 + alignment: 0 + pivot: {x: 0, y: 0} + border: {x: 0, y: 0, z: 0, w: 0} + customData: + outline: [] + physicsShape: [] + tessellationDetail: -1 + bones: [] + spriteID: 13d00e3a8d6aed110800000000000000 + internalID: 1287649992867056945 + vertices: [] + indices: + edges: [] + weights: [] outline: [] + customData: physicsShape: [] bones: [] spriteID: @@ -96,9 +210,12 @@ TextureImporter: edges: [] weights: [] secondaryTextures: [] - spritePackingTag: + spriteCustomMetadata: + entries: [] + nameFileIdTable: + PointLight@64_0: 1287649992867056945 + mipmapLimitGroupName: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: From eb04d82ac99a469c3ab67894972a91eb4996bcc3 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 3/7] [Port] [2022.3] DOCG-7358 Fixes and improvements to Scene Depth Node docs --- .../Documentation~/Scene-Depth-Node.md | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md index d0d30351bd6..9b62cfe227f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Scene-Depth-Node.md @@ -1,34 +1,38 @@ -# Scene Depth Node +# Scene Depth node -## Description +The Scene Depth node samples the depth texture of the current camera, using the screen space coordinates you input. The node returns the depth of the closest object the camera sees along the path towards the coordinates, or 1 (white) if no object is present. -Provides access to the current **Camera**'s depth buffer using input **UV**, which is expected to be normalized screen coordinates. +If you use the Universal Render Pipeline (URP), make sure the depth texture is enabled in the [URP asset](https://docs.unity3d.com/Manual/urp/universalrp-asset.html). Otherwise the Scene Depth node returns a value of 0.5 (mid-grey). -Note: Depth buffer access requires depth buffer to be enabled on the active **Render Pipeline**. This process is different per **Render Pipeline**. It is recommended you read the documentation of your active **Render Pipeline** for information on enabling the depth buffer. If the depth buffer is unavailable this [Node](Node.md) will return mid grey. +The Scene Depth node works only in the fragment [shader stage](Shader-Stage.md), and might not work if you set **Surface Type** to **Opaque** in the **Graph Inspector** window. -Note: The executed HLSL code for this [Node](Node.md) is defined per **Render Pipeline**, and different **Render Pipelines** may produce different results. Custom **Render Pipelines** that wish to support this [Node](Node.md) will also need to explicitly define the behaviour for it. If undefined this [Node](Node.md) will return 1 (white). +## Render pipeline support -NOTE: This [Node](Node.md) can only be used in the **Fragment** [Shader Stage](Shader-Stage.md) and it is not guaranteed to work with an opaque material. +This node supports the following render pipelines: -#### Unity Render Pipelines Support -- High Definition Render Pipeline -- Universal Render Pipeline +- High Definition Render Pipeline (HDRP) +- Universal Render Pipeline (URP) ## Ports -| Name | Direction | Type | Binding | Description | +| **Name** | **Direction** | **Type** | **Binding** | **Description** | |:------------ |:-------------|:-----|:---|:---| -| UV | Input | Vector 4 | Screen Position | Normalized screen coordinates | -| Out | Output | Float | None | Output value | +| **UV** | Input | Vector 4 | Screen position | The normalized screen space coordinates to sample from. | +| **Out** | Output | Float | None | The depth value from the depth texture at the **UV** coordinates. | -## Depth Sampling modes -| Name | Description | +## Sampling modes + +| **Name** | **Description** | |----------|------------------------------------| -| Linear01 | Linear depth value between 0 and 1 | -| Raw | Raw depth value | -| Eye | Depth converted to eye space units | +| **Linear 01** | Returns the linear depth value. The range is from 0 to 1. 0 is the near clipping plane of the camera, and 1 is the far clipping plane of the camera. | +| **Raw** | Returns the non-linear depth value. The range is from 0 to 1. 0 is the near clipping plane of the camera, and 1 is the far clipping plane of the camera. | +| **Eye** | Returns the depth value as the distance from the camera in meters. | + +For more information about clipping planes, refer to [Introduction to the camera view](https://docs.unity3d.com/Manual/UnderstandingFrustum.html). -## Generated Code Example +## Generated code example + +The HLSL code this node generates depends on the render pipeline you use. If you use your own custom render pipeline, you must define the behaviour of the node yourself, otherwise the node returns a value of 1 (white). The following example code represents one possible outcome of this node. @@ -37,4 +41,4 @@ void Unity_SceneDepth_Raw_float(float4 UV, out float Out) { Out = SHADERGRAPH_SAMPLE_SCENE_DEPTH(UV); } -``` +``` \ No newline at end of file From 12935ec1d40b968a358463fbc8e3c63b3908871e Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 4/7] [Port] [2022.3] DOCG-7299 Improvements to Simple Noise node docs --- .../Documentation~/Simple-Noise-Node.md | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md b/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md index 0d70513df4c..b554309e144 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Simple-Noise-Node.md @@ -1,26 +1,25 @@ -# Simple Noise Node +# Simple Noise node -## Description - -Generates a simple, or [Value](https://en.wikipedia.org/wiki/Value_noise), noise based on input **UV**. The scale of the generated noise is controlled by input **Scale**. - -You can also choose to use two different hashing methods for calculating the noise. As of Unity version 2021.2, the Simple Noise node defaults to the **Deterministic** hash, to ensure consistent results for noise generation across platforms. +The Simple Noise node generates a pseudo-random value, also known as value noise, for each UV coordinate in the input **UV**. ## Ports -| Name | Direction | Type | Binding | Description | +| **Name** | **Direction** | **Type** | **Binding** | **Description** | |:------------ |:-------------|:-----|:---|:---| -| UV | Input | Vector 2 | UV | Input UV value | -| Scale | Input | Float | None | Noise scale | -| Out | Output | Float | None | Output value | +| **UV** | Input | Vector 2 | UV | The UV coordinates to input. For example UV coordinates, refer to [UV Nodes](UV-Nodes.md). | +| **Scale** | Input | Float | None | How much to scale the size of the output. A higher value zooms out so there are more noise values in the same space. The default is 500. | +| **Out** | Output | Float | None | The simple noise. The range of each value is between 0 and 1. | -## Controls +## Hash Type -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| Hash Type | Dropdown | Deterministic, LegacySine | Selects the hash function used to generate random numbers for noise generation. | +The **Hash Type** dropdown determines the hash function Unity uses to generate random numbers for the noise generation. -## Generated Code Example +| **Option** | **Description** | +|-|-| +| **Deterministic** | Uses a hash function that generates the same noise across different platforms. This is the default option. | +| **Legacy Sine** | Uses a sine-based hash function. For most uses, **Deterministic** replaces **Legacy Sine**. | + +## Generated code example The following example code represents one possible outcome of this node. @@ -75,4 +74,4 @@ void Unity_SimpleNoise_float(float2 UV, float Scale, out float Out) Out = t; } -``` +``` \ No newline at end of file From f9fa40c572dc8cd7e451ff1345d3c3289fff8fe1 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 5/7] [Port] [2022.3] DOCG-7329 Improve UV Node docs --- .../Documentation~/UV-Node.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/UV-Node.md b/Packages/com.unity.shadergraph/Documentation~/UV-Node.md index 29243e5a7ab..013dd2bbf9e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/UV-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/UV-Node.md @@ -1,17 +1,17 @@ -# UV Node +# UV node -## Description +The UV node outputs the vertex or fragment UV coordinates of a mesh. -Provides access to the mesh vertex or fragment's **UV** coordinates. The coordinate channel of the output value can be selected with the **Channel** dropdown parameter. +UV coordinates usually have two channels, but the UV node outputs four channels so you can use the remaining two channels, for example to store custom mesh data. ## Ports -| Name | Direction | Type | Binding | Description | +| **Name** | **Direction** | **Type** | **Binding** | **Description** | |:------------ |:-------------|:-----|:---|:---| -| Out | Output | Vector 4 | None | Mesh's **UV** coordinates. | +| **Out** | Output | Vector 4 | None | The u and v coordinates from the mesh in the first two channels, and two extra channels. | ## Controls -| Name | Type | Options | Description | +| **Name** | **Type** | **Options** | **Description** | |:------------ |:-------------|:-----|:---| -| Channel | Dropdown | UV0, UV1, UV2, UV3 | Selects coordinate channel of **UV** to output. | +| **Channel** | Dropdown | **UV0**, **UV1**, **UV2**, **UV3**, **UV4**, **UV5**, **UV6**, **UV7** | Selects the coordinate set to output. | From a054fb23d506384e471232bd24a54cf60962ec99 Mon Sep 17 00:00:00 2001 From: Reach Platform Support Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 6/7] [Port] [2022.3] DOCG-7355 Remap node docs improvements --- .../Documentation~/Remap-Node.md | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md b/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md index 284b3ab7c33..8e0e6e3f639 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Remap-Node.md @@ -1,19 +1,17 @@ -# Remap Node +# Remap node -## Description - -Returns a value between the x and y components of input **Out Min Max** based on the linear interpolation of the value of input **In** between the x and y components of input **In Min Max**. +The Remap node converts a value from one range to another, which is also known as linear interpolation. For example, you can use the node to convert a value in the range 0 to 1 to the equivalent value in the range 0 to 100. ## Ports -| Name | Direction | Type | Description | +| **Name** | **Direction** | **Type** | **Description** | |:------------ |:-------------|:-----|:---| -| In | Input | Dynamic Vector | Input value | -| In Min Max | Input | Vector 2 | Minimum and Maximum values for input interpolation | -| Out Min Max | Input | Vector 2 | Minimum and Maximum values for output interpolation | -| Out | Output | Dynamic Vector | Output value | +| **In** | Input | Dynamic Vector | The value to convert. | +| **In Min Max** | Input | Vector 2 | The original minimum and maximum range of **In**. | +| **Out Min Max** | Input | Vector 2 | The new minimum and maximum range to use to interpolate **In**. | +| **Out** | Output | Dynamic Vector | The converted value. | -## Generated Code Example +## Generated code example The following example code represents one possible outcome of this node. @@ -22,4 +20,4 @@ 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 From 0214b750feec80a811ef54841f4896c54f8ea1a1 Mon Sep 17 00:00:00 2001 From: Mark Green Date: Tue, 19 Aug 2025 19:57:03 +0000 Subject: [PATCH 7/7] [Port] [2022.3] DOCG-7278 Improve Position node docs --- .../Documentation~/Position-Node.md | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/Packages/com.unity.shadergraph/Documentation~/Position-Node.md b/Packages/com.unity.shadergraph/Documentation~/Position-Node.md index 116449a0274..901138afbf2 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Position-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Position-Node.md @@ -1,29 +1,21 @@ -# Position Node +# Position node -## Description - -Provides access to the mesh vertex's or fragment's **Position**, depending on the effective [Shader Stage](Shader-Stage.md) of the graph section that the [Node](Node.md) is part of. Use the **Space** drop-down parameter to select the coordinate space of the output value. +The Position node returns the position of a vertex or fragment of a mesh. ## Ports -| Name | Direction | Type | Binding | Description | +| **Name** | **Direction** | **Type** | **Binding** | **Description** | |:------------ |:-------------|:-----|:---|:---| -| Out | Output | Vector 3 | None | **Position** for the Mesh Vertex/Fragment. | - -## Controls - -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| Space | Dropdown | Object, View, World, Tangent, Absolute World | Selects the coordinate space of **Position** to output. | - -## World and Absolute World -The Position Node provides drop-down options for both **World** and **Absolute World** space positions. The **Absolute World** option always returns the absolute world position of the object in the Scene for all Scriptable Render Pipelines. The **World** option returns the default world space of the selected Scriptable Render Pipeline. - -The [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html) uses [Camera Relative](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?preview=1&subfolder=/manual/Camera-Relative-Rendering.html) as its default world space. +| **Out** | Output | Vector 3 | None | Position of the vertex or fragment of the mesh, depending on the [shader stage](Shader-Stage.md) of the graph section. | -The [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html) uses **Absolute World** as its default world space. +## Space -### Upgrading from previous versions -If you use a Position Node in **World** space on a graph authored in Shader Graph version 6.7.0 or earlier, it automatically upgrades the selection to **Absolute World**. This ensures that the calculations on your graph remain accurate to your expectations, since the **World** output might change. +The **Space** dropdown determines the coordinate space of the output position. -If you use a Position Node in **World** space in the High Definition Render Pipeline to manually calculate [Camera Relative](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?preview=1&subfolder=/manual/Camera-Relative-Rendering.html) world space, you can now change your node from **Absolute World** to **World**, which lets you use [Camera Relative](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest?preview=1&subfolder=/manual/Camera-Relative-Rendering.html) world space out of the box. +| **Options** | **Description** | +|-|-| +| **Object** | Returns the vertex or fragment position relative to the origin of the object. | +| **View** | Returns the vertex or fragment position relative to the camera, in meters. | +| **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. |