From d792bff8f3995f872317bb8b4d8964566cd9585d Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Mon, 11 Oct 2021 13:04:22 +0200 Subject: [PATCH 01/22] Change Distortionblur default value to 0 --- .../Editor/Material/ShaderGraph/HDBlockFields.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDBlockFields.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDBlockFields.cs index 4aa022f155d..dab9103680e 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDBlockFields.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDBlockFields.cs @@ -40,7 +40,7 @@ public struct SurfaceDescription public static BlockFieldDescriptor Distortion = new BlockFieldDescriptor(SurfaceDescription.name, "Distortion", "SURFACEDESCRIPTION_DISTORTION", new Vector2Control(Vector2.zero), ShaderStage.Fragment); // TODO: Lit is Vector2(2.0f, -1.0f) public static BlockFieldDescriptor DistortionBlur = new BlockFieldDescriptor(SurfaceDescription.name, "DistortionBlur", "Distortion Blur", "SURFACEDESCRIPTION_DISTORTIONBLUR", - new FloatControl(1.0f), ShaderStage.Fragment); + new FloatControl(0.0f), ShaderStage.Fragment); public static BlockFieldDescriptor ShadowTint = new BlockFieldDescriptor(SurfaceDescription.name, "ShadowTint", "Shadow Tint", "SURFACEDESCRIPTION_SHADOWTINT", new ColorRGBAControl(Color.black), ShaderStage.Fragment); From 21ff6a6cbedc3352efb8c95ddb1a5c8825970810 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Fri, 22 Oct 2021 11:57:11 +0200 Subject: [PATCH 02/22] tmp --- .../Material/UIBlocks/LitSurfaceInputsUIBlock.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs index aa1ee5f2315..09a1eaec983 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs @@ -51,6 +51,7 @@ internal class Styles public static GUIContent aoRemappingText = new GUIContent("Ambient Occlusion Remapping", "Controls a remap for the ambient occlusion channel in the Mask Map."); public static GUIContent maskMapSText = new GUIContent("Mask Map", "Specifies the Mask Map for this Material - Metallic (R), Ambient occlusion (G), Detail mask (B), Smoothness (A)."); public static GUIContent maskMapSpecularText = new GUIContent("Mask Map", "Specifies the Mask Map for this Material - Ambient occlusion (G), Detail mask (B), Smoothness (A)."); + //public static GUIContent transparencyRemappingText = new GUIContent("Transparency Remapping", "Controls a remap for the alpha channel in the Base Color."); public static GUIContent normalMapSpaceText = new GUIContent("Normal Map Space", ""); public static GUIContent normalMapText = new GUIContent("Normal Map", "Specifies the Normal Map for this Material (BC7/BC5/DXT5(nm)) and controls its strength."); @@ -132,6 +133,12 @@ internal class Styles const string kAORemapMin = "_AORemapMin"; MaterialProperty[] aoRemapMax = new MaterialProperty[kMaxLayerCount]; const string kAORemapMax = "_AORemapMax"; + + //MaterialProperty[] transparencyRemapMin = new MaterialProperty[kMaxLayerCount]; + //const string kTransparencyRemapMin = "_TransparencyRemapMin"; + //MaterialProperty[] transparencyRemapMax = new MaterialProperty[kMaxLayerCount]; + //const string kTransparencyRemapMax = "_TransparencyRemapMax"; + MaterialProperty[] maskMap = new MaterialProperty[kMaxLayerCount]; MaterialProperty[] normalScale = new MaterialProperty[kMaxLayerCount]; const string kNormalScale = "_NormalScale"; @@ -270,6 +277,10 @@ public override void LoadMaterialProperties() smoothnessRemapMax = FindPropertyLayered(kSmoothnessRemapMax, m_LayerCount); aoRemapMin = FindPropertyLayered(kAORemapMin, m_LayerCount); aoRemapMax = FindPropertyLayered(kAORemapMax, m_LayerCount); + + //transparencyRemapMin = FindPropertyLayered(kTransparencyRemapMin, m_LayerCount); + //transparencyRemapMax = FindPropertyLayered(kTransparencyRemapMax, m_LayerCount); + maskMap = FindPropertyLayered(kMaskMap, m_LayerCount); normalMap = FindPropertyLayered(kNormalMap, m_LayerCount); normalMapOS = FindPropertyLayered(kNormalMapOS, m_LayerCount); @@ -385,6 +396,11 @@ void DrawSurfaceInputsGUI() materialEditor.MinMaxShaderProperty(aoRemapMin[m_LayerIndex], aoRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.aoRemappingText); } + //if (baseColorMap[m_LayerIndex].textureValue != null) + //{ + // materialEditor.MinMaxShaderProperty(transparencyRemapMin[m_LayerIndex], transparencyRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); + //} + materialEditor.TexturePropertySingleLine((materials.All(m => m.GetMaterialId() == MaterialId.LitSpecular)) ? Styles.maskMapSpecularText : Styles.maskMapSText, maskMap[m_LayerIndex]); materialEditor.ShaderProperty(normalMapSpace[m_LayerIndex], Styles.normalMapSpaceText); From a7b3f8f9f77c998a5bcd031ccbbde91e588ec21c Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 2 Nov 2021 15:49:40 +0100 Subject: [PATCH 03/22] Add Remap Transparency for Lit, LitTessellation, LayeredLit --- .../UIBlocks/LitSurfaceInputsUIBlock.cs | 25 +++++++++---------- .../Material/LayeredLit/LayeredLit.shader | 10 ++++++++ .../LayeredLit/LayeredLitTessellation.shader | 10 ++++++++ .../Runtime/Material/Lit/Lit.shader | 2 ++ .../Material/Lit/LitDataIndividualLayer.hlsl | 1 + .../Runtime/Material/Lit/LitProperties.hlsl | 14 +++++++++++ .../Material/Lit/LitTessellation.shader | 2 ++ 7 files changed, 51 insertions(+), 13 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs index 09a1eaec983..e5474f5cf55 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs @@ -51,7 +51,7 @@ internal class Styles public static GUIContent aoRemappingText = new GUIContent("Ambient Occlusion Remapping", "Controls a remap for the ambient occlusion channel in the Mask Map."); public static GUIContent maskMapSText = new GUIContent("Mask Map", "Specifies the Mask Map for this Material - Metallic (R), Ambient occlusion (G), Detail mask (B), Smoothness (A)."); public static GUIContent maskMapSpecularText = new GUIContent("Mask Map", "Specifies the Mask Map for this Material - Ambient occlusion (G), Detail mask (B), Smoothness (A)."); - //public static GUIContent transparencyRemappingText = new GUIContent("Transparency Remapping", "Controls a remap for the alpha channel in the Base Color."); + public static GUIContent transparencyRemappingText = new GUIContent("Transparency Remapping", "Controls a remap for the alpha channel in the Base Color."); public static GUIContent normalMapSpaceText = new GUIContent("Normal Map Space", ""); public static GUIContent normalMapText = new GUIContent("Normal Map", "Specifies the Normal Map for this Material (BC7/BC5/DXT5(nm)) and controls its strength."); @@ -129,16 +129,15 @@ internal class Styles const string kSmoothnessRemapMin = "_SmoothnessRemapMin"; MaterialProperty[] smoothnessRemapMax = new MaterialProperty[kMaxLayerCount]; const string kSmoothnessRemapMax = "_SmoothnessRemapMax"; + MaterialProperty[] transparencyRemapMin = new MaterialProperty[kMaxLayerCount]; + const string kTransparencyRemapMin = "_TransparencyRemapMin"; + MaterialProperty[] transparencyRemapMax = new MaterialProperty[kMaxLayerCount]; + const string kTransparencyRemapMax = "_TransparencyRemapMax"; MaterialProperty[] aoRemapMin = new MaterialProperty[kMaxLayerCount]; const string kAORemapMin = "_AORemapMin"; MaterialProperty[] aoRemapMax = new MaterialProperty[kMaxLayerCount]; const string kAORemapMax = "_AORemapMax"; - //MaterialProperty[] transparencyRemapMin = new MaterialProperty[kMaxLayerCount]; - //const string kTransparencyRemapMin = "_TransparencyRemapMin"; - //MaterialProperty[] transparencyRemapMax = new MaterialProperty[kMaxLayerCount]; - //const string kTransparencyRemapMax = "_TransparencyRemapMax"; - MaterialProperty[] maskMap = new MaterialProperty[kMaxLayerCount]; MaterialProperty[] normalScale = new MaterialProperty[kMaxLayerCount]; const string kNormalScale = "_NormalScale"; @@ -269,18 +268,18 @@ public override void LoadMaterialProperties() baseColor = FindPropertyLayered(kBaseColor, m_LayerCount); baseColorMap = FindPropertyLayered(kBaseColorMap, m_LayerCount); + metallic = FindPropertyLayered(kMetallic, m_LayerCount); metallicRemapMin = FindPropertyLayered(kMetallicRemapMin, m_LayerCount); metallicRemapMax = FindPropertyLayered(kMetallicRemapMax, m_LayerCount); smoothness = FindPropertyLayered(kSmoothness, m_LayerCount); smoothnessRemapMin = FindPropertyLayered(kSmoothnessRemapMin, m_LayerCount); smoothnessRemapMax = FindPropertyLayered(kSmoothnessRemapMax, m_LayerCount); + transparencyRemapMin = FindPropertyLayered(kTransparencyRemapMin, m_LayerCount); + transparencyRemapMax = FindPropertyLayered(kTransparencyRemapMax, m_LayerCount); aoRemapMin = FindPropertyLayered(kAORemapMin, m_LayerCount); aoRemapMax = FindPropertyLayered(kAORemapMax, m_LayerCount); - //transparencyRemapMin = FindPropertyLayered(kTransparencyRemapMin, m_LayerCount); - //transparencyRemapMax = FindPropertyLayered(kTransparencyRemapMax, m_LayerCount); - maskMap = FindPropertyLayered(kMaskMap, m_LayerCount); normalMap = FindPropertyLayered(kNormalMap, m_LayerCount); normalMapOS = FindPropertyLayered(kNormalMapOS, m_LayerCount); @@ -396,10 +395,10 @@ void DrawSurfaceInputsGUI() materialEditor.MinMaxShaderProperty(aoRemapMin[m_LayerIndex], aoRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.aoRemappingText); } - //if (baseColorMap[m_LayerIndex].textureValue != null) - //{ - // materialEditor.MinMaxShaderProperty(transparencyRemapMin[m_LayerIndex], transparencyRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); - //} + if (baseColorMap[m_LayerIndex].textureValue != null && materials.All(m => m.GetSurfaceType() != SurfaceType.Transparent)) + { + materialEditor.MinMaxShaderProperty(transparencyRemapMin[m_LayerIndex], transparencyRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); + } materialEditor.TexturePropertySingleLine((materials.All(m => m.GetMaterialId() == MaterialId.LitSpecular)) ? Styles.maskMapSpecularText : Styles.maskMapSText, maskMap[m_LayerIndex]); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader index 492e72d7ebf..a3b9941ec1e 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader @@ -49,6 +49,16 @@ Shader "HDRP/LayeredLit" _SmoothnessRemapMax2("SmoothnessRemapMax2", Range(0.0, 1.0)) = 1.0 _SmoothnessRemapMax3("SmoothnessRemapMax3", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMin0("TransparencyRemapMin0", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin1("TransparencyRemapMin1", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin2("TransparencyRemapMin2", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin3("TransparencyRemapMin3", Range(0.0, 1.0)) = 0.0 + + _TransparencyRemapMax0("TransparencyRemapMax0", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax1("TransparencyRemapMax1", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax2("TransparencyRemapMax2", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax3("TransparencyRemapMax3", Range(0.0, 1.0)) = 1.0 + _AORemapMin0("AORemapMin0", Range(0.0, 1.0)) = 0.0 _AORemapMin1("AORemapMin1", Range(0.0, 1.0)) = 0.0 _AORemapMin2("AORemapMin2", Range(0.0, 1.0)) = 0.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader index a53038b26b5..abd0b034fb2 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader @@ -49,6 +49,16 @@ Shader "HDRP/LayeredLitTessellation" _SmoothnessRemapMax2("SmoothnessRemapMax2", Range(0.0, 1.0)) = 1.0 _SmoothnessRemapMax3("SmoothnessRemapMax3", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMin0("TransparencyRemapMin0", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin1("TransparencyRemapMin1", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin2("TransparencyRemapMin2", Range(0.0, 1.0)) = 0.0 + _TransparencyRemapMin3("TransparencyRemapMin3", Range(0.0, 1.0)) = 0.0 + + _TransparencyRemapMax0("TransparencyRemapMax0", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax1("TransparencyRemapMax1", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax2("TransparencyRemapMax2", Range(0.0, 1.0)) = 1.0 + _TransparencyRemapMax3("TransparencyRemapMax3", Range(0.0, 1.0)) = 1.0 + _AORemapMin0("AORemapMin0", Range(0.0, 1.0)) = 0.0 _AORemapMin1("AORemapMin1", Range(0.0, 1.0)) = 0.0 _AORemapMin2("AORemapMin2", Range(0.0, 1.0)) = 0.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader index 845b9d4293e..ca984ef01f9 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader @@ -17,6 +17,8 @@ Shader "HDRP/Lit" _MetallicRemapMax("MetallicRemapMax", Float) = 1.0 _SmoothnessRemapMin("SmoothnessRemapMin", Float) = 0.0 _SmoothnessRemapMax("SmoothnessRemapMax", Float) = 1.0 + _TransparencyRemapMin("TransparencyRemapMin", Float) = 0.0 + _TransparencyRemapMax("TransparencyRemapMax", Float) = 1.0 _AORemapMin("AORemapMin", Float) = 0.0 _AORemapMax("AORemapMax", Float) = 1.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl index 39dc46d0f6d..f0f87831db7 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl @@ -206,6 +206,7 @@ float ADD_IDX(GetSurfaceData)(FragInputs input, LayerTexCoord layerTexCoord, out float4 color = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_BaseColorMap), ADD_ZERO_IDX(sampler_BaseColorMap), ADD_IDX(layerTexCoord.base)).rgba * ADD_IDX(_BaseColor).rgba; surfaceData.baseColor = color.rgb; float alpha = color.a; + alpha = lerp(ADD_IDX(_TransparencyRemapMin), ADD_IDX(_TransparencyRemapMax), alpha); #ifdef _DETAIL_MAP_IDX // Goal: we want the detail albedo map to be able to darken down to black and brighten up to white the surface albedo. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl index c815b35fc68..2c5c4864865 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl @@ -156,6 +156,8 @@ float _MetallicRemapMax; float _Smoothness; float _SmoothnessRemapMin; float _SmoothnessRemapMax; +float _TransparencyRemapMin; +float _TransparencyRemapMax; float _AORemapMin; float _AORemapMax; @@ -212,6 +214,8 @@ PROP_DECL(float, _MetallicRemapMax); PROP_DECL(float, _Smoothness); PROP_DECL(float, _SmoothnessRemapMin); PROP_DECL(float, _SmoothnessRemapMax); +PROP_DECL(float, _TransparencyRemapMin); +PROP_DECL(float, _TransparencyRemapMax); PROP_DECL(float, _AORemapMin); PROP_DECL(float, _AORemapMax); @@ -403,6 +407,14 @@ UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) #define _SmoothnessRemapMax1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax1) #define _SmoothnessRemapMax2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax2) #define _SmoothnessRemapMax3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax3) +#define _TransparencyRemapMin0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin0) +#define _TransparencyRemapMin1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin1) +#define _TransparencyRemapMin2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin2) +#define _TransparencyRemapMin3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin3) +#define _TransparencyRemapMax0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax0) +#define _TransparencyRemapMax1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax1) +#define _TransparencyRemapMax2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax2) +#define _TransparencyRemapMax3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax3) #define _AORemapMin0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin0) #define _AORemapMin1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin1) #define _AORemapMin2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin2) @@ -470,6 +482,8 @@ UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) #define _Smoothness UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Smoothness) #define _SmoothnessRemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMin) #define _SmoothnessRemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax) +#define _TransparencyRemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin) +#define _TransparencyRemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax) #define _AORemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin) #define _AORemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMax) #define _DetailAlbedoScale UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _DetailAlbedoScale) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader index 572ff5c1ae2..fe233e06c34 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader @@ -17,6 +17,8 @@ Shader "HDRP/LitTessellation" _MetallicRemapMax("MetallicRemapMax", Float) = 1.0 _SmoothnessRemapMin("SmoothnessRemapMin", Float) = 0.0 _SmoothnessRemapMax("SmoothnessRemapMax", Float) = 1.0 + _TransparencyRemapMin("TransparencyRemapMin", Float) = 0.0 + _TransparencyRemapMax("TransparencyRemapMax", Float) = 1.0 _AORemapMin("AORemapMin", Float) = 0.0 _AORemapMax("AORemapMax", Float) = 1.0 From 61c2c4c137d75e9d9601ec9e8a3eb93531810351 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 2 Nov 2021 16:06:36 +0100 Subject: [PATCH 04/22] Rename 'Transparency' to 'Alpha' for remap min/max --- .../UIBlocks/LitSurfaceInputsUIBlock.cs | 16 ++++---- .../Material/LayeredLit/LayeredLit.shader | 18 ++++----- .../LayeredLit/LayeredLitTessellation.shader | 18 ++++----- .../Runtime/Material/Lit/Lit.shader | 4 +- .../Material/Lit/LitDataIndividualLayer.hlsl | 5 ++- .../Runtime/Material/Lit/LitProperties.hlsl | 38 ++++++++++++------- .../Material/Lit/LitTessellation.shader | 4 +- 7 files changed, 57 insertions(+), 46 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs index e5474f5cf55..f58d7863c73 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs @@ -129,10 +129,10 @@ internal class Styles const string kSmoothnessRemapMin = "_SmoothnessRemapMin"; MaterialProperty[] smoothnessRemapMax = new MaterialProperty[kMaxLayerCount]; const string kSmoothnessRemapMax = "_SmoothnessRemapMax"; - MaterialProperty[] transparencyRemapMin = new MaterialProperty[kMaxLayerCount]; - const string kTransparencyRemapMin = "_TransparencyRemapMin"; - MaterialProperty[] transparencyRemapMax = new MaterialProperty[kMaxLayerCount]; - const string kTransparencyRemapMax = "_TransparencyRemapMax"; + MaterialProperty[] alphaRemapMin = new MaterialProperty[kMaxLayerCount]; + const string kAlphaRemapMin = "_AlphaRemapMin"; + MaterialProperty[] alphaRemapMax = new MaterialProperty[kMaxLayerCount]; + const string kAlphaRemapMax = "_AlphaRemapMax"; MaterialProperty[] aoRemapMin = new MaterialProperty[kMaxLayerCount]; const string kAORemapMin = "_AORemapMin"; MaterialProperty[] aoRemapMax = new MaterialProperty[kMaxLayerCount]; @@ -275,8 +275,8 @@ public override void LoadMaterialProperties() smoothness = FindPropertyLayered(kSmoothness, m_LayerCount); smoothnessRemapMin = FindPropertyLayered(kSmoothnessRemapMin, m_LayerCount); smoothnessRemapMax = FindPropertyLayered(kSmoothnessRemapMax, m_LayerCount); - transparencyRemapMin = FindPropertyLayered(kTransparencyRemapMin, m_LayerCount); - transparencyRemapMax = FindPropertyLayered(kTransparencyRemapMax, m_LayerCount); + alphaRemapMin = FindPropertyLayered(kAlphaRemapMin, m_LayerCount); + alphaRemapMax = FindPropertyLayered(kAlphaRemapMax, m_LayerCount); aoRemapMin = FindPropertyLayered(kAORemapMin, m_LayerCount); aoRemapMax = FindPropertyLayered(kAORemapMax, m_LayerCount); @@ -395,9 +395,9 @@ void DrawSurfaceInputsGUI() materialEditor.MinMaxShaderProperty(aoRemapMin[m_LayerIndex], aoRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.aoRemappingText); } - if (baseColorMap[m_LayerIndex].textureValue != null && materials.All(m => m.GetSurfaceType() != SurfaceType.Transparent)) + if (baseColorMap[m_LayerIndex].textureValue != null && materials.All(m => m.GetSurfaceType() == SurfaceType.Transparent)) { - materialEditor.MinMaxShaderProperty(transparencyRemapMin[m_LayerIndex], transparencyRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); + materialEditor.MinMaxShaderProperty(alphaRemapMin[m_LayerIndex], alphaRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); } materialEditor.TexturePropertySingleLine((materials.All(m => m.GetMaterialId() == MaterialId.LitSpecular)) ? Styles.maskMapSpecularText : Styles.maskMapSText, maskMap[m_LayerIndex]); diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader index a3b9941ec1e..760a591f684 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLit.shader @@ -49,15 +49,15 @@ Shader "HDRP/LayeredLit" _SmoothnessRemapMax2("SmoothnessRemapMax2", Range(0.0, 1.0)) = 1.0 _SmoothnessRemapMax3("SmoothnessRemapMax3", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMin0("TransparencyRemapMin0", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin1("TransparencyRemapMin1", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin2("TransparencyRemapMin2", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin3("TransparencyRemapMin3", Range(0.0, 1.0)) = 0.0 - - _TransparencyRemapMax0("TransparencyRemapMax0", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax1("TransparencyRemapMax1", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax2("TransparencyRemapMax2", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax3("TransparencyRemapMax3", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMin0("AlphaRemapMin0", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin1("AlphaRemapMin1", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin2("AlphaRemapMin2", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin3("AlphaRemapMin3", Range(0.0, 1.0)) = 0.0 + + _AlphaRemapMax0("AlphaRemapMax0", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax1("AlphaRemapMax1", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax2("AlphaRemapMax2", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax3("AlphaRemapMax3", Range(0.0, 1.0)) = 1.0 _AORemapMin0("AORemapMin0", Range(0.0, 1.0)) = 0.0 _AORemapMin1("AORemapMin1", Range(0.0, 1.0)) = 0.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader index abd0b034fb2..40da6ece61b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/LayeredLit/LayeredLitTessellation.shader @@ -49,15 +49,15 @@ Shader "HDRP/LayeredLitTessellation" _SmoothnessRemapMax2("SmoothnessRemapMax2", Range(0.0, 1.0)) = 1.0 _SmoothnessRemapMax3("SmoothnessRemapMax3", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMin0("TransparencyRemapMin0", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin1("TransparencyRemapMin1", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin2("TransparencyRemapMin2", Range(0.0, 1.0)) = 0.0 - _TransparencyRemapMin3("TransparencyRemapMin3", Range(0.0, 1.0)) = 0.0 - - _TransparencyRemapMax0("TransparencyRemapMax0", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax1("TransparencyRemapMax1", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax2("TransparencyRemapMax2", Range(0.0, 1.0)) = 1.0 - _TransparencyRemapMax3("TransparencyRemapMax3", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMin0("AlphaRemapMin0", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin1("AlphaRemapMin1", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin2("AlphaRemapMin2", Range(0.0, 1.0)) = 0.0 + _AlphaRemapMin3("AlphaRemapMin3", Range(0.0, 1.0)) = 0.0 + + _AlphaRemapMax0("AlphaRemapMax0", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax1("AlphaRemapMax1", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax2("AlphaRemapMax2", Range(0.0, 1.0)) = 1.0 + _AlphaRemapMax3("AlphaRemapMax3", Range(0.0, 1.0)) = 1.0 _AORemapMin0("AORemapMin0", Range(0.0, 1.0)) = 0.0 _AORemapMin1("AORemapMin1", Range(0.0, 1.0)) = 0.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader index ca984ef01f9..42461ed40b0 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/Lit.shader @@ -17,8 +17,8 @@ Shader "HDRP/Lit" _MetallicRemapMax("MetallicRemapMax", Float) = 1.0 _SmoothnessRemapMin("SmoothnessRemapMin", Float) = 0.0 _SmoothnessRemapMax("SmoothnessRemapMax", Float) = 1.0 - _TransparencyRemapMin("TransparencyRemapMin", Float) = 0.0 - _TransparencyRemapMax("TransparencyRemapMax", Float) = 1.0 + _AlphaRemapMin("AlphaRemapMin", Float) = 0.0 + _AlphaRemapMax("AlphaRemapMax", Float) = 1.0 _AORemapMin("AORemapMin", Float) = 0.0 _AORemapMax("AORemapMax", Float) = 1.0 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl index f0f87831db7..87108d23324 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitDataIndividualLayer.hlsl @@ -203,12 +203,13 @@ float ADD_IDX(GetSurfaceData)(FragInputs input, LayerTexCoord layerTexCoord, out // We split both call due to trilinear mapping detailNormalTS = SAMPLE_UVMAPPING_NORMALMAP_AG(ADD_IDX(_DetailMap), SAMPLER_DETAILMAP_IDX, ADD_IDX(layerTexCoord.details), ADD_IDX(_DetailNormalScale)); #endif + float4 color = SAMPLE_UVMAPPING_TEXTURE2D(ADD_IDX(_BaseColorMap), ADD_ZERO_IDX(sampler_BaseColorMap), ADD_IDX(layerTexCoord.base)).rgba * ADD_IDX(_BaseColor).rgba; surfaceData.baseColor = color.rgb; float alpha = color.a; - alpha = lerp(ADD_IDX(_TransparencyRemapMin), ADD_IDX(_TransparencyRemapMax), alpha); -#ifdef _DETAIL_MAP_IDX + alpha = lerp(ADD_IDX(_AlphaRemapMin), ADD_IDX(_AlphaRemapMax), alpha); +#ifdef _DETAIL_MAP_IDX // Goal: we want the detail albedo map to be able to darken down to black and brighten up to white the surface albedo. // The scale control the speed of the gradient. We simply remap detailAlbedo from [0..1] to [-1..1] then perform a lerp to black or white // with a factor based on speed. diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl index 2c5c4864865..497ae1f9a30 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitProperties.hlsl @@ -156,8 +156,8 @@ float _MetallicRemapMax; float _Smoothness; float _SmoothnessRemapMin; float _SmoothnessRemapMax; -float _TransparencyRemapMin; -float _TransparencyRemapMax; +float _AlphaRemapMin; +float _AlphaRemapMax; float _AORemapMin; float _AORemapMax; @@ -214,8 +214,8 @@ PROP_DECL(float, _MetallicRemapMax); PROP_DECL(float, _Smoothness); PROP_DECL(float, _SmoothnessRemapMin); PROP_DECL(float, _SmoothnessRemapMax); -PROP_DECL(float, _TransparencyRemapMin); -PROP_DECL(float, _TransparencyRemapMax); +PROP_DECL(float, _AlphaRemapMin); +PROP_DECL(float, _AlphaRemapMax); PROP_DECL(float, _AORemapMin); PROP_DECL(float, _AORemapMax); @@ -333,6 +333,14 @@ UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float , _SmoothnessRemapMax1) UNITY_DOTS_INSTANCED_PROP(float , _SmoothnessRemapMax2) UNITY_DOTS_INSTANCED_PROP(float , _SmoothnessRemapMax3) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMin0) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMin1) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMin2) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMin3) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMax0) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMax1) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMax2) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMax3) UNITY_DOTS_INSTANCED_PROP(float , _AORemapMin0) UNITY_DOTS_INSTANCED_PROP(float , _AORemapMin1) UNITY_DOTS_INSTANCED_PROP(float , _AORemapMin2) @@ -407,14 +415,14 @@ UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) #define _SmoothnessRemapMax1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax1) #define _SmoothnessRemapMax2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax2) #define _SmoothnessRemapMax3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax3) -#define _TransparencyRemapMin0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin0) -#define _TransparencyRemapMin1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin1) -#define _TransparencyRemapMin2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin2) -#define _TransparencyRemapMin3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin3) -#define _TransparencyRemapMax0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax0) -#define _TransparencyRemapMax1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax1) -#define _TransparencyRemapMax2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax2) -#define _TransparencyRemapMax3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax3) +#define _AlphaRemapMin0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMin0) +#define _AlphaRemapMin1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMin1) +#define _AlphaRemapMin2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMin2) +#define _AlphaRemapMin3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMin3) +#define _AlphaRemapMax0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMax0) +#define _AlphaRemapMax1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMax1) +#define _AlphaRemapMax2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMax2) +#define _AlphaRemapMax3 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMax3) #define _AORemapMin0 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin0) #define _AORemapMin1 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin1) #define _AORemapMin2 UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin2) @@ -461,6 +469,8 @@ UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) UNITY_DOTS_INSTANCED_PROP(float , _Smoothness) UNITY_DOTS_INSTANCED_PROP(float , _SmoothnessRemapMin) UNITY_DOTS_INSTANCED_PROP(float , _SmoothnessRemapMax) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMin) + UNITY_DOTS_INSTANCED_PROP(float , _AlphaRemapMax) UNITY_DOTS_INSTANCED_PROP(float , _AORemapMin) UNITY_DOTS_INSTANCED_PROP(float , _AORemapMax) UNITY_DOTS_INSTANCED_PROP(float , _DetailAlbedoScale) @@ -482,8 +492,8 @@ UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) #define _Smoothness UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Smoothness) #define _SmoothnessRemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMin) #define _SmoothnessRemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _SmoothnessRemapMax) -#define _TransparencyRemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMin) -#define _TransparencyRemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _TransparencyRemapMax) +#define _AlphaRemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMin) +#define _AlphaRemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AlphaRemapMax) #define _AORemapMin UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMin) #define _AORemapMax UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _AORemapMax) #define _DetailAlbedoScale UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _DetailAlbedoScale) diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader index fe233e06c34..8d3b117e3ed 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Lit/LitTessellation.shader @@ -17,8 +17,8 @@ Shader "HDRP/LitTessellation" _MetallicRemapMax("MetallicRemapMax", Float) = 1.0 _SmoothnessRemapMin("SmoothnessRemapMin", Float) = 0.0 _SmoothnessRemapMax("SmoothnessRemapMax", Float) = 1.0 - _TransparencyRemapMin("TransparencyRemapMin", Float) = 0.0 - _TransparencyRemapMax("TransparencyRemapMax", Float) = 1.0 + _AlphaRemapMin("AlphaRemapMin", Float) = 0.0 + _AlphaRemapMax("AlphaRemapMax", Float) = 1.0 _AORemapMin("AORemapMin", Float) = 0.0 _AORemapMax("AORemapMax", Float) = 1.0 From 2dff7aac120e8b75f109562c400bd45d15560669 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 2 Nov 2021 16:07:24 +0100 Subject: [PATCH 05/22] Add 'alpha remap' for Unlit shader --- .../Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs | 13 +++++++++++++ .../Runtime/Material/Unlit/Unlit.shader | 2 ++ .../Runtime/Material/Unlit/UnlitData.hlsl | 2 +- .../Runtime/Material/Unlit/UnlitProperties.hlsl | 2 ++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs index e0a4df26d22..8c811c0f00b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs @@ -12,12 +12,17 @@ internal class Styles public static GUIContent header { get; } = EditorGUIUtility.TrTextContent("Surface Inputs"); public static GUIContent colorText = new GUIContent("Color", " Albedo (RGB) and Transparency (A)."); + public static GUIContent transparencyRemappingText = new GUIContent("Transparency Remapping", "Controls a remap for the alpha channel in the Base Color."); } MaterialProperty color = null; const string kColor = "_UnlitColor"; MaterialProperty colorMap = null; const string kColorMap = "_UnlitColorMap"; + MaterialProperty alphaRemapMin = null; + const string kAlphaRemapMin = "_AlphaRemapMin"; + MaterialProperty alphaRemapMax = null; + const string kAlphaRemapMax = "_AlphaRemapMax"; /// /// Constructs an UnlitSurfaceInputsUIBlock based on the parameters. @@ -35,6 +40,9 @@ public override void LoadMaterialProperties() { color = FindProperty(kColor); colorMap = FindProperty(kColorMap); + + alphaRemapMin = FindProperty(kAlphaRemapMin); + alphaRemapMax = FindProperty(kAlphaRemapMax); } /// @@ -44,6 +52,11 @@ protected override void OnGUIOpen() { materialEditor.TexturePropertySingleLine(Styles.colorText, colorMap, color); materialEditor.TextureScaleOffsetProperty(colorMap); + + if (colorMap.textureValue != null) + { + materialEditor.MinMaxShaderProperty(alphaRemapMin, alphaRemapMax, 0.0f, 1.0f, Styles.transparencyRemappingText); + } } } } diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader index 78916d0c33b..3c8f1636b25 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/Unlit.shader @@ -5,6 +5,8 @@ Shader "HDRP/Unlit" // Be careful, do not change the name here to _Color. It will conflict with the "fake" parameters (see end of properties) required for GI. [MainColor] _UnlitColor("Color", Color) = (1,1,1,1) [MainTexture] _UnlitColorMap("ColorMap", 2D) = "white" {} + [HideInInspector] _AlphaRemapMin("AlphaRemapMin", Float) = 0.0 + [HideInInspector] _AlphaRemapMax("AlphaRemapMax", Float) = 1.0 [HDR] _EmissiveColor("EmissiveColor", Color) = (0, 0, 0) _EmissiveColorMap("EmissiveColorMap", 2D) = "white" {} diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitData.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitData.hlsl index df0c30c381e..f7aaa769f35 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitData.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitData.hlsl @@ -30,7 +30,7 @@ void GetSurfaceAndBuiltinData(FragInputs input, float3 V, inout PositionInputs p // Builtin Data ZERO_BUILTIN_INITIALIZE(builtinData); // No call to InitBuiltinData as we don't have any lighting - builtinData.opacity = alpha; + builtinData.opacity = lerp(_AlphaRemapMin, _AlphaRemapMax, alpha); #ifdef _ALPHATEST_ON // Used for sharpening by alpha to mask diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitProperties.hlsl b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitProperties.hlsl index fe57751a782..4bc5a595540 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitProperties.hlsl +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/Unlit/UnlitProperties.hlsl @@ -25,6 +25,8 @@ float _DistortionVectorBias; float _DistortionBlurScale; float _DistortionBlurRemapMin; float _DistortionBlurRemapMax; +float _AlphaRemapMin; +float _AlphaRemapMax; float _BlendMode; // Caution: C# code in BaseLitUI.cs call LightmapEmissionFlagsProperty() which assume that there is an existing "_EmissionColor" From 5a663bfe2bdb6f6a8b2576ad0bf8dc175adc9b66 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 3 Nov 2021 17:44:26 +0100 Subject: [PATCH 06/22] Add Scene Difference Node --- .../Input/Scene/SceneDepthDifferenceNode.cs | 122 ++++++++++++++++++ .../Scene/SceneDepthDifferenceNode.cs.meta | 11 ++ 2 files changed, 133 insertions(+) create mode 100644 com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs create mode 100644 com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs.meta diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs new file mode 100644 index 00000000000..cdc25769d49 --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs @@ -0,0 +1,122 @@ +using System.Reflection; +using UnityEngine; +using UnityEditor.Graphing; +using UnityEditor.ShaderGraph.Drawing.Controls; + +namespace UnityEditor.ShaderGraph +{ + [Title("Input", "Scene", "Scene Depth Difference")] + sealed class SceneDepthDifferenceNode : CodeFunctionNode, IMayRequireDepthTexture, IMayRequireScreenPosition, IMayRequirePosition + { + [SerializeField] + private DepthSamplingMode m_DepthSamplingMode = DepthSamplingMode.Linear01; + + [EnumControl("Sampling Mode")] + public DepthSamplingMode depthSamplingMode + { + get { return m_DepthSamplingMode; } + set + { + if (m_DepthSamplingMode == value) + return; + + m_DepthSamplingMode = value; + Dirty(ModificationScope.Graph); + } + } + + public SceneDepthDifferenceNode() + { + name = "Scene Depth Difference"; + synonyms = new string[] { "zbuffer", "zdepth", "difference" }; + UpdateNodeAfterDeserialization(); + } + + public override bool hasPreview { get { return false; } } + + protected override MethodInfo GetFunctionToConvert() + { + switch (m_DepthSamplingMode) + { + case DepthSamplingMode.Raw: + return GetType().GetMethod("Unity_SceneDepthDifference_Raw", BindingFlags.Static | BindingFlags.NonPublic); + case DepthSamplingMode.Eye: + return GetType().GetMethod("Unity_SceneDepthDifference_Eye", BindingFlags.Static | BindingFlags.NonPublic); + case DepthSamplingMode.Linear01: + default: + return GetType().GetMethod("Unity_SceneDepthDifference_Linear01", BindingFlags.Static | BindingFlags.NonPublic); + } + } + + static string Unity_SceneDepthDifference_Linear01( + [Slot(0, Binding.None, ShaderStageCapability.Fragment)] out Vector1 Out, + [Slot(1, Binding.ScreenPosition)] Vector2 SceneUV, + [Slot(2, Binding.WorldSpacePosition)] Vector2 PositionWS) + { + return +@" +{ + $precision dist = Remap01(length(PositionWS), _ProjectionParams.y, _ProjectionParams.z); +#if defined(UNITY_REVERSED_Z) + Out = Linear01Depth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) - dist; +#else + Out = dist - Linear01Depth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); +#endif +} +"; + } + + static string Unity_SceneDepthDifference_Raw( + [Slot(0, Binding.None, ShaderStageCapability.Fragment)] out Vector1 Out, + [Slot(1, Binding.ScreenPosition)] Vector2 SceneUV, + [Slot(2, Binding.WorldSpacePosition)] Vector3 PositionWS) + { + return +@" +{ + $precision deviceDepth = ComputeNormalizedDeviceCoordinatesWithZ(PositionWS, GetWorldToHClipMatrix()).z; +#if defined(UNITY_REVERSED_Z) + Out = SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy) - deviceDepth; +#else + Out = deviceDepth - SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy); +#endif +} +"; + } + + static string Unity_SceneDepthDifference_Eye( + [Slot(0, Binding.None, ShaderStageCapability.Fragment)] out Vector1 Out, + [Slot(1, Binding.ScreenPosition)] Vector2 SceneUV, + [Slot(2, Binding.WorldSpacePosition)] Vector3 PositionWS) + { + return +@" +{ + if (unity_OrthoParams.w == 1.0) + { + Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); + } + else + { + Out = length(PositionWS) - LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); + } +} +"; + } + + bool IMayRequireDepthTexture.RequiresDepthTexture(ShaderStageCapability stageCapability) + { + return true; + } + + bool IMayRequireScreenPosition.RequiresScreenPosition(ShaderStageCapability stageCapability) + { + return true; + } + + Internal.NeededCoordinateSpace IMayRequirePosition.RequiresPosition(ShaderStageCapability stageCapability) + { + return Internal.NeededCoordinateSpace.World; + } + } +} diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs.meta b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs.meta new file mode 100644 index 00000000000..40ff832251c --- /dev/null +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dd9b023ec03b4e94a848c784c0be713e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From e9b3c10c5ce3758234fa3ac6c499f1038ded675d Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Thu, 4 Nov 2021 17:02:36 +0100 Subject: [PATCH 07/22] Fix order --- .../Input/Scene/SceneDepthDifferenceNode.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs index cdc25769d49..01b38478784 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs @@ -76,9 +76,9 @@ static string Unity_SceneDepthDifference_Raw( { $precision deviceDepth = ComputeNormalizedDeviceCoordinatesWithZ(PositionWS, GetWorldToHClipMatrix()).z; #if defined(UNITY_REVERSED_Z) - Out = SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy) - deviceDepth; -#else Out = deviceDepth - SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy); +#else + Out = SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy) - deviceDepth; #endif } "; @@ -94,11 +94,22 @@ static string Unity_SceneDepthDifference_Eye( { if (unity_OrthoParams.w == 1.0) { +#if defined(UNITY_REVERSED_Z) Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); +#else + Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); +#endif } else { - Out = length(PositionWS) - LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); + //LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) + float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams);//ComputeScreenPos(TransformWorldToHClip(input.positionRWS), _ProjectionParams.x).w; + //float theEye = LinearEyeDepth(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); +#if defined(UNITY_REVERSED_Z) + Out = theEye - length(PositionWS); +#else + Out = length(PositionWS) - theEye; +#endif } } "; From 51061240b1420424b1cac86c3fd909b760f67ad6 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Thu, 4 Nov 2021 23:26:14 +0100 Subject: [PATCH 08/22] tmp --- .../Input/Scene/SceneDepthDifferenceNode.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs index 01b38478784..ff3389b8ccb 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs @@ -92,23 +92,28 @@ static string Unity_SceneDepthDifference_Eye( return @" { - if (unity_OrthoParams.w == 1.0) + if (IsPerspectiveProjection()) { + //LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) + //float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams);//ComputeScreenPos(TransformWorldToHClip(input.positionRWS), _ProjectionParams.x).w; + //float theEye = LinearEyeDepth(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); + + //float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); + //float theEye = ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP).z*dot(GetViewForwardDir(), GetWorldSpaceNormalizeViewDir(PositionWS)); + float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams)/dot(GetViewForwardDir(), GetWorldSpaceNormalizeViewDir(PositionWS)); + #if defined(UNITY_REVERSED_Z) - Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); + Out = theEye - length(PositionWS); #else - Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); + Out = length(PositionWS) - theEye; #endif } else { - //LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) - float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams);//ComputeScreenPos(TransformWorldToHClip(input.positionRWS), _ProjectionParams.x).w; - //float theEye = LinearEyeDepth(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); #if defined(UNITY_REVERSED_Z) - Out = theEye - length(PositionWS); + Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); #else - Out = length(PositionWS) - theEye; + Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); #endif } } From b0e5ac59bbdc4ac54135cc34f00a19ff9aba4e4d Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Fri, 5 Nov 2021 11:12:06 +0100 Subject: [PATCH 09/22] Reorder surface param --- .../Material/UIBlocks/LitSurfaceInputsUIBlock.cs | 14 +++++++------- .../Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs index f58d7863c73..7ed22c465d8 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/LitSurfaceInputsUIBlock.cs @@ -375,6 +375,13 @@ void DrawSurfaceInputsGUI() materialEditor.TexturePropertySingleLine(Styles.baseColorText, baseColorMap[m_LayerIndex], baseColor[m_LayerIndex]); + if (baseColorMap[m_LayerIndex].textureValue != null && materials.All(m => m.GetSurfaceType() == SurfaceType.Transparent)) + { + materialEditor.MinMaxShaderProperty(alphaRemapMin[m_LayerIndex], alphaRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); + } + + materialEditor.TexturePropertySingleLine((materials.All(m => m.GetMaterialId() == MaterialId.LitSpecular)) ? Styles.maskMapSpecularText : Styles.maskMapSText, maskMap[m_LayerIndex]); + bool hasMetallic = materials.All(m => m.GetMaterialId() == MaterialId.LitStandard || m.GetMaterialId() == MaterialId.LitAniso || @@ -395,13 +402,6 @@ void DrawSurfaceInputsGUI() materialEditor.MinMaxShaderProperty(aoRemapMin[m_LayerIndex], aoRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.aoRemappingText); } - if (baseColorMap[m_LayerIndex].textureValue != null && materials.All(m => m.GetSurfaceType() == SurfaceType.Transparent)) - { - materialEditor.MinMaxShaderProperty(alphaRemapMin[m_LayerIndex], alphaRemapMax[m_LayerIndex], 0.0f, 1.0f, Styles.transparencyRemappingText); - } - - materialEditor.TexturePropertySingleLine((materials.All(m => m.GetMaterialId() == MaterialId.LitSpecular)) ? Styles.maskMapSpecularText : Styles.maskMapSText, maskMap[m_LayerIndex]); - materialEditor.ShaderProperty(normalMapSpace[m_LayerIndex], Styles.normalMapSpaceText); // Triplanar only work with tangent space normal diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs index 8c811c0f00b..2b70061b5c6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/UnlitSurfaceInputsUIBlock.cs @@ -51,12 +51,13 @@ public override void LoadMaterialProperties() protected override void OnGUIOpen() { materialEditor.TexturePropertySingleLine(Styles.colorText, colorMap, color); - materialEditor.TextureScaleOffsetProperty(colorMap); if (colorMap.textureValue != null) { materialEditor.MinMaxShaderProperty(alphaRemapMin, alphaRemapMax, 0.0f, 1.0f, Styles.transparencyRemappingText); } + + materialEditor.TextureScaleOffsetProperty(colorMap); } } } From 6343e326c971f9a682f1e0fc7617143c47218514 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 30 Nov 2021 16:37:08 +0100 Subject: [PATCH 10/22] Add Doc for SceneDepthDifference Node --- .../Documentation~/Scene-Depth-Difference.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md diff --git a/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md b/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md new file mode 100644 index 00000000000..62d513bb233 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md @@ -0,0 +1,19 @@ +# Scene Depth Difference + +## Description + +Provide a difference between a World Space Position and a Depth value for a given UV. + +## Ports + +| Name | Direction | Type | Binding | Description | +|:-------|:-----------|:------|:--------|:------------| +| Scene UV | Input | Vector4 | None | **Eye Index** for the camera of a stereo draw. | +| Position WS | Input | Vector3 | None | **Eye Index** for the camera of a stereo draw. | +| Out | Output | Float | None | The difference between PositionWS and the depth. The difference is given relative to camera with **Eye** mode, in depth-buffer-value with **Raw** mode and in Linear value remap between 0 and 1 with the **Linear01** Mode. | + +## Controls + +| Name | Type | Options | Description | +|:------------ |:-------------|:-----|:---| +| Mode | Dropdown | Select **Linear01** to have a value between 0 and 1, **Eye** to have a World-Space value comparable to unit used on the scene and **Raw** if it's used with SceneDepthBuffer. | From c6a457691da192cdaa56f71934c02489ba76b384 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 30 Nov 2021 16:54:46 +0100 Subject: [PATCH 11/22] Update doc for "Alpha Remapping" --- .../Documentation~/Lit-Shader.md | 1 + .../Documentation~/Lit-Tessellation-Shader.md | 1 + .../Documentation~/snippets/shader-properties/layers.md | 1 + 3 files changed, 3 insertions(+) diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md index e280814912c..2bdcc2b9e22 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Shader.md @@ -26,6 +26,7 @@ To create a new Lit Material, navigate to your Project's Asset window, right-cli | **Base Map** | Assign a Texture that controls both the color and opacity of your Material. To assign a Texture to this field, click the radio button and select your Texture in the Select Texture window. Use the color picker to select the color of the Material. If you do not assign a Texture, this is the absolute color of the Material. If you do assign a Texture, the final color of the Material is a combination of the Texture you assign and the color you select. The alpha value of the color controls the transparency level for the Material if you select **Transparent** from the **Surface Type** drop-down. | | **Metallic** | Use this slider to adjust how "metal-like" the surface of your Material is (between 0 and 1). When a surface is more metallic, it reflects the environment more and its albedo color becomes less visible. At full metallic level, the surface color is entirely driven by reflections from the environment. When a surface is less metallic, its albedo color is clearer and any surface reflections are visible on top of the surface color, rather than obscuring it.
This property only appears when you unassign the Texture in the **Mask Map**. | | **Smoothness** | Use the slider to adjust the smoothness of your Material. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. Less smooth surfaces reflect light over a wider range of angles (because the light hits the bumps in the microsurface), so the reflections have less detail and spread across the surface in a more diffused pattern.
This property only appears when you unassign the Texture in the **Mask Map**. | +| **Alpha Remapping** | Use this min-max slider to remap the alpha values from the **Base Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Base Map**. | | **Metallic Remapping** | Use this min-max slider to remap the metallic values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Smoothness Remapping** | Use this min-max slider to remap the smoothness values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Ambient Occlusion Remapping** | Use this min-max slider to remap the ambient occlusion values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md index 219b68e45c8..f30e3de13af 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/Lit-Tessellation-Shader.md @@ -48,6 +48,7 @@ For information on the properties in this section, see the [Tessellation documen | **Base Map** | Assign a Texture that controls both the color and opacity of your Material. To assign a Texture to this field, click the radio button and select your Texture in the Select Texture window. Use the color picker to select the color of the Material. If you do not assign a Texture, this is the absolute color of the Material. If you do assign a Texture, the final color of the Material is a combination of the Texture you assign and the color you select. The alpha value of the color controls the transparency level for the Material if you select **Transparent** from the **Surface Type** drop-down. | | **Metallic** | Use this slider to adjust how "metal-like" the surface of your Material is (between 0 and 1). When a surface is more metallic, it reflects the environment more and its albedo color becomes less visible. At full metallic level, the surface color is entirely driven by reflections from the environment. When a surface is less metallic, its albedo color is clearer and any surface reflections are visible on top of the surface color, rather than obscuring it.
This property only appears when you unassign the Texture in the **Mask Map**. | | **Smoothness** | Use the slider to adjust the smoothness of your Material. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. Less smooth surfaces reflect light over a wider range of angles (because the light hits the bumps in the microsurface), so the reflections have less detail and spread across the surface in a more diffused pattern.
This property only appears when you unassign the Texture in the **Mask Map**. | +| **Alpha Remapping** | Use this min-max slider to remap the alpha values from the **Base Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Base Map**. | | **Metallic Remapping** | Use this min-max slider to remap the metallic values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Smoothness Remapping** | Use this min-max slider to remap the smoothness values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Ambient Occlusion Remapping** | Use this min-max slider to remap the ambient occlusion values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | diff --git a/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/layers.md b/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/layers.md index 086703ca0cf..eac522d71cf 100644 --- a/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/layers.md +++ b/com.unity.render-pipelines.high-definition/Documentation~/snippets/shader-properties/layers.md @@ -22,6 +22,7 @@ Unity exposes up to four Material layers for you to use in your Layered Material | **Base Map** | Assign a Texture that controls both the color and opacity of your Material. To assign a Texture to this field, click the radio button and select your Texture in the Select Texture window. Use the color picker to select the color of the Material. If you do not assign a Texture, this is the absolute color of the Material. If you do assign a Texture, the final color of the Material is a combination of the Texture you assign and the color you select. The alpha value of the color controls the transparency level for the Material if you select **Transparent** from the **Surface Type** drop-down. | | **Metallic** | Use this slider to adjust how "metal-like" the surface of your Material is (between 0 and 1). When a surface is more metallic, it reflects the environment more and its albedo color becomes less visible. At full metallic level, the surface color is entirely driven by reflections from the environment. When a surface is less metallic, its albedo color is clearer and any surface reflections are visible on top of the surface color, rather than obscuring it.
This property only appears when you unassign the Texture in the **Mask Map** and set **Material Type** to **Standard**. | | **Smoothness** | Use the slider to adjust the smoothness of your Material. Every light ray that hits a smooth surface bounces off at predictable and consistent angles. For a perfectly smooth surface that reflects light like a mirror, set this to a value of 1. Less smooth surfaces reflect light over a wider range of angles (because the light hits the bumps in the microsurface), so the reflections have less detail and spread across the surface in a more diffused pattern.
This property only appears when you unassign the Texture in the **Mask Map**. | +| **Alpha Remapping** | Use this min-max slider to remap the alpha values from the **Base Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Base Map**. | | **Metallic Remapping** | Use this min-max slider to remap the metallic values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Smoothness Remapping** | Use this min-max slider to remap the smoothness values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | | **Ambient Occlusion Remapping** | Use this min-max slider to remap the ambient occlusion values from the **Mask Map** to the range you specify. Rather than [clamping](https://docs.unity3d.com/ScriptReference/Mathf.Clamp.html) values to the new range, Unity condenses the original range down to the new range uniformly.
This property only appears when you assign a **Mask Map**. | From 3bf0833f121a92d839bf6401c1b0986353a5900a Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 30 Nov 2021 18:03:22 +0100 Subject: [PATCH 12/22] Add SceneDepthDifference on test --- .../Assets/Scenes/InputNodes.unity | 397 ++++++++++++- .../Input/Scene/SceneDepthDifference_Eye.mat | 56 ++ .../Scene/SceneDepthDifference_Eye.mat.meta | 8 + .../SceneDepthDifference_Eye.shadergraph | 531 ++++++++++++++++++ .../SceneDepthDifference_Eye.shadergraph.meta | 10 + .../Scene/SceneDepthDifference_Linear01.mat | 56 ++ .../SceneDepthDifference_Linear01.mat.meta | 8 + .../SceneDepthDifference_Linear01.shadergraph | 531 ++++++++++++++++++ ...eDepthDifference_Linear01.shadergraph.meta | 10 + .../Input/Scene/SceneDepthDifference_Raw.mat | 56 ++ .../Scene/SceneDepthDifference_Raw.mat.meta | 8 + .../SceneDepthDifference_Raw.shadergraph | 531 ++++++++++++++++++ .../SceneDepthDifference_Raw.shadergraph.meta | 10 + 13 files changed, 2210 insertions(+), 2 deletions(-) create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat.meta create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph create mode 100644 TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph.meta diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 296990d83ab..85fcf8d7a17 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.12731713, g: 0.13414736, b: 0.12107852, a: 1} + m_IndirectSpecularColor: {r: 0.12731749, g: 0.13414757, b: 0.1210787, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: @@ -2176,7 +2176,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 4.5 + orthographic size: 4.85 m_Depth: -1 m_CullingMask: serializedVersion: 2 @@ -3034,6 +3034,10 @@ Transform: - {fileID: 1718807270} - {fileID: 1887502892} - {fileID: 1787014625} + - {fileID: 788973134} + - {fileID: 1700543877} + - {fileID: 1506800243} + - {fileID: 585226728} m_Father: {fileID: 134715868} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -3716,6 +3720,104 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 582133710} m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &585226727 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 585226728} + - component: {fileID: 585226731} + - component: {fileID: 585226730} + - component: {fileID: 585226729} + m_Layer: 0 + m_Name: Cylinder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &585226728 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585226727} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 8, y: -0, z: 3} + m_LocalScale: {x: 0.25, y: 1.5, z: 0.25} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 501824731} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!136 &585226729 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585226727} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &585226730 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585226727} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &585226731 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 585226727} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &585441710 GameObject: m_ObjectHideFlags: 0 @@ -4750,6 +4852,103 @@ Transform: m_Father: {fileID: 303484558} m_RootOrder: 10 m_LocalEulerAnglesHint: {x: -90, y: 180, z: -90} +--- !u!1 &788973133 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 788973134} + - component: {fileID: 788973137} + - component: {fileID: 788973136} + - component: {fileID: 788973135} + m_Layer: 0 + m_Name: SceneDepthDifference_Linear01 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &788973134 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 788973133} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 8.03, y: 0, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 501824731} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &788973135 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 788973133} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 2967da7148dc7aa4ebd539e60ff154b7, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &788973136 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 788973133} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &788973137 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 788973133} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &801207484 GameObject: m_ObjectHideFlags: 0 @@ -8971,6 +9170,103 @@ Transform: m_Father: {fileID: 303484558} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 45, y: 180, z: -90} +--- !u!1 &1506800242 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1506800243} + - component: {fileID: 1506800246} + - component: {fileID: 1506800245} + - component: {fileID: 1506800244} + m_Layer: 0 + m_Name: SceneDepthDifference_Eye + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1506800243 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506800242} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 8, y: -0, z: 4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 501824731} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1506800244 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506800242} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 931a40691e516894583f26123e672eb4, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &1506800245 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506800242} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1506800246 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1506800242} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1536751008 GameObject: m_ObjectHideFlags: 0 @@ -9493,6 +9789,103 @@ Transform: m_Father: {fileID: 303484558} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: -90, y: 180, z: -90} +--- !u!1 &1700543876 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1700543877} + - component: {fileID: 1700543880} + - component: {fileID: 1700543879} + - component: {fileID: 1700543878} + m_Layer: 0 + m_Name: SceneDepthDifference_Raw + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1700543877 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1700543876} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 8, y: 0, z: 3} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 501824731} + m_RootOrder: -1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1700543878 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1700543876} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 4a078a43bd9730043945e8cf2f60268a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!135 &1700543879 +SphereCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1700543876} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Radius: 0.5 + m_Center: {x: 0, y: 0, z: 0} +--- !u!33 &1700543880 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1700543876} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} --- !u!1 &1701306554 GameObject: m_ObjectHideFlags: 0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat new file mode 100644 index 00000000000..7e7ca3328fa --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1940823928126477220 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 6 +--- !u!21 &2100000 +Material: + serializedVersion: 7 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SceneDepthDifference_Eye + m_Shader: {fileID: -6465566751694194690, guid: 7d0bb51476b1ef64aa1aa1f6dd9fcaf2, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _QueueControl: 0 + - _QueueOffset: 0 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat.meta new file mode 100644 index 00000000000..dd74d6b7aa6 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 931a40691e516894583f26123e672eb4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph new file mode 100644 index 00000000000..2ed9e2c6d1a --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph @@ -0,0 +1,531 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "592377c20a2e42dba72d75e0c6308070", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "08410996cc6c48e2b50e0d16724caac9" + } + ], + "m_Nodes": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + }, + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "8362a37b323f4830a782f6e6ef4ecc22" + }, + { + "m_Id": "7ba4f73ce5aa457f806afaab623363b0" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "8362a37b323f4830a782f6e6ef4ecc22" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "7ba4f73ce5aa457f806afaab623363b0" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "f8a02b10dd894bca9a00b316905c73b0" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "08410996cc6c48e2b50e0d16724caac9", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0e1d7cba35c34dc1aaee32ca4ba90cca", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9229e44addce438c80db36119e7ddb88" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2cf81dfbc76d46d685780d7a56dcf76e", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "64cac7097d2e4b9280a0df8010577647", + "m_Id": 1, + "m_DisplayName": "Scene UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "SceneUV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [], + "m_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "77c7388de81e41ef9f5911600001e6ed", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7ba4f73ce5aa457f806afaab623363b0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "2cf81dfbc76d46d685780d7a56dcf76e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SceneDepthDifferenceNode", + "m_ObjectId": "8362a37b323f4830a782f6e6ef4ecc22", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Scene Depth Difference", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -318.0, + "y": 200.0, + "width": 183.0, + "height": 136.0 + } + }, + "m_Slots": [ + { + "m_Id": "c59052f9d2844d47b410d94df8354249" + }, + { + "m_Id": "64cac7097d2e4b9280a0df8010577647" + }, + { + "m_Id": "8d1f2c2d07e142cf8d70666978d5c587" + } + ], + "synonyms": [ + "zbuffer", + "zdepth", + "difference" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_DepthSamplingMode": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "8ac9dd5e640148c1b0bc77f0010b5871", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "8b7403fb6217456ebfe5ed5166ec0753" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "8d1f2c2d07e142cf8d70666978d5c587", + "m_Id": 2, + "m_DisplayName": "Position WS", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "PositionWS", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "9229e44addce438c80db36119e7ddb88", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "99280e405dcd49d8849b0b30a4ef5930", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9a62d21be04c45faa9aa9aa4292d76c8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "9a62d21be04c45faa9aa9aa4292d76c8", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "c59052f9d2844d47b410d94df8354249", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d654fce863f84262b9953eb6183d5d2a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "8ac9dd5e640148c1b0bc77f0010b5871" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "f8a02b10dd894bca9a00b316905c73b0", + "m_ActiveSubTarget": { + "m_Id": "8b7403fb6217456ebfe5ed5166ec0753" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 1, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f9cecd48e4e44243b0b3adef073128b4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "77c7388de81e41ef9f5911600001e6ed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph.meta new file mode 100644 index 00000000000..de6fac04cfa --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7d0bb51476b1ef64aa1aa1f6dd9fcaf2 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat new file mode 100644 index 00000000000..be43f1e8e41 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-4188617748116029523 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 6 +--- !u!21 &2100000 +Material: + serializedVersion: 7 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SceneDepthDifference_Linear01 + m_Shader: {fileID: -6465566751694194690, guid: a3c6ee5a1a4d03e4cbe3f5f2401c121b, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _QueueControl: 0 + - _QueueOffset: 0 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat.meta new file mode 100644 index 00000000000..766c0ba3052 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2967da7148dc7aa4ebd539e60ff154b7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph new file mode 100644 index 00000000000..0b28cfc9c9b --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph @@ -0,0 +1,531 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "592377c20a2e42dba72d75e0c6308070", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "5a6b717f27104dbfbd9c4e00f72aa951" + } + ], + "m_Nodes": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + }, + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "f90137738cfd4c718b855306b81172d1" + }, + { + "m_Id": "7bbe7f5341bf4c93b90ff88a11249e5a" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f90137738cfd4c718b855306b81172d1" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "7bbe7f5341bf4c93b90ff88a11249e5a" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "f8a02b10dd894bca9a00b316905c73b0" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0e1d7cba35c34dc1aaee32ca4ba90cca", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9229e44addce438c80db36119e7ddb88" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1e7894ef9a034863adea762b1bb2c9c0", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2d8fd246ce1f4ee3b6821f17ebf49b9d", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "5a6b717f27104dbfbd9c4e00f72aa951", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "77c7388de81e41ef9f5911600001e6ed", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7bbe7f5341bf4c93b90ff88a11249e5a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "1e7894ef9a034863adea762b1bb2c9c0" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "8ac9dd5e640148c1b0bc77f0010b5871", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "8b7403fb6217456ebfe5ed5166ec0753" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "9229e44addce438c80db36119e7ddb88", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "99280e405dcd49d8849b0b30a4ef5930", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9a62d21be04c45faa9aa9aa4292d76c8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "9a62d21be04c45faa9aa9aa4292d76c8", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d654fce863f84262b9953eb6183d5d2a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "8ac9dd5e640148c1b0bc77f0010b5871" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "da90c0a2da5d43709349dc44ff1bff5b", + "m_Id": 1, + "m_DisplayName": "Scene UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "SceneUV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [], + "m_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "dbaa333c9c1849b4ad0a6988ad224c66", + "m_Id": 2, + "m_DisplayName": "Position WS", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "PositionWS", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 2 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "f8a02b10dd894bca9a00b316905c73b0", + "m_ActiveSubTarget": { + "m_Id": "8b7403fb6217456ebfe5ed5166ec0753" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 1, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SceneDepthDifferenceNode", + "m_ObjectId": "f90137738cfd4c718b855306b81172d1", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Scene Depth Difference", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -344.0, + "y": 200.0, + "width": 183.0, + "height": 136.0 + } + }, + "m_Slots": [ + { + "m_Id": "2d8fd246ce1f4ee3b6821f17ebf49b9d" + }, + { + "m_Id": "da90c0a2da5d43709349dc44ff1bff5b" + }, + { + "m_Id": "dbaa333c9c1849b4ad0a6988ad224c66" + } + ], + "synonyms": [ + "zbuffer", + "zdepth", + "difference" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_DepthSamplingMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f9cecd48e4e44243b0b3adef073128b4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "77c7388de81e41ef9f5911600001e6ed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph.meta new file mode 100644 index 00000000000..c6294f17830 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a3c6ee5a1a4d03e4cbe3f5f2401c121b +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat new file mode 100644 index 00000000000..344d4716924 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat @@ -0,0 +1,56 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1641259983381672187 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 6 +--- !u!21 &2100000 +Material: + serializedVersion: 7 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SceneDepthDifference_Raw + m_Shader: {fileID: -6465566751694194690, guid: 7889d1d80e3e4ea4b863c78942c59226, + type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _QueueControl: 0 + - _QueueOffset: 0 + m_Colors: [] + m_BuildTextureStacks: [] diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat.meta new file mode 100644 index 00000000000..d0a42c42aea --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a078a43bd9730043945e8cf2f60268a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph new file mode 100644 index 00000000000..86699f3e6d1 --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph @@ -0,0 +1,531 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "592377c20a2e42dba72d75e0c6308070", + "m_Properties": [], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "282a8922f6d14a72b8d103254ec246da" + } + ], + "m_Nodes": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + }, + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "e52df8f1d04d411c831919f629e3f779" + }, + { + "m_Id": "43ff44897fc64ba3bf06cae25f1941d0" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "e52df8f1d04d411c831919f629e3f779" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + "m_SlotId": 0 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "0e1d7cba35c34dc1aaee32ca4ba90cca" + }, + { + "m_Id": "f9cecd48e4e44243b0b3adef073128b4" + }, + { + "m_Id": "d654fce863f84262b9953eb6183d5d2a" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "99280e405dcd49d8849b0b30a4ef5930" + }, + { + "m_Id": "43ff44897fc64ba3bf06cae25f1941d0" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "f8a02b10dd894bca9a00b316905c73b0" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "0e1d7cba35c34dc1aaee32ca4ba90cca", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9229e44addce438c80db36119e7ddb88" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "282a8922f6d14a72b8d103254ec246da", + "m_Name": "", + "m_ChildObjectList": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "2f85b9063ba940caa30a2f13a85de608", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "43ff44897fc64ba3bf06cae25f1941d0", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "2f85b9063ba940caa30a2f13a85de608" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "65744230c0d94c5686a661af72a72cea", + "m_Id": 2, + "m_DisplayName": "Position WS", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "PositionWS", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 2 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "77c7388de81e41ef9f5911600001e6ed", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot", + "m_ObjectId": "7c965700200341c48eb6ab76c8547b54", + "m_Id": 1, + "m_DisplayName": "Scene UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "SceneUV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [], + "m_ScreenSpaceType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "8414a391aa004f3f8baf7c54e3f6afd6", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "8ac9dd5e640148c1b0bc77f0010b5871", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalUnlitSubTarget", + "m_ObjectId": "8b7403fb6217456ebfe5ed5166ec0753" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "9229e44addce438c80db36119e7ddb88", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "99280e405dcd49d8849b0b30a4ef5930", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "9a62d21be04c45faa9aa9aa4292d76c8" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "9a62d21be04c45faa9aa9aa4292d76c8", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d654fce863f84262b9953eb6183d5d2a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "8ac9dd5e640148c1b0bc77f0010b5871" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SceneDepthDifferenceNode", + "m_ObjectId": "e52df8f1d04d411c831919f629e3f779", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Scene Depth Difference", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -273.0, + "y": 200.0, + "width": 183.0, + "height": 136.0 + } + }, + "m_Slots": [ + { + "m_Id": "8414a391aa004f3f8baf7c54e3f6afd6" + }, + { + "m_Id": "7c965700200341c48eb6ab76c8547b54" + }, + { + "m_Id": "65744230c0d94c5686a661af72a72cea" + } + ], + "synonyms": [ + "zbuffer", + "zdepth", + "difference" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_DepthSamplingMode": 1 +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "f8a02b10dd894bca9a00b316905c73b0", + "m_ActiveSubTarget": { + "m_Id": "8b7403fb6217456ebfe5ed5166ec0753" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 1, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "f9cecd48e4e44243b0b3adef073128b4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "77c7388de81e41ef9f5911600001e6ed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_DismissedVersion": 0, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph.meta b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph.meta new file mode 100644 index 00000000000..e2c6a18622c --- /dev/null +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 7889d1d80e3e4ea4b863c78942c59226 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} From 1482355e66afcb8364a710edc4b295ec04f1f823 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 30 Nov 2021 18:08:42 +0100 Subject: [PATCH 13/22] Add new doc on table of content --- com.unity.shadergraph/Documentation~/TableOfContents.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/Documentation~/TableOfContents.md b/com.unity.shadergraph/Documentation~/TableOfContents.md index ecc20e83b44..0d535add499 100644 --- a/com.unity.shadergraph/Documentation~/TableOfContents.md +++ b/com.unity.shadergraph/Documentation~/TableOfContents.md @@ -123,6 +123,7 @@ * [Object](Object-Node) * [Scene Color](Scene-Color-Node) * [Scene Depth](Scene-Depth-Node) + * [Scene Depth Difference](Scene-Depth-Difference) * [Screen](Screen-Node) * Texture * [Calculate Level Of Detail Texture 2D Node](Calculate-Level-Of-Detail-Texture-2D-Node) From bbd46d6469839d210402d3dd6beb05299209ff83 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Tue, 30 Nov 2021 18:10:27 +0100 Subject: [PATCH 14/22] Update doc --- .../Documentation~/Scene-Depth-Difference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md b/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md index 62d513bb233..165dabe773e 100644 --- a/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md +++ b/com.unity.shadergraph/Documentation~/Scene-Depth-Difference.md @@ -8,8 +8,8 @@ Provide a difference between a World Space Position and a Depth value for a give | Name | Direction | Type | Binding | Description | |:-------|:-----------|:------|:--------|:------------| -| Scene UV | Input | Vector4 | None | **Eye Index** for the camera of a stereo draw. | -| Position WS | Input | Vector3 | None | **Eye Index** for the camera of a stereo draw. | +| Scene UV | Input | Vector4 | None | UV where to sample the depth. | +| Position WS | Input | Vector3 | None | The world space position to compare with scene depth. | | Out | Output | Float | None | The difference between PositionWS and the depth. The difference is given relative to camera with **Eye** mode, in depth-buffer-value with **Raw** mode and in Linear value remap between 0 and 1 with the **Linear01** Mode. | ## Controls From 3801f2bf8b7e1c2a713ac16e5c5405cb4c11fca0 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 19:54:04 +0100 Subject: [PATCH 15/22] remove dead code --- .../Input/Scene/SceneDepthDifferenceNode.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs index ff3389b8ccb..16b80109c48 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs @@ -94,26 +94,18 @@ static string Unity_SceneDepthDifference_Eye( { if (IsPerspectiveProjection()) { - //LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) - //float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams);//ComputeScreenPos(TransformWorldToHClip(input.positionRWS), _ProjectionParams.x).w; - //float theEye = LinearEyeDepth(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); - - //float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); - //float theEye = ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP).z*dot(GetViewForwardDir(), GetWorldSpaceNormalizeViewDir(PositionWS)); - float theEye = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams)/dot(GetViewForwardDir(), GetWorldSpaceNormalizeViewDir(PositionWS)); - #if defined(UNITY_REVERSED_Z) - Out = theEye - length(PositionWS); + Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); #else - Out = length(PositionWS) - theEye; + Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); #endif } else { #if defined(UNITY_REVERSED_Z) - Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); + Out = length(PositionWS) - LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); #else - Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); + Out = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) - length(PositionWS); #endif } } From 3a1ae179d5596ed3977cda01b3000932ddd6d06b Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 20:14:21 +0100 Subject: [PATCH 16/22] fix order --- .../Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs index 16b80109c48..7844d0fe3ae 100644 --- a/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs +++ b/com.unity.shadergraph/Editor/Data/Nodes/Input/Scene/SceneDepthDifferenceNode.cs @@ -95,17 +95,17 @@ static string Unity_SceneDepthDifference_Eye( if (IsPerspectiveProjection()) { #if defined(UNITY_REVERSED_Z) - Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); -#else Out = LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V) - length(PositionWS); +#else + Out = length(PositionWS) - LinearEyeDepth(ComputeWorldSpacePosition(SceneUV.xy, SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), UNITY_MATRIX_I_VP), UNITY_MATRIX_V); #endif } else { #if defined(UNITY_REVERSED_Z) - Out = length(PositionWS) - LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); -#else Out = LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams) - length(PositionWS); +#else + Out = length(PositionWS) - LinearEyeDepth(SHADERGRAPH_SAMPLE_SCENE_DEPTH(SceneUV.xy), _ZBufferParams); #endif } } From 507f38c23438015eaa395f3cd6a293faf81b6656 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 20:27:42 +0100 Subject: [PATCH 17/22] _ --- .../Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph | 2 +- .../Input/Scene/SceneDepthDifference_Linear01.shadergraph | 2 +- .../Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph index 2ed9e2c6d1a..7c120816b5b 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Eye.shadergraph @@ -252,7 +252,7 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -318.0, + "x": -303.0, "y": 200.0, "width": 183.0, "height": 136.0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph index 0b28cfc9c9b..d25113440f0 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Linear01.shadergraph @@ -463,7 +463,7 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -344.0, + "x": -324.0, "y": 200.0, "width": 183.0, "height": 136.0 diff --git a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph index 86699f3e6d1..cbeb62bd572 100644 --- a/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph +++ b/TestProjects/ShaderGraph/Assets/Testing/IntegrationTests/Graphs/Input/Scene/SceneDepthDifference_Raw.shadergraph @@ -443,7 +443,7 @@ "m_Expanded": true, "m_Position": { "serializedVersion": "2", - "x": -273.0, + "x": -310.0, "y": 200.0, "width": 183.0, "height": 136.0 From 271c29287de5d4bbf5395670445e4c0d6c4a8da0 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 20:29:28 +0100 Subject: [PATCH 18/22] Change cylinder size --- TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 85fcf8d7a17..8e0fcc4f25f 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -3748,7 +3748,7 @@ Transform: m_GameObject: {fileID: 585226727} m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} m_LocalPosition: {x: 8, y: -0, z: 3} - m_LocalScale: {x: 0.25, y: 1.5, z: 0.25} + m_LocalScale: {x: 0.5, y: 1.5, z: 0.5} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 501824731} From ce87ee8f45519c60d782b538bacf437a6c14d22a Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 20:30:00 +0100 Subject: [PATCH 19/22] Update image ref --- .../WindowsEditor/Direct3D11/None/InputNodes.png | 4 ++-- .../Direct3D11/None/InputNodes.png.meta | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png index 059a2c83da6..b8a2835a487 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 -size 552912 +oid sha256:7182de48ae0ae35487bf9f9eb5bf5cb8a2ebef33c1ac1040f9d5141a8f06dff6 +size 554268 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index 059baecf658..31daa35d732 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -1,12 +1,12 @@ fileFormatVersion: 2 -guid: cdd86edd1ddceac4e8914ee4c5696e8e +guid: 377807074afd427458a64bc1139f61bb TextureImporter: internalIDToNameTable: [] externalObjects: {} serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 0 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -20,10 +20,12 @@ TextureImporter: externalNormalMap: 0 heightScale: 0.25 normalMapFilter: 0 - isReadable: 1 + flipGreenChannel: 0 + isReadable: 0 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 + ignoreMasterTextureLimit: 0 grayScaleToAlpha: 0 generateCubemap: 6 cubemapConvolution: 0 @@ -38,7 +40,7 @@ TextureImporter: wrapU: 0 wrapV: 0 wrapW: 0 - nPOTScale: 0 + nPOTScale: 1 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -62,13 +64,14 @@ TextureImporter: textureFormatSet: 0 ignorePngGamma: 0 applyGammaDecoding: 0 + swizzle: 50462976 platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 0 + textureCompression: 1 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 @@ -91,7 +94,6 @@ TextureImporter: nameFileIdTable: {} spritePackingTag: pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 userData: assetBundleName: assetBundleVariant: From 024373a9efd5c273c6fcf3fb225ff4b7234ea32e Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 21:19:53 +0100 Subject: [PATCH 20/22] plop --- .../WindowsEditor/Direct3D11/None/InputNodes.png.meta | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta index 31daa35d732..97a4ec5ee17 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsEditor/Direct3D11/None/InputNodes.png.meta @@ -6,7 +6,7 @@ TextureImporter: serializedVersion: 11 mipmaps: mipMapMode: 0 - enableMipMap: 1 + enableMipMap: 0 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -21,7 +21,7 @@ TextureImporter: heightScale: 0.25 normalMapFilter: 0 flipGreenChannel: 0 - isReadable: 0 + isReadable: 1 streamingMipmaps: 0 streamingMipmapsPriority: 0 vTOnly: 0 @@ -40,7 +40,7 @@ TextureImporter: wrapU: 0 wrapV: 0 wrapW: 0 - nPOTScale: 1 + nPOTScale: 0 lightmap: 0 compressionQuality: 50 spriteMode: 0 @@ -71,7 +71,7 @@ TextureImporter: maxTextureSize: 2048 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 From ebc8fd236a935d864330da8c65c7cd0ba3d390c5 Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Wed, 1 Dec 2021 23:43:19 +0100 Subject: [PATCH 21/22] fix scene --- TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity index 8e0fcc4f25f..c353c7130c8 100644 --- a/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity +++ b/TestProjects/ShaderGraph/Assets/Scenes/InputNodes.unity @@ -2176,7 +2176,7 @@ Camera: far clip plane: 1000 field of view: 60 orthographic: 1 - orthographic size: 4.85 + orthographic size: 4.5 m_Depth: -1 m_CullingMask: serializedVersion: 2 From 71a476cdbea0e284de7942a2acaead49139df3ce Mon Sep 17 00:00:00 2001 From: SoufianeKHIAT Date: Thu, 2 Dec 2021 14:16:01 +0100 Subject: [PATCH 22/22] Update sceenshot {iPhone_Metal, LinuxEditor_Vulkan, LinusPlayer_Vulkan, WindowsPlayer_dx11} --- .../Linear/IPhonePlayer/Metal/None/InputNodes.png | 4 ++-- .../Linear/LinuxEditor/Vulkan/None/InputNodes.png | 4 ++-- .../Linear/LinuxPlayer/Vulkan/None/InputNodes.png | 4 ++-- .../Linear/WindowsPlayer/Direct3D11/None/InputNodes.png | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png index 623bb66c04f..fdd9e5a26e8 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/IPhonePlayer/Metal/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:376458b49f8380dacb2f3cca95f219a1b4f549572befb44de084810e88d9ff22 -size 570383 +oid sha256:527ee5302fbee4182af162a5d46f3f6ca75a11b446145eacabe89a6efc38f708 +size 571784 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png index 059a2c83da6..b77ff60b338 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxEditor/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 -size 552912 +oid sha256:74dd89b896150bce2990ccc7a2cf618a26ce27d6a7c79841581b42e634ecc100 +size 554332 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png index 059a2c83da6..cf6b7e485bc 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/LinuxPlayer/Vulkan/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 -size 552912 +oid sha256:c71af7dbc3a3b8918aa3c3c2de5c74e8ef1ab9bef4d7743cab77f1539cc98c79 +size 554407 diff --git a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png index 059a2c83da6..f5304ea41af 100644 --- a/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png +++ b/TestProjects/ShaderGraph/Assets/ReferenceImages/Linear/WindowsPlayer/Direct3D11/None/InputNodes.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd68f56c4faccbee8526c4c4414e31b37a07a140d533eb8e84381a91fc261410 -size 552912 +oid sha256:c8e8339809fed988aa92f4a752c53e4b0e8aace07b7701c5d960a50e27ef53b0 +size 554336