diff --git a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl index 3dfcbe0e139..d5b796647e7 100644 --- a/Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl +++ b/Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl @@ -23,6 +23,7 @@ struct UnityTexture2D SAMPLER(samplerstate); float4 texelSize; float4 scaleTranslate; + float4 hdrDecode; // these functions allows users to convert code using Texture2D to UnityTexture2D by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -61,15 +62,16 @@ float4 tex2D(UnityTexture2D tex, float2 uv) { return SAMPLE_TEXT float4 tex2Dlod(UnityTexture2D tex, float4 uv0l) { return SAMPLE_TEXTURE2D_LOD(tex.tex, tex.samplerstate, uv0l.xy, uv0l.w); } float4 tex2Dbias(UnityTexture2D tex, float4 uv0b) { return SAMPLE_TEXTURE2D_BIAS(tex.tex, tex.samplerstate, uv0b.xy, uv0b.w); } -#define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST) -#define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, float4(1, 1, 0, 0)) -UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate) +#define UnityBuildTexture2DStruct(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, n##_ST, float4(0, 0, 0, 0)) +#define UnityBuildTexture2DStructNoScale(n) UnityBuildTexture2DStructInternal(TEXTURE2D_ARGS(n, sampler##n), n##_TexelSize, float4(1, 1, 0, 0), float4(0, 0, 0, 0)) +UnityTexture2D UnityBuildTexture2DStructInternal(TEXTURE2D_PARAM(tex, samplerstate), float4 texelSize, float4 scaleTranslate, float4 hdrDecode) { UnityTexture2D result; result.tex = tex; result.samplerstate = samplerstate; result.texelSize = texelSize; result.scaleTranslate = scaleTranslate; + result.hdrDecode = hdrDecode; return result; } @@ -78,6 +80,7 @@ struct UnityTexture2DArray { TEXTURE2D_ARRAY(tex); SAMPLER(samplerstate); + float4 hdrDecode; // these functions allows users to convert code using Texture2DArray to UnityTexture2DArray by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -94,12 +97,13 @@ struct UnityTexture2DArray float4 Load(int4 pixel) { return LOAD_TEXTURE2D_ARRAY(tex, pixel.xy, pixel.z); } }; -#define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n)) -UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM(tex, samplerstate)) +#define UnityBuildTexture2DArrayStruct(n) UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_ARGS(n, sampler##n), float4(0, 0, 0, 0)) +UnityTexture2DArray UnityBuildTexture2DArrayStructInternal(TEXTURE2D_ARRAY_PARAM(tex, samplerstate), float4 hdrDecode) { UnityTexture2DArray result; result.tex = tex; result.samplerstate = samplerstate; + result.hdrDecode = hdrDecode; return result; } @@ -108,6 +112,7 @@ struct UnityTextureCube { TEXTURECUBE(tex); SAMPLER(samplerstate); + float4 hdrDecode; // these functions allows users to convert code using TextureCube to UnityTextureCube by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -128,12 +133,13 @@ struct UnityTextureCube float4 texCUBE(UnityTextureCube tex, float3 dir) { return SAMPLE_TEXTURECUBE(tex.tex, tex.samplerstate, dir); } float4 texCUBEbias(UnityTextureCube tex, float4 dirBias) { return SAMPLE_TEXTURECUBE_BIAS(tex.tex, tex.samplerstate, dirBias.xyz, dirBias.w); } -#define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n)) -UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate)) +#define UnityBuildTextureCubeStruct(n) UnityBuildTextureCubeStructInternal(TEXTURECUBE_ARGS(n, sampler##n), float4(0, 0, 0, 0)) +UnityTextureCube UnityBuildTextureCubeStructInternal(TEXTURECUBE_PARAM(tex, samplerstate), float4 hdrDecode) { UnityTextureCube result; result.tex = tex; result.samplerstate = samplerstate; + result.hdrDecode = hdrDecode; return result; } @@ -142,6 +148,7 @@ struct UnityTexture3D { TEXTURE3D(tex); SAMPLER(samplerstate); + float4 hdrDecode; // these functions allows users to convert code using Texture3D to UnityTexture3D by simply changing the type of the variable // the existing texture macros will call these functions, which will forward the call to the texture appropriately @@ -155,12 +162,13 @@ struct UnityTexture3D float4 tex3D(UnityTexture3D tex, float3 uvw) { return SAMPLE_TEXTURE3D(tex.tex, tex.samplerstate, uvw); } -#define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n)) -UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate)) +#define UnityBuildTexture3DStruct(n) UnityBuildTexture3DStructInternal(TEXTURE3D_ARGS(n, sampler##n), float4(0, 0, 0, 0)) +UnityTexture3D UnityBuildTexture3DStructInternal(TEXTURE3D_PARAM(tex, samplerstate), float4 hdrDecode) { UnityTexture3D result; result.tex = tex; result.samplerstate = samplerstate; + result.hdrDecode = hdrDecode; return result; } diff --git a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs index 781b51c001f..04ad93ce517 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/2D/LightBatchingDebugger/LightBatchingDebugger.cs @@ -43,9 +43,11 @@ public static void ShowExample() // Variables used for refresh view private bool doRefresh; private int cachedSceneHandle; + private Vector3 cachedCamPos; private int totalLightCount; private int totalShadowCount; - private Vector3 cachedCamPos; + private string[] cachedLightNames; + private string[] cachedShadowCasterNames; ILight2DCullResult lightCullResult { @@ -118,6 +120,9 @@ private VisualElement MakePill(UnityEngine.Object obj) var bubble = new Button(); bubble.AddToClassList("Pill"); bubble.text = obj.name; + bubble.style.maxWidth = 200; + bubble.style.overflow = Overflow.Hidden; + bubble.style.textOverflow = TextOverflow.Ellipsis; bubble.clicked += () => { @@ -469,8 +474,20 @@ private bool IsDirty() if (lightCullResult.IsGameView()) { + var visibleShadows = lightCullResult.visibleShadows.SelectMany(x => x.GetShadowCasters()).ToList(); + isDirty |= totalLightCount != lightCullResult.visibleLights.Count(); - isDirty |= totalShadowCount != lightCullResult.visibleShadows.Count(); + isDirty |= totalShadowCount != visibleShadows.Count(); + + // Account for name changes + if (!isDirty) + { + for (int i = 0; i < totalLightCount; ++i) + isDirty |= !lightCullResult.visibleLights.Exists(x => x != null && x.name == cachedLightNames[i]); + + for (int i = 0; i < totalShadowCount; ++i) + isDirty |= !visibleShadows.Exists(x => x != null && x.name == cachedShadowCasterNames[i]); + } } return isDirty; @@ -485,8 +502,27 @@ private void ResetDirty() if (lightCullResult != null) { + var visibleShadows = lightCullResult.visibleShadows.SelectMany(x => x.GetShadowCasters()); + totalLightCount = lightCullResult.visibleLights.Count(); - totalShadowCount = lightCullResult.visibleShadows.Count(); + totalShadowCount = visibleShadows.Count(); + + cachedLightNames = new string[totalLightCount]; + cachedShadowCasterNames = new string[totalShadowCount]; + + for (int i = 0; i < totalLightCount; ++i) + { + var light = lightCullResult.visibleLights[i]; + if (light != null) + cachedLightNames[i] = light.name; + } + + for (int i = 0; i < totalShadowCount; ++i) + { + var shadowCaster = visibleShadows.ElementAt(i); + if (shadowCaster != null) + cachedShadowCasterNames[i] = shadowCaster.name; + } } doRefresh = false; diff --git a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs index 178f4e58e95..a66ce35c00a 100644 --- a/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs +++ b/Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineAsset/UniversalRenderPipelineAssetUI.Skin.cs @@ -55,8 +55,8 @@ internal static class Styles public static readonly GUIContent lightProbeSystemContent = EditorGUIUtility.TrTextContent("Light Probe System", "What system to use for Light Probes."); public static readonly GUIContent probeVolumeMemoryBudget = EditorGUIUtility.TrTextContent("Memory Budget", "Determines the width and height of the 3D textures used to store lighting data from probes. Depth is fixed."); public static readonly GUIContent probeVolumeBlendingMemoryBudget = EditorGUIUtility.TrTextContent("Blending Memory Budget", "Determines the width and height of the 3D textures used to store light scenario blending data from probes. Depth is fixed."); - public static readonly GUIContent supportProbeVolumeGPUStreaming = EditorGUIUtility.TrTextContent("Enable GPU Streaming", "Enable steaming of Cells for Adaptive Probe Volumes."); - public static readonly GUIContent supportProbeVolumeDiskStreaming = EditorGUIUtility.TrTextContent("Enable Disk Streaming", "Enable steaming of Cells from disk for Adaptive Probe Volumes."); + public static readonly GUIContent supportProbeVolumeGPUStreaming = EditorGUIUtility.TrTextContent("Enable GPU Streaming", "Enable streaming of Cells for Adaptive Probe Volumes."); + public static readonly GUIContent supportProbeVolumeDiskStreaming = EditorGUIUtility.TrTextContent("Enable Disk Streaming", "Enable streaming of Cells from disk for Adaptive Probe Volumes."); public static readonly GUIContent supportProbeVolumeScenarios = EditorGUIUtility.TrTextContent("Enable Lighting Scenarios", "Enable Lighting Scenario Baking for Adaptive Probe Volumes."); public static readonly GUIContent supportProbeVolumeScenarioBlending = EditorGUIUtility.TrTextContent("Enable Lighting Scenario Blending", "Enable Lighting Scenario Blending for Adaptive Probe Volumes.\nNote: Lighting Scenario Blending requires Compute Shader support."); public static readonly GUIContent probeVolumeSHBands = EditorGUIUtility.TrTextContent("SH Bands", "The number of Spherical Harmonic bands used by Adaptive Probe Volumes to store lighting data. Choosing L2 provides better quality but with higher memory and runtime costs."); diff --git a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs index e825bef9ff8..e4604a52370 100644 --- a/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs +++ b/Packages/com.unity.render-pipelines.universal/Runtime/UniversalRenderPipelineCore.cs @@ -1954,21 +1954,39 @@ internal enum URPProfileId internal static class PlatformAutoDetect { /// - /// Detect and cache runtime platform information. This function should only be called once when creating the URP. + /// Detect and cache runtime platform information. + /// Lazy initialized for situations where platform detection is required before URP is initialized (UUM-134298) /// - internal static void Initialize() + private sealed class PlatformDetectionCache { - bool isRunningMobile = false; - #if ENABLE_VR && ENABLE_VR_MODULE - #if PLATFORM_WINRT || PLATFORM_ANDROID - isRunningMobile = IsRunningXRMobile(); + public readonly bool isXRMobile; + public readonly bool isShaderAPIMobileDefined; + public readonly bool isSwitch; + public readonly bool isSwitch2; + public readonly bool isRunningOnPowerVRGPU; + + public PlatformDetectionCache() + { + bool isRunningMobile = false; + #if ENABLE_VR && ENABLE_VR_MODULE + #if PLATFORM_WINRT || PLATFORM_ANDROID + isRunningMobile = IsRunningXRMobile(); + #endif #endif - #endif - isXRMobile = isRunningMobile; - isShaderAPIMobileDefined = GraphicsSettings.HasShaderDefine(BuiltinShaderDefine.SHADER_API_MOBILE); - isSwitch = Application.platform == RuntimePlatform.Switch; - isSwitch2 = Application.platform == RuntimePlatform.Switch2; + isXRMobile = isRunningMobile; + isShaderAPIMobileDefined = GraphicsSettings.HasShaderDefine(BuiltinShaderDefine.SHADER_API_MOBILE); + isSwitch = Application.platform == RuntimePlatform.Switch; + isSwitch2 = Application.platform == RuntimePlatform.Switch2; + isRunningOnPowerVRGPU = SystemInfo.graphicsDeviceName.Contains("PowerVR"); + } + } + + private static readonly Lazy platformCache = new(() => new PlatformDetectionCache(), true); + + internal static void Initialize() + { + _ = platformCache.Value; } #if ENABLE_VR && ENABLE_VR_MODULE @@ -1997,19 +2015,21 @@ private static bool IsRunningXRMobile() /// /// If true, the runtime platform is an XR mobile platform. /// - internal static bool isXRMobile { get; private set; } = false; + internal static bool isXRMobile => platformCache.Value.isXRMobile; /// /// If true, then SHADER_API_MOBILE has been defined in URP Shaders. /// - internal static bool isShaderAPIMobileDefined { get; private set; } = false; + internal static bool isShaderAPIMobileDefined => platformCache.Value.isShaderAPIMobileDefined; /// /// If true, then the runtime platform is set to Switch. /// - internal static bool isSwitch { get; private set; } = false; + internal static bool isSwitch => platformCache.Value.isSwitch; - internal static bool isSwitch2 { get; private set; } = false; + internal static bool isSwitch2 => platformCache.Value.isSwitch2; + + internal static bool isRunningOnPowerVRGPU => platformCache.Value.isRunningOnPowerVRGPU; /// /// Gives the SH evaluation mode when set to automatically detect. @@ -2028,7 +2048,5 @@ internal static ShEvalMode ShAutoDetect(ShEvalMode mode) return mode; } - - internal static bool isRunningOnPowerVRGPU = SystemInfo.graphicsDeviceName.Contains("PowerVR"); } } diff --git a/Packages/com.unity.shadergraph/Documentation~/Blackboard.md b/Packages/com.unity.shadergraph/Documentation~/Blackboard.md index 6e66c3d15d3..22dc6a2c704 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Blackboard.md +++ b/Packages/com.unity.shadergraph/Documentation~/Blackboard.md @@ -3,7 +3,7 @@ ## Description You can use the Blackboard to define, order, and categorize the [Properties](Property-Types.md) and [Keywords](Keywords.md) in a graph. From the Blackboard, you can also edit the path for the selected Shader Graph Asset or Sub Graph. -![image](images/blackboardcategories1.png) +![The blackboard layout with properties, keywords, and categories.](images/blackboardcategories1.png) ## Accessing the Blackboard The Blackboard is visible by default, and you cannot drag it off the graph and lose it. However, you are able to position it anywhere in the [Shader Graph Window](Shader-Graph-Window.md). It always maintains the same distance from the nearest corner, even if you resize the window. @@ -42,8 +42,6 @@ To make the properties in your shader more discoverable, organize them into cate ### Adding, removing, and reordering properties and keywords * To add a property or keyword to a category, expand the category with the foldout (⌄) symbol, then drag and drop the property or keyword onto the expanded category. -![image](images/blackboardcategories2.png) - * To remove a property or keyword, select it and press **Delete**, or right-click and select **Delete**. * To re-order properties or keywords, drag and drop them within a category or move them into other categories. @@ -66,9 +64,6 @@ To copy a specific set of properties: ### Using categories in the Material Inspector To modify a material you have created with a Shader Graph, you can adjust specific property or keyword values in the Material Inspector, or edit the graph itself. -![image](images/blackboardcategories3.png) - - #### Working with Streaming Virtual Textures [Streaming Virtual Texture Properties](https://docs.unity3d.com/Documentation/Manual/svt-use-in-shader-graph.html) sample texture layers. To access these layers in the Material Inspector, expand the relevant **Virtual Texture** section with the ⌄ symbol next to its name. You can add and remove layers via the Inspector. diff --git a/Packages/com.unity.shadergraph/Documentation~/Block-Node.md b/Packages/com.unity.shadergraph/Documentation~/Block-Node.md index 0b8090b83b7..b98826160a4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Block-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Block-Node.md @@ -26,6 +26,4 @@ If you disable **Automatically Add or Remove Blocks**, Shader Graph doesn't auto Active Block nodes are Blocks that contribute to the final shader. Inactive Block nodes are Blocks that are present in the Shader Graph, but don't contribute to the final shader. -![image](images/Active-Inactive-Blocks.png) - When you change the graph settings, certain Blocks might become active or inactive. Inactive Block nodes and any node streams that are connected only to Inactive Block nodes appear grayed out. diff --git a/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md b/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md index 2ff09735709..40196324ee1 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Boolean-Node.md @@ -6,15 +6,15 @@ Defines a constant **Boolean** value in the [Shader Graph](index.md), although i ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Boolean | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Boolean | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Toggle | | Defines the output value. | +| Control | Description | +|:---|:---| +| (Checkbox) | Defines the output value. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md b/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md index 5fba552c278..d45d90c2953 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Channel-Mixer-Node.md @@ -6,19 +6,19 @@ Controls the amount each of the channels of input **In** contribute to each of t ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| In | Input | Vector 3 | None | Input value | -| Out | Output | Vector 3 | None | Output value | +| Name | Direction | Type | Binding | Description | +|:---|:---|:---|:---|:---| +| In | Input | Vector 3 | None | Input value | +| Out | Output | Vector 3 | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Toggle Button Array | R, G, B | Selects the output channel to edit. | -| R | Slider | | Controls contribution of input red channel to selected output channel. | -| G | Slider | | Controls contribution of input green channel to selected output channel. | -| B | Slider | | Controls contribution of input blue channel to selected output channel. | +| Control | Description | +|:---|:---| +| **R**, **G**, **B** (toggle buttons) | Selects the output channel to edit with the sliders. | +| **R** (slider) | Controls the contribution of the input red channel to the selected output channel. | +| **G** (slider) | Controls the contribution of the input green channel to the selected output channel. | +| **B** (slider) | Controls the contribution of the input blue channel to the selected output channel. | ## Shader Function diff --git a/Packages/com.unity.shadergraph/Documentation~/Color-Node.md b/Packages/com.unity.shadergraph/Documentation~/Color-Node.md index 5405913ea97..ba9dcb722d4 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Color-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Color-Node.md @@ -8,16 +8,16 @@ NOTE: In versions prior to 10.0, Shader Graph assumed that HDR colors from the C ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Vector 4 | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Vector 4 | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Color | | Defines the output value. | -| Mode | Dropdown | Default, HDR | Sets properties of the Color field | +| Control | Description | +|:---|:---| +| (Color) | Defines the output value. | +| **Mode** | Sets properties of the Color field. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md b/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md index e0424ea5ac4..34a352b124e 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Comparison-Node.md @@ -6,17 +6,17 @@ Compares the two input values **A** and **B** based on the condition selected on ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| A | Input | Float | None | First input value | -| B | Input | Float | None | Second input value | -| Out | Output | Boolean | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| A | Input | Float | None | First input value | +| B | Input | Float | None | Second input value | +| Out | Output | Boolean | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Dropdown | Equal, NotEqual, Less, LessOrEqual, Greater, GreaterOrEqual | Condition for comparison | +| Control | Description | +|:---|:---| +| (Dropdown) | Select the condition for comparison between A and B. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md b/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md index 7afa17f55f2..1b8a40870a6 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Cubemap-Asset-Node.md @@ -6,12 +6,12 @@ Defines a constant **Cubemap Asset** for use in the shader. To sample the **Cube ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Cubemap | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Cubemap | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Object Field (Cubemap) | | Defines the cubemap asset from the project. | +| Control | Description | +|:--- |:---| +| (Cubemap)| Defines the cubemap asset from the project. | diff --git a/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md b/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md index ab06b823c35..969c297fd12 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Dielectric-Specular-Node.md @@ -10,17 +10,17 @@ You can use **Custom** material type to define your own physically based materia ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Float | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Float | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| Material | Dropdown | Common, RustedMetal, Water, Ice, Glass, Custom | Selects the material value to output. | -| Range | Slider | | Controls output value for **Common** material type. | -| IOR | Slider | | Controls index of refraction for **Custom** material type. | +| Control | Description | +|:---|:---| +| **Material** | Selects the material value to output. The options are: | +| **Range** | Controls the output value for a **Common** material type. | +| **IOR** | Controls the index of refraction for a **Custom** material type. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md index e6ed9badb8c..d5aeeefed59 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Fresnel-Equation-Node.md @@ -35,9 +35,9 @@ You can find Numerical values of refractive indices at [refractiveindex.info](ht ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| Mode | Dropdown | • **Schlick**: This mode produces an approximation based on [Schlick's Approximation](https://en.wikipedia.org/wiki/Schlick%27s_approximation). Use the Schlick mode for interactions between air and dielectric materials.
• **Dielectric**: Use this mode for interactions between two dielectric Materials. For example, air to glass, glass to water, or water to air.
• **DielectricGeneric**: This mode computes a [Fresnel equation](https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations) for interactions between a dielectric and a metal. For example, clear-coat- to metal, glass to metal, or water to metal.
**Note:** if the **IORMediumK** value is 0, **DielectricGeneric** behaves in the same way as the **Dielectric** mode. || +| Control | Description | +|:---|:---| +| **Mode** | Select an equation mode to affect Material interactions to the Fresnel Component. The options are:**Note:** if the **IORMediumK** value is 0, **DielectricGeneric** behaves in the same way as the **Dielectric** mode. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md b/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md index 5e0f92d1a7b..1c1ab010eaa 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Gradient-Node.md @@ -6,15 +6,15 @@ Defines a constant **Gradient** for use in [Shader Graph](index.md), although in ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| Out | Output | Gradient | Output value | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| Out | Output | Gradient | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Gradient Field | | Defines the gradient. | +| Control | Description | +|:---|:---| +| (Gradient Field) | Defines the gradient. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md b/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md index 05e4feb18b6..d843d493b6f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md +++ b/Packages/com.unity.shadergraph/Documentation~/Graph-Target.md @@ -2,8 +2,6 @@ A Target determines the end point compatibility of a shader you generate using Shader Graph. You can select Targets for each Shader Graph asset, and use the [Graph Settings Menu](Graph-Settings-Tab.md) to change the Targets. -![image](images/GraphSettings_Menu.png) - Targets hold information such as the required generation format, and variables that allow compatibility with different render pipelines or integration features like [Visual Effect Graph](https://docs.unity3d.com/Packages/com.unity.visualeffectgraph@latest). You can select any number of Targets for each Shader Graph asset. If a Target you select isn't compatible with other Targets you've already selected, an error message that explains the problem appears. Target Settings are specific to each Target, and can vary between assets depending on which Targets you've selected. Be aware that Universal Render Pipeline (URP) Target Settings and High Definition Render Pipeline (HDRP) Target Settings might change in future versions. diff --git a/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md b/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md index 017eacec8d6..e4a5dbff735 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Integer-Node.md @@ -6,15 +6,15 @@ Defines a constant **Float** value in the shader using an **Integer** field. Can ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Float | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Float | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Integer | | Defines the output value. | +| Control | Description | +|:---|:---| +| (Integer) | Defines the output value. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Internal-Inspector.md b/Packages/com.unity.shadergraph/Documentation~/Internal-Inspector.md index afd823e5887..54f4c97a9d6 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Internal-Inspector.md +++ b/Packages/com.unity.shadergraph/Documentation~/Internal-Inspector.md @@ -10,29 +10,29 @@ When you open a Shader Graph, the **Graph Inspector** displays the **[Graph Sett Select a node in the graph to display settings available for that node in the **Graph Inspector**. Settings available for that node appear in the **Node Settings** tab of the Graph Inspector. For example, if you select a Property node either in the graph or the [Blackboard](Blackboard.md), the **Node Settings** tab displays attributes of the Property that you can edit. -![](images/InternalInspectorBlackboardProperty.png) +![The Blackboard with a property selected, and the Graph Inspector showing the property settings.](images/InternalInspectorBlackboardProperty.png) Graph elements that currently work with the Graph Inspector: - [Properties](https://docs.unity3d.com/Manual/SL-Properties.html) - ![](images/InternalInspectorGraphProperty.png) + ![A property selected in the workspace, and the Graph Inspector showing the property settings.](images/InternalInspectorGraphProperty.png) - [Keywords](Keywords.md) - ![](images/keywords_enum.png) + ![The Blackboard with a keyword selected, and the Graph Inspector showing the keyword settings.](images/keywords_enum.png) - [Custom Function nodes](Custom-Function-Node.md) - ![](images/Custom-Function-Node-File.png) + ![A Custom Function node selected in the workspace, and the Graph Inspector showing the node settings.](images/Custom-Function-Node-File.png) - [Subgraph Output nodes](Sub-graph.md) - ![](images/Inspector-SubgraphOutput.png) + ![A subgraph output node selected in the workspace, and the Graph Inspector showing the node settings.](images/Inspector-SubgraphOutput.png) - [Per-node precision](Precision-Modes.md) - ![](images/Inspector-PerNodePrecision.png) + ![A node selected in the workspace, and the Graph Inspector showing the Precision setting.](images/Inspector-PerNodePrecision.png) Graph elements that currently do not work with the Graph Inspector: @@ -44,7 +44,3 @@ Graph elements that currently do not work with the Graph Inspector: ## Material Override Enabling the [Allow Material Override](surface-options.md) option in the Graph Settings makes it possible for you to override certain graph properties via the Material Inspector. - -![](images/materialoverride1.PNG) - -![](images/materialoverride2.PNG) diff --git a/Packages/com.unity.shadergraph/Documentation~/Master-Stack.md b/Packages/com.unity.shadergraph/Documentation~/Master-Stack.md index b0ffbb52f4f..442f31fa5e8 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Master-Stack.md +++ b/Packages/com.unity.shadergraph/Documentation~/Master-Stack.md @@ -4,12 +4,10 @@ The Master Stack is the end point of a Shader Graph that defines the final surface appearance of a shader. Your Shader Graph should always contain only one Master Stack. -![image](images/MasterStack_Populated.png) - The content of the Master Stack might change depending on the [Graph Settings](Graph-Settings-Tab.md) you select. The Master Stack is made up of Contexts, which contain [Block nodes](Block-Node.md). -## Contexts +![The Master Stack display, showing the Vertex and Fragment contexts populated with Block nodes.](images/MasterStack_Populated.png) -![image](images/MasterStack_Empty.png) +## Contexts The Master Stack contains two Contexts: Vertex and Fragment. These represent the two stages of a shader. Nodes that you connect to Blocks in the Vertex Context become part of the final shader's vertex function. Nodes that you connect to Blocks in the Fragment Context become part of the final shader's fragment (or pixel) function. If you connect any nodes to both Contexts, they are executed twice, once in the vertex function and then again in the fragment function. You can't cut, copy, or paste Contexts. diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md index e796a580c14..b5fed26f801 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-2x2-Node.md @@ -6,15 +6,15 @@ Defines a constant **Matrix 2x2** value in the shader. ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Matrix 2 | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Matrix 2 | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Matrix 2x2 | | Sets output value | +| Control | Description | +|:---|:---| +| (Matrix 2x2) | Sets the matrix 2x2 output value. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md index 03284e6b3f4..071fd6ac21b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-3x3-Node.md @@ -6,15 +6,15 @@ Defines a constant **Matrix 3x3** value in the shader. ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Matrix 3 | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Matrix 3 | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Matrix 3x3 | | Sets output value | +| Control | Description | +|:---|:---| +| (Matrix 3x3) | Sets the matrix 3x3 output value. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md index cd33295a17c..4d1ba1d3766 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-4x4-Node.md @@ -6,15 +6,15 @@ Defines a constant **Matrix 4x4** value in the shader. ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Matrix 4 | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Matrix 4 | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Matrix 4x4 | | Sets output value | +| Control | Description | +|:---|:---| +| (Matrix 4x4) | Sets the matrix 4x4 output value. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md index b7a639342e2..42b2e7403fe 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Construction-Node.md @@ -15,21 +15,21 @@ For example, connecting **Vector 2** type values to inputs **M0** and **M1** wil ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| M0 | Input | Vector 4 | First row or column | -| M1 | Input | Vector 4 | Second row or column | -| M2 | Input | Vector 4 | Third row or column | -| M3 | Input | Vector 4 | Fourth row or column | -| 4x4 | Output | Matrix 4x4 | Output as Matrix 4x4 | -| 3x3 | Output | Matrix 3x3 | Output as Matrix 3x3 | -| 2x2 | Output | Matrix 2x2 | Output as Matrix 2x2 | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| M0 | Input | Vector 4 | First row or column | +| M1 | Input | Vector 4 | Second row or column | +| M2 | Input | Vector 4 | Third row or column | +| M3 | Input | Vector 4 | Fourth row or column | +| 4x4 | Output | Matrix 4x4 | Output as Matrix 4x4 | +| 3x3 | Output | Matrix 3x3 | Output as Matrix 3x3 | +| 2x2 | Output | Matrix 2x2 | Output as Matrix 2x2 | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Dropdown | Row, Column | Selects how the output matrix should be filled | +| Control | Description | +|:---|:---| +| (Dropdown) | Selects how the output matrix should be filled. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md b/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md index a0836b235d6..d0b82c8a50b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Matrix-Split-Node.md @@ -15,19 +15,19 @@ For example, connecting **Matrix 2x2** type to input **In** will return the corr ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| In | Input | Dynamic Matrix | Input value | -| M0 | Output | Dynamic Vector | First row or column | -| M1 | Output | Dynamic Vector | Second row or column | -| M2 | Output | Dynamic Vector | Third row or column | -| M3 | Output | Dynamic Vector | Fourth row or column | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| In | Input | Dynamic Matrix | Input value | +| M0 | Output | Dynamic Vector | First row or column | +| M1 | Output | Dynamic Vector | Second row or column | +| M2 | Output | Dynamic Vector | Third row or column | +| M3 | Output | Dynamic Vector | Fourth row or column | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Dropdown | Row, Column | Selects how the output vectors should be filled | +| Control | Description | +|:---|:---| +| (Dropdown) | Selects how the output vectors should be filled. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md b/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md index c441a319273..7f48676d22f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md +++ b/Packages/com.unity.shadergraph/Documentation~/Port-Bindings.md @@ -8,15 +8,15 @@ In practice this means that if no [Edge](Edge.md) is connected to the [Port](Por ## Port Bindings List -| Name | Data Type | Options | Description | -|:------------|:----------|:------------------|:------------| -| Bitangent | Vector 3 | | Vertex or fragment bitangent, label describes expected transform space | -| Color | Vector 4 | |RGBA Color picker | -| ColorRGB | Vector 3 | | RGB Color picker | -| Normal | Vector 3 | | Vertex or fragment normal vector, label describes expected transform space | -| Position | Vector 3 | | Vertex or fragment position, label describes expected transform space | -| Screen Position | Vector 4 | | Default, Raw, Center, Tiled | Vertex or fragment position in screen space. Dropdown selects mode. See [Screen Position Node](Screen-Position-Node.md) for details | -| Tangent | Vector 3 | | Vertex or fragment tangent vector, label describes expected transform space | -| UV | Vector 2 | | UV0, UV1, UV2, UV3 | Mesh UV coordinates. Dropdown selects UV channel. | -| Vertex Color | Vector 4 | | RGBA vertex color value. | -| View Direction | Vector 3 | | Vertex or fragment view direction vector, label describes expected transform space | +| Name | Data Type | Description | +|:---|:---|:---| +| Bitangent | Vector 3 | Vertex or fragment bitangent, label describes expected transform space | +| Color | Vector 4 |RGBA Color picker | +| ColorRGB | Vector 3 | RGB Color picker | +| Normal | Vector 3 | Vertex or fragment normal vector, label describes expected transform space | +| Position | Vector 3 | Vertex or fragment position, label describes expected transform space | +| Screen Position | Vector 4 | Default, Raw, Center, Tiled | Vertex or fragment position in screen space. Dropdown selects mode. See [Screen Position Node](Screen-Position-Node.md) for details | +| Tangent | Vector 3 | Vertex or fragment tangent vector, label describes expected transform space | +| UV | Vector 2 | UV0, UV1, UV2, UV3 | Mesh UV coordinates. Dropdown selects UV channel. | +| Vertex Color | Vector 4 | RGBA vertex color value. | +| View Direction | Vector 3 | Vertex or fragment view direction vector, label describes expected transform space | diff --git a/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md b/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md index 88a30a7003c..50cc3676d9c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md +++ b/Packages/com.unity.shadergraph/Documentation~/Precision-Modes.md @@ -23,7 +23,7 @@ To visualize data precision in a graph, set the [**Color Mode**](Color-Modes.md) * **Half** nodes are red * **Switchable** nodes are Green. -![](images/Color-Mode-Precision.png) +![A graph showing nodes with different colors according to their data precision.](images/Color-Mode-Precision.png) ### Setting graph Precision To set the default precision for the entire graph to **Single** or **Half**, open the **Graph Settings** and set the Precision property. Newly-created nodes in a graph default to the **Inherit** precision mode, and inherit the graph's precision. @@ -51,7 +51,7 @@ Simple inheritance refers to the inheritance behaviour of a node with only one p In the figure below, Node A has the **Inherit** mode. Because it has no incoming edge, it takes the **Graph Precision**, which is **Half**. Node B also has the **Inherit** mode, so it inherits the **Half** precision mode from Node A. -![](images/precisionmodes1.png) +![Diagram showing a simple precision inheritance.](images/precisionmodes1.png) #### Complex inheritance @@ -61,7 +61,7 @@ A node reads precision settings from each input port. If you connect a node to s In the figure below, node D has the **Inherit** mode. It receives input from the adjacent edges via inputs 1 and 2. Node B passes the **Half** mode through input 1. Node C passes the **Single** mode through input 2. Because **Single** is 32-bit and **Half** only 16-bit, **Single** takes precedence, so Node D uses **Single** precision. -![](images/precisionmodes2.png) +![Diagram showing a complex precision inheritance.](images/precisionmodes2.png) #### Mixed inheritance @@ -69,13 +69,13 @@ Mixed inheritance refers to the inheritance behaviour on a node with both simple Nodes with no input ports, such as [Input nodes](Input-Nodes.md), inherit the **Graph Precision**. However, complex inheritance rules still affect other nodes in the same group, as illustrated in the figure below. -![](images/precisionmodes3.png) +![Diagram showing a mixed precision inheritance.](images/precisionmodes3.png) ### Switchable precision The **Switchable** mode overrides **Half** mode but not **Single**. -![](images/precisionmodes4.png) +![Diagram showing precision inheritance with the Switchable mode.](images/precisionmodes4.png) ### Sub Graph precision diff --git a/Packages/com.unity.shadergraph/Documentation~/Preview-Mode-Control.md b/Packages/com.unity.shadergraph/Documentation~/Preview-Mode-Control.md index a84d8c4d489..bf896cfda4f 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Preview-Mode-Control.md +++ b/Packages/com.unity.shadergraph/Documentation~/Preview-Mode-Control.md @@ -13,16 +13,16 @@ This mode control functionality also applies to Sub Graph previews. See [Graph S ## How to use For nodes: + 1. Add a node which includes a preview. 2. Select the node. 3. In the Graph Inspector or Node Settings, find the Preview control. 4. Select an option. - For SubGraphs: + * Select a mode in the [Sub Graph](Sub-graph.md) [Graph Settings](Graph-Settings-Tab.md) menu. -![](images/previewmodecontrol.png) +## Additional resources -Related -[Preview node](Preview-Node.md) +* [Preview node](Preview-Node.md) diff --git a/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md b/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md index 08ae33abe4d..b453bd94122 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Rectangle-Node.md @@ -8,18 +8,18 @@ NOTE: This [Node](Node.md) can only be used in the **Fragment** [Shader Stage](S ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| UV | Input | Vector 2 | UV | Input UV value | -| Width | Input | Float | None | Rectangle width | -| Height | Input | Float | None | Rectangle height | -| Out | Output | Float | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| UV | Input | Vector 2 | UV | Input UV value | +| Width | Input | Float | None | Rectangle width | +| Height | Input | Float | None | Rectangle height | +| Out | Output | Float | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Dropdown | Fastest, Nicest | Robustness of computation | +| Control | Description | +|:---|:---| +| (Dropdown) | Select the robustness of computation. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md b/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md index 8cb41cadb4d..f39b0b57576 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Refract-Node.md @@ -25,9 +25,9 @@ The Refract node uses the principles described in [Snell's Law](https://en.wikip ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| Mode | Dropdown | • **Safe:** Returns a null vector result instead of a NaN result at the point of critical angle refraction.
• **CriticalAngle:** Avoids the **Safe** check for a potential NaN result. || +| Control | Description | +|:---|:---| +| **Mode** | Select a mode to handle results at the point of critical angle refraction. The options are: | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md index d49036d4740..c4f124860b7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md +++ b/Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Window.md @@ -21,18 +21,16 @@ To access the **Shader Graph Window**, you must first create a [Shader Graph Ass Use the **Shader Graph Window** toolbar to manage the shader graph asset, display elements in the window, and more. -| Icon | Item | Description | -|:--------------------|:--------------------|:------------| -| ![Image](images/sg-save-icon.png) | **Save Asset** | Save the graph to update the [Shader Graph Asset](index.md). | -| ![Image](images/sg-dropdown-icon.png) | **Save As** | Save the [Shader Graph Asset](index.md) under a new name. | -| | **Show In Project** | Highlight the [Shader Graph Asset](index.md) in the [Project Window](https://docs.unity3d.com/Manual/ProjectView.html). | -| | **Check Out** | If version control is enabled, check out the [Shader Graph Asset](index.md) from the source control provider. | -| ![Image](images/sg-color-mode-selector.png) | **Color Mode Selector** | Select a [Color Mode](Color-Modes.md) for the graph. | -| ![Image](images/sg-blackboard-icon.png) | **Blackboard** | Toggle the visibility of the [Blackboard](Blackboard.md). | -| ![Image](images/sg-graph-inspector-icon.png) | **Graph Inspector** | Toggle the visibility of the [Graph Inspector](Internal-Inspector.md). | -| ![Image](images/sg-main-preview-icon.png) | **Main Preview** | Toggle the visibility of the [Main Preview](Main-Preview.md). | -| ![Image](images/sg-help_icon.png) | **Help** | Open the Shader Graph documentation in the browser. | -| ![Image](images/sg-dropdown-icon.png) | **Resources** | Contains links to Shader Graph resources (like samples and User forums). | +| Icon | Item | Description | +|:---|:---|:---| +| ![The Save Asset icon](images/sg-save-icon.png) | **Save Asset** | Save the graph to update the [Shader Graph Asset](index.md). | +| ![The asset file management icon](images/sg-dropdown-icon.png) | **Asset file management** | Use additional options to manage the graph asset file. The options are: | +| ![The Color Mode Selector icon](images/sg-color-mode-selector.png) | **Color Mode Selector** | Select a [Color Mode](Color-Modes.md) for the graph. | +| ![The Blackboard icon](images/sg-blackboard-icon.png) | **Blackboard** | Toggle the visibility of the [Blackboard](Blackboard.md). | +| ![The Graph Inspector icon](images/sg-graph-inspector-icon.png) | **Graph Inspector** | Toggle the visibility of the [Graph Inspector](Internal-Inspector.md). | +| ![The Main Preview icon](images/sg-main-preview-icon.png) | **Main Preview** | Toggle the visibility of the [Main Preview](Main-Preview.md). | +| ![The Help icon](images/sg-help_icon.png) | **Help** | Open the Shader Graph documentation in the browser. | +| ![The Resources icon](images/sg-dropdown-icon.png) | **Resources** | Contains links to Shader Graph resources (like samples and User forums). | ## Workspace diff --git a/Packages/com.unity.shadergraph/Documentation~/ShaderGraph-Samples.md b/Packages/com.unity.shadergraph/Documentation~/ShaderGraph-Samples.md index 655b96c16ff..4d154c480cc 100644 --- a/Packages/com.unity.shadergraph/Documentation~/ShaderGraph-Samples.md +++ b/Packages/com.unity.shadergraph/Documentation~/ShaderGraph-Samples.md @@ -22,27 +22,27 @@ The following samples are currently available for Shader Graph. | Procedural Patterns | |:--------------------| -|![](images/Patterns_Page.png) | +|![A visual overview of Procedural Patterns](images/Patterns_Page.png) | | This collection of Assets showcases various procedural techniques possible with Shader Graph. Use them directly in your Project, or edit them to create other procedural patterns. The patterns in this collection are: Bacteria, Brick, Dots, Grid, Herringbone, Hex Lattice, Houndstooth, Smooth Wave, Spiral, Stripes, Truchet, Whirl, Zig Zag. | | Node Reference | |:--------------------| -|![](images/NodeReferenceSamples.png) | +|![A visual overview of Node Reference](images/NodeReferenceSamples.png) | | This set of Shader Graph assets provides reference material for the nodes available in the Shader Graph node library. Each graph contains a description for a specific node, examples of how it can be used, and useful tips. Some example assets also show a break-down of the math that the node is doing. You can use these samples along with the documentation to learn more about the behavior of individual nodes. | | [Feature Examples](Shader-Graph-Sample-Feature-Examples.md) | |:--------------------| -|![](images/FeatureExamplesSample.png) | +|![A visual overview of Feature Examples](images/FeatureExamplesSample.png) | | This is a collection of over 30 Shader Graph files. Each file demonstrates a specific shader technique such as angle blending, triplanar projection, parallax mapping, and custom lighting. While you won’t use these shaders directly in your project, you can use them to quickly learn and understand the various techniques, and recreate them into your own work. Each file contains notes that describe what the shader is doing, and most of the shaders are set up with the core functionality contained in a subgraph that’s easy to copy and paste directly into your own shader. The sample also has extensive documentation describing each of the samples to help you learn. | [Production Ready Shaders](Shader-Graph-Sample-Production-Ready.md) | |:--------------------| -|![](images/ProductionReadySample.png) | +|![A visual example of Production Ready Shaders](images/ProductionReadySample.png) | | The Shader Graph Production Ready Shaders sample is a collection of Shader Graph shader assets that are ready to be used out of the box or modified to suit your needs. You can take them apart and learn from them, or just drop them directly into your project and use them as they are. The sample includes the Shader Graph versions of the HDRP and URP Lit shaders. It also includes a step-by-step tutorial for how to combine several of the shaders to create a forest stream environment. | [UGUI Shaders](Shader-Graph-Sample-UGUI-Shaders.md) | |:--------------------| -|![](images/UIToolsSample.png) | +|![A visual example of UGUI Shaders](images/UIToolsSample.png) | | The Shader Graph UGUI Shaders sample is a collection of Shader Graph subgraphs that you can use to build user interface elements. They speed up the process of building widgets, buttons, and backgrounds for the user interface of your project. With these tools, you can build dynamic, procedural UI elements that don’t require any texture memory and scale correctly for any resolution screen. In addition to the subgraphs, the sample also includes example buttons, indicators, and backgrounds built with the subgraphs. The examples show how the subgraphs function in context and help you learn how to use them. diff --git a/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md b/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md index 593c76aebad..7cd0030551c 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Slider-Node.md @@ -6,17 +6,17 @@ Defines a constant **Float** value in the shader using a **Slider** field. Can b ## Ports -| Name | Direction | Type | Binding | Description | -|:------------ |:-------------|:-----|:---|:---| -| Out | Output | Float | None | Output value | +| Name | Direction | Type | Binding | Description | +|:--- |:---|:---|:---|:---| +| Out | Output | Float | None | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Slider | | Defines the output value. | -| Min | Float | | Defines the slider parameter's minimum value. | -| Max | Float | | Defines the slider parameter's maximum value. | +| Name | Type | Options | Description | +|:--- |:---|:---|:---| +| | Slider | | Defines the output value. | +| Min | Float | | Defines the slider parameter's minimum value. | +| Max | Float | | Defines the slider parameter's maximum value. | ## Generated Code Example 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 e63a7294c5c..6a619f89c58 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Split-Texture-Transform-Node.md @@ -7,7 +7,7 @@ This node outputs the texture with its tiling set to (0,0) and scale set to (1,1 Another term you may hear for tiling in this context is scale. Both terms refer to the size of the texture tiles. -![](images/node-splittexturetransform.png) +![The Split Texture Transform node](images/node-splittexturetransform.png) ### Ports diff --git a/Packages/com.unity.shadergraph/Documentation~/Sticky-Notes.md b/Packages/com.unity.shadergraph/Documentation~/Sticky-Notes.md index bb391f76915..ab0f3ffb3f2 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Sticky-Notes.md +++ b/Packages/com.unity.shadergraph/Documentation~/Sticky-Notes.md @@ -13,8 +13,6 @@ To create a Sticky Note, right-click an empty space in the graph view and, in th * **Title**: The text area at the top of the Sticky Note is the title. You can use it to concisely describe what information the Sticky Note contains. * **Body**: The larger text area below the title area is the body. You can write the full contents of the note here. -![](images/StickyNote.png) - ### Editing text To edit text on a Sticky Note, double-click on a text area. This also selects the entire text area, so be sure to move the cursor before you edit the text. diff --git a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md index 64e16a28c85..2fe97654d6b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/Packages/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -116,7 +116,7 @@ * [Gradient](Gradient-Node.md) * [Sample Gradient](Sample-Gradient-Node.md) * High Definition Render Pipeline - * [Custom Color Buffer](HD-Custom-Color-Node.md) + * [Custom Color Buffer](Custom-Color-Buffer-Node.md) * [Custom Depth Buffer](HD-Custom-Depth-Node.md) * [Diffusion Profile](Diffusion-Profile-Node.md) * [Exposure](Exposure-Node.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 37120cce91a..b9eda3a25ff 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 @@ -6,15 +6,15 @@ Defines a constant **Texture 2D Array Asset** for use in the shader. To sample t ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| Out | Output | Texture 2D Array | Output value | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| Out | Output | Texture 2D Array | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Object Field (Texture 2D Array) | | Defines the texture 2D array asset from the project. | +| Control | Description | +|:--- |:---| +| (Texture 2D Array) | Defines the texture 2D array asset from the project. | ## Generated Code Example 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 76f924e8b40..8868ed3c05b 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-2D-Asset-Node.md @@ -6,15 +6,15 @@ Defines a constant **Texture 2D Asset** for use in the shader. To sample the **T ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| Out | Output | Texture 2D | Output value | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| Out | Output | Texture 2D | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Object Field (Texture) | | Defines the texture 3D asset from the project. | +| Control | Description | +|:--- |:---| +| (Texture) | Defines the texture 3D asset from the project. | ## Generated Code Example 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 82bbddd03b9..efa5a10b0b7 100644 --- a/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/Texture-3D-Asset-Node.md @@ -6,15 +6,15 @@ Defines a constant **Texture 3D Asset** for use in the shader. To sample the **T ## Ports -| Name | Direction | Type | Description | -|:------------ |:-------------|:-----|:---| -| Out | Output | Texture 3D | Output value | +| Name | Direction | Type | Description | +|:--- |:---|:---|:---| +| Out | Output | Texture 3D | Output value | ## Controls -| Name | Type | Options | Description | -|:------------ |:-------------|:-----|:---| -| | Object Field (Texture 3D) | | Defines the texture 3D asset from the project. | +| Control | Description | +|:--- |:---| +| (Texture 3D) | Defines the texture 3D asset from the project. | ## Generated Code Example diff --git a/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md b/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md index 2594ce32ebf..c765cd3af94 100644 --- a/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md +++ b/Packages/com.unity.shadergraph/Documentation~/ThreadMapDetail-Node.md @@ -26,131 +26,30 @@ The ThreadMapDetail node is under the **Utility** > **High Definition Render [!include[nodes-inputs](./snippets/nodes-inputs.md)] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeBindingDescription
Use Thread MapBooleanNoneUse the port's default input to enable or disable the ThreadMapDetail node. You can also connect a node that outputs a Boolean to choose when to enable or disable the thread map.
ThreadMapTexture 2DNoneThe texture that contains the detailed information of a fabric's thread pattern. The texture should contain 4 channels: -
    -
  • R - The ambient occlusion
  • -
  • G - The normal Y-axis
  • -
  • B - The smoothness
  • -
  • A - The normal X-axis
  • -
-
UVVector 2UVThe UV coordinates the ThreadMapDetail node should use to map the ThreadMap texture on the geometry.
NormalsVector 3NoneThe base normal map that you want your Shader Graph to apply to the geometry before it applies the thread map.
SmoothnessFloatNoneThe base smoothness value that you want your Shader Graph to apply to the geometry before it applies the thread map.
AlphaFloatNoneThe base alpha value that you want your Shader Graph to apply to the geometry before it applies the thread map.
Ambient OcclusionFloatNoneThe base ambient occlusion value that you want your Shader Graph to apply to the geometry before it applies the thread map.
Thread AO StrengthFloatNoneSpecify a value of 0 or 1 to determine how the ThreadMap's ambient occlusion should impact the final shader result: -
    -
  • If you provide a value of 0, the ThreadMap's ambient occlusion has no effect on the final output of the shader.
  • -
  • If you provide a value of 1, Shader Graph multiplies your base Ambient Occlusion value by the ambient occlusion value specified in your ThreadMap to determine the final output of the shader.
Thread Normal StrengthFloatNoneSpecify a value of 0 or 1 to determine how the ThreadMap's normal should impact the final shader result: -
    -
  • If you provide a value of 0, the ThreadMap's normal has no effect on the final output of the shader.
  • -
  • If you provide a value of 1, Shader Graph blends the values from your base Normals with the normal specified in your ThreadMap to determine the final output of the shader.
Thread Smoothness StrengthFloatNoneSpecify a value of 0 or 1 to determine how the ThreadMap's smoothness should impact the final shader result: -
    -
  • If you provide a value of 0, the ThreadMap's smoothness value has no effect on the final output of the shader.
  • -
  • If you provide a value of 1, Shader Graph adds the smoothness value specified in your ThreadMap to your base Smoothness value to determine the final output of the shader. For this calculation, Shader Graph remaps the value of your ThreadMap's smoothness from (0,1) to (-1, 1).
+| **Name** | **Type** | **Binding** | **Description** | +| :--- | :--- | :--- | :--- | +| **Use Thread Map** | Boolean | None | Use the port's default input to enable or disable the ThreadMapDetail node. You can also connect a node that outputs a Boolean to choose when to enable or disable the thread map. | +| **ThreadMap** | Texture 2D | None | The texture that contains the detailed information of a fabric's thread pattern. The texture should contain 4 channels: