From ce8f760132ce72ce6991cfd6cef73d4cb43fb593 Mon Sep 17 00:00:00 2001 From: Kasper Engelstoft Date: Thu, 23 Sep 2021 10:14:30 +0200 Subject: [PATCH 1/8] Case 1357902: Optimize Mesh Data setting will corrupt UV mesh channels 'Optimize Mesh Data' strip away variants without the keyword set on the vertex stage. --- .../Editor/Material/ShaderGraph/HDTarget.cs | 18 +++++++++--------- .../Enumerations/KeywordShaderStage.cs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index 6b51b25328b..b7f86667539 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -1137,7 +1137,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + stages = KeywordShaderStage.VertexFragmentAndRaytracing }; public static KeywordDescriptor DirectionalLightmapCombined = new KeywordDescriptor() @@ -1147,7 +1147,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + stages = KeywordShaderStage.VertexFragmentAndRaytracing }; public static KeywordDescriptor DynamicLightmap = new KeywordDescriptor() @@ -1157,7 +1157,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + stages = KeywordShaderStage.VertexFragmentAndRaytracing }; public static KeywordDescriptor ShadowsShadowmask = new KeywordDescriptor() @@ -1167,7 +1167,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + stages = KeywordShaderStage.VertexFragmentAndRaytracing }; public static KeywordDescriptor ScreenSpaceShadow = new KeywordDescriptor() @@ -1192,7 +1192,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing, + stages = KeywordShaderStage.VertexFragmentAndRaytracing, }; public static KeywordDescriptor Decals = new KeywordDescriptor() @@ -1224,7 +1224,7 @@ static class CoreKeywordDescriptors new KeywordEntry() { displayName = "L1", referenceName = "L1" }, new KeywordEntry() { displayName = "L2", referenceName = "L2" }, }, - stages = KeywordShaderStage.FragmentAndRaytracing, + stages = KeywordShaderStage.VertexFragmentAndRaytracing, }; public static KeywordDescriptor LodFadeCrossfade = new KeywordDescriptor() @@ -1447,7 +1447,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.FragmentAndRaytracing, + stages = KeywordShaderStage.VertexFragmentAndRaytracing, }; public static KeywordDescriptor DecalSurfaceGradient = new KeywordDescriptor @@ -1467,7 +1467,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.FragmentAndRaytracing, + stages = KeywordShaderStage.VertexFragmentAndRaytracing, }; public static KeywordDescriptor DisableSSRTransparent = new KeywordDescriptor @@ -1477,7 +1477,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.FragmentAndRaytracing, + stages = KeywordShaderStage.VertexFragmentAndRaytracing, }; public static KeywordDescriptor EnableGeometricSpecularAA = new KeywordDescriptor diff --git a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs index 7d74c927e0f..c6b9576cc00 100644 --- a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs +++ b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs @@ -13,7 +13,7 @@ internal enum KeywordShaderStage RayTracing = (1 << 5), // Common aggregates - FragmentAndRaytracing = (Fragment | RayTracing), + VertexFragmentAndRaytracing = (Vertex | Fragment | RayTracing), // 'Optimize Mesh Data' strip away variants without the keyword set on the vertex stage. All = (Vertex | Fragment | Geometry | Hull | Domain | RayTracing) } } From 7738b87d0640dc86102c0b8fe49fca7ce59085e8 Mon Sep 17 00:00:00 2001 From: Kasper Engelstoft Date: Thu, 23 Sep 2021 10:28:16 +0200 Subject: [PATCH 2/8] Update CHANGELOG.md --- com.unity.shadergraph/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 31df09a876b..76500831e85 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -26,6 +26,7 @@ The version number for this package has increased due to a version update of a r - Fixed an issue where ShaderGraph "view shader" commands were opening in individual windows, and blocking Unity from closing [1367188] - Improved screenspace position accuracy in the fragment shader by using VPOS [1352662] (https://issuetracker.unity3d.com/issues/shadergraph-dither-node-results-in-artifacts-when-far-from-origin-caused-by-screen-position-breaking-down) - Fixed the node searcher results to prefer names over synonyms [1366058] + - Optimize Mesh Data setting will corrupt UV mesh channels [1357902] ## [12.0.0] - 2021-01-11 From 8ae01b8dd74ec62657b3d89cb37e28eb8b6435bc Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 27 Sep 2021 10:20:20 +0200 Subject: [PATCH 3/8] Revert "Case 1357902: Optimize Mesh Data setting will corrupt UV mesh channels" This reverts commit ce8f760132ce72ce6991cfd6cef73d4cb43fb593. --- .../Editor/Material/ShaderGraph/HDTarget.cs | 18 +++++++++--------- .../Enumerations/KeywordShaderStage.cs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index b7f86667539..6b51b25328b 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -1137,7 +1137,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.VertexFragmentAndRaytracing + stages = KeywordShaderStage.FragmentAndRaytracing }; public static KeywordDescriptor DirectionalLightmapCombined = new KeywordDescriptor() @@ -1147,7 +1147,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.VertexFragmentAndRaytracing + stages = KeywordShaderStage.FragmentAndRaytracing }; public static KeywordDescriptor DynamicLightmap = new KeywordDescriptor() @@ -1157,7 +1157,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.VertexFragmentAndRaytracing + stages = KeywordShaderStage.FragmentAndRaytracing }; public static KeywordDescriptor ShadowsShadowmask = new KeywordDescriptor() @@ -1167,7 +1167,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.VertexFragmentAndRaytracing + stages = KeywordShaderStage.FragmentAndRaytracing }; public static KeywordDescriptor ScreenSpaceShadow = new KeywordDescriptor() @@ -1192,7 +1192,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.VertexFragmentAndRaytracing, + stages = KeywordShaderStage.FragmentAndRaytracing, }; public static KeywordDescriptor Decals = new KeywordDescriptor() @@ -1224,7 +1224,7 @@ static class CoreKeywordDescriptors new KeywordEntry() { displayName = "L1", referenceName = "L1" }, new KeywordEntry() { displayName = "L2", referenceName = "L2" }, }, - stages = KeywordShaderStage.VertexFragmentAndRaytracing, + stages = KeywordShaderStage.FragmentAndRaytracing, }; public static KeywordDescriptor LodFadeCrossfade = new KeywordDescriptor() @@ -1447,7 +1447,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.VertexFragmentAndRaytracing, + stages = KeywordShaderStage.FragmentAndRaytracing, }; public static KeywordDescriptor DecalSurfaceGradient = new KeywordDescriptor @@ -1467,7 +1467,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.VertexFragmentAndRaytracing, + stages = KeywordShaderStage.FragmentAndRaytracing, }; public static KeywordDescriptor DisableSSRTransparent = new KeywordDescriptor @@ -1477,7 +1477,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.ShaderFeature, scope = KeywordScope.Local, - stages = KeywordShaderStage.VertexFragmentAndRaytracing, + stages = KeywordShaderStage.FragmentAndRaytracing, }; public static KeywordDescriptor EnableGeometricSpecularAA = new KeywordDescriptor diff --git a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs index c6b9576cc00..7d74c927e0f 100644 --- a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs +++ b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs @@ -13,7 +13,7 @@ internal enum KeywordShaderStage RayTracing = (1 << 5), // Common aggregates - VertexFragmentAndRaytracing = (Vertex | Fragment | RayTracing), // 'Optimize Mesh Data' strip away variants without the keyword set on the vertex stage. + FragmentAndRaytracing = (Fragment | RayTracing), All = (Vertex | Fragment | Geometry | Hull | Domain | RayTracing) } } From 49889be05a374697b9af93d263b44778532381ec Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 27 Sep 2021 10:35:01 +0200 Subject: [PATCH 4/8] Do proper stage frequency for lightmaps --- .../Editor/Material/ShaderGraph/HDTarget.cs | 4 ++-- .../Shaders/Templates/PlanarPrimitive/PassForward.template | 2 +- .../Shaders/Templates/PlanarPrimitive/PassGBuffer.template | 2 +- .../Runtime/Debug/ProbeVolumeDebug.shader | 2 +- .../Runtime/Material/AxF/AxF.shader | 2 +- .../Runtime/Material/LayeredLit/LayeredLit.shader | 4 ++-- .../Material/LayeredLit/LayeredLitTessellation.shader | 4 ++-- .../Runtime/Material/Lit/Lit.shader | 7 ++++--- .../Runtime/Material/Lit/LitTessellation.shader | 6 +++--- .../Runtime/Material/TerrainLit/TerrainLit.shader | 4 ++-- .../Runtime/Material/TerrainLit/TerrainLit_Basemap.shader | 4 ++-- .../Editor/Generation/Enumerations/KeywordShaderStage.cs | 1 + 12 files changed, 22 insertions(+), 20 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index 6b51b25328b..ec057ba1b82 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -1136,8 +1136,8 @@ static class CoreKeywordDescriptors referenceName = "LIGHTMAP_ON", type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, - scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + scope = KeywordScope.Global + // Caution: 'Optimize Mesh Data' strip away attributes uv1/uv2 without the keyword set on the vertex stage. - so do'nt define stage frequency here }; public static KeywordDescriptor DirectionalLightmapCombined = new KeywordDescriptor() diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassForward.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassForward.template index 58dc603a25d..64091fbeb53 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassForward.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassForward.template @@ -13,7 +13,7 @@ Pass ${VFXHDRPForwardDefines} #pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST #pragma multi_compile SHADOW_LOW SHADOW_MEDIUM SHADOW_HIGH SHADOW_VERY_HIGH - #pragma multi_compile PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #pragma multi_compile _ DEBUG_DISPLAY //#pragma enable_d3d11_debug_symbols diff --git a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassGBuffer.template b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassGBuffer.template index ac59932012a..3cae53dc5e4 100644 --- a/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassGBuffer.template +++ b/com.unity.render-pipelines.high-definition/Editor/VFXGraph/Shaders/Templates/PlanarPrimitive/PassGBuffer.template @@ -9,7 +9,7 @@ Pass #pragma multi_compile _ LIGHT_LAYERS #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #define UNITY_MATERIAL_LIT diff --git a/com.unity.render-pipelines.high-definition/Runtime/Debug/ProbeVolumeDebug.shader b/com.unity.render-pipelines.high-definition/Runtime/Debug/ProbeVolumeDebug.shader index 7cfbf0f171a..04b2665ac03 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Debug/ProbeVolumeDebug.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Debug/ProbeVolumeDebug.shader @@ -13,7 +13,7 @@ Shader "Hidden/HDRP/ProbeVolumeDebug" #pragma editor_sync_compilation #pragma target 4.5 #pragma only_renderers d3d11 playstation xboxone xboxseries vulkan metal switch - #pragma multi_compile PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 + #pragma multi_compile_fragment PROBE_VOLUMES_OFF PROBE_VOLUMES_L1 PROBE_VOLUMES_L2 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl" diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader index b2d6beb74aa..2c00ad83895 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/AxF/AxF.shader @@ -491,7 +491,7 @@ Shader "HDRP/AxF" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK 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 85a2943ba29..bee8f7ccb4c 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 @@ -684,7 +684,7 @@ Shader "HDRP/LayeredLit" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -919,7 +919,7 @@ Shader "HDRP/LayeredLit" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK 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 1c231e980e7..a27215af24e 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 @@ -711,7 +711,7 @@ Shader "HDRP/LayeredLitTessellation" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -960,7 +960,7 @@ Shader "HDRP/LayeredLitTessellation" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK 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 1f87f1a581b..1b70118c6e7 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 @@ -478,7 +478,8 @@ Shader "HDRP/Lit" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + // 'Optimize Mesh Data' strip away attribute uv1/uv2 without the keyword set on the vertex stage. + #pragma multi_compile _ LIGHTMAP_ON // Both DIRLIGHTMAP_COMBINED and DYNAMICLIGHTMAP_ON must have vertex frequency to be able to include UV2 in player // If DIRLIGHTMAP_COMBINED isn't define, then DYNAMICLIGHTMAP_ON will not. This is hardcoded in C++ // For ShaderGraph we don't have this issue as UV2 are always included. @@ -764,7 +765,7 @@ Shader "HDRP/Lit" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -845,7 +846,7 @@ Shader "HDRP/Lit" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK 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 8e815c462d6..b67e92ba8d2 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 @@ -498,7 +498,7 @@ Shader "HDRP/LitTessellation" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -796,7 +796,7 @@ Shader "HDRP/LitTessellation" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -879,7 +879,7 @@ Shader "HDRP/LitTessellation" #pragma multi_compile _ LOD_FADE_CROSSFADE #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader index 34435ee6e11..380e3b8944b 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit.shader @@ -130,7 +130,7 @@ Shader "HDRP/TerrainLit" HLSLPROGRAM #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -253,7 +253,7 @@ Shader "HDRP/TerrainLit" HLSLPROGRAM #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK diff --git a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader index c319af34850..1b7f3f6bbf4 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader +++ b/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLit_Basemap.shader @@ -85,7 +85,7 @@ Shader "Hidden/HDRP/TerrainLit_Basemap" HLSLPROGRAM #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK @@ -199,7 +199,7 @@ Shader "Hidden/HDRP/TerrainLit_Basemap" HLSLPROGRAM #pragma multi_compile _ DEBUG_DISPLAY - #pragma multi_compile_fragment _ LIGHTMAP_ON + #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile _ DIRLIGHTMAP_COMBINED #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fragment _ SHADOWS_SHADOWMASK diff --git a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs index 7d74c927e0f..575696919be 100644 --- a/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs +++ b/com.unity.shadergraph/Editor/Generation/Enumerations/KeywordShaderStage.cs @@ -14,6 +14,7 @@ internal enum KeywordShaderStage // Common aggregates FragmentAndRaytracing = (Fragment | RayTracing), + VertexFragmentAndRaytracing = (Vertex | Fragment | RayTracing), All = (Vertex | Fragment | Geometry | Hull | Domain | RayTracing) } } From db1fdde1ff81db2c626a779c64505a0bde8e203a Mon Sep 17 00:00:00 2001 From: Kasper Engelstoft Date: Mon, 27 Sep 2021 10:41:52 +0200 Subject: [PATCH 5/8] fixed up comment. --- .../Editor/Material/ShaderGraph/HDTarget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index ec057ba1b82..6ff5682f905 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -1137,7 +1137,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global - // Caution: 'Optimize Mesh Data' strip away attributes uv1/uv2 without the keyword set on the vertex stage. - so do'nt define stage frequency here + // Caution: 'Optimize Mesh Data' strip away attributes uv1/uv2 without the keyword set on the vertex stage. - so don't define stage frequency here. }; public static KeywordDescriptor DirectionalLightmapCombined = new KeywordDescriptor() From b4f15b396065719712bc5246c75b1d1a7173a5dd Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 27 Sep 2021 11:42:28 +0200 Subject: [PATCH 6/8] Previous fix wasn't enough, really need to have all lightmap keyword at all shader stage --- .../Editor/Material/ShaderGraph/HDTarget.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs index 6ff5682f905..5a95e9a1cdf 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDTarget.cs @@ -1147,7 +1147,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + // Don't define shader stage frequency }; public static KeywordDescriptor DynamicLightmap = new KeywordDescriptor() @@ -1157,7 +1157,7 @@ static class CoreKeywordDescriptors type = KeywordType.Boolean, definition = KeywordDefinition.MultiCompile, scope = KeywordScope.Global, - stages = KeywordShaderStage.FragmentAndRaytracing + // Don't define shader stage frequency }; public static KeywordDescriptor ShadowsShadowmask = new KeywordDescriptor() From e295691a26f34c6fb853a7f4f6c94f73a3bec785 Mon Sep 17 00:00:00 2001 From: Sebastien Lagarde Date: Mon, 27 Sep 2021 11:46:29 +0200 Subject: [PATCH 7/8] fixed changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + com.unity.shadergraph/CHANGELOG.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6e7a1f0188c..f72908d3437 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed texture fields for volume parameters accepting textures with wrong dimensions. - Fixed Realtime lightmap not working correctly in player with various lit shader (case 1360021) - Fixed unexpectedly strong contribution from directional lights in path-traced volumetric scattering (case 1304688). +- Fixed corruption in plalyer with lightmap uv when Optimize Mesh Data is enabled [1357902] ### Changed - Visual Environment ambient mode is now Dynamic by default. diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 76500831e85..31df09a876b 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -26,7 +26,6 @@ The version number for this package has increased due to a version update of a r - Fixed an issue where ShaderGraph "view shader" commands were opening in individual windows, and blocking Unity from closing [1367188] - Improved screenspace position accuracy in the fragment shader by using VPOS [1352662] (https://issuetracker.unity3d.com/issues/shadergraph-dither-node-results-in-artifacts-when-far-from-origin-caused-by-screen-position-breaking-down) - Fixed the node searcher results to prefer names over synonyms [1366058] - - Optimize Mesh Data setting will corrupt UV mesh channels [1357902] ## [12.0.0] - 2021-01-11 From e9433178f68d47a6feb64fda477164a9320dda34 Mon Sep 17 00:00:00 2001 From: Kasper Engelstoft Date: Mon, 27 Sep 2021 12:55:39 +0200 Subject: [PATCH 8/8] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index f72908d3437..13486e5a3a3 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -51,7 +51,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed texture fields for volume parameters accepting textures with wrong dimensions. - Fixed Realtime lightmap not working correctly in player with various lit shader (case 1360021) - Fixed unexpectedly strong contribution from directional lights in path-traced volumetric scattering (case 1304688). -- Fixed corruption in plalyer with lightmap uv when Optimize Mesh Data is enabled [1357902] +- Fixed corruption in player with lightmap uv when Optimize Mesh Data is enabled [1357902] ### Changed - Visual Environment ambient mode is now Dynamic by default.