From 939bdd7c69d2a1e08a41b40a512d6231b4a4fe87 Mon Sep 17 00:00:00 2001 From: tomzig16 Date: Tue, 9 Nov 2021 17:35:51 +0200 Subject: [PATCH 1/4] Make USE_DRAW_PROCEDURAL variation only for vertex programs in UberPost shader --- .../Shaders/PostProcessing/UberPost.shader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader index 11416a8aab5..bf6c5bf3311 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader @@ -10,7 +10,7 @@ Shader "Hidden/Universal Render Pipeline/UberPost" #pragma multi_compile_local_fragment _ _DITHERING #pragma multi_compile_local_fragment _ _LINEAR_TO_SRGB_CONVERSION #pragma multi_compile_local_fragment _ _USE_FAST_SRGB_LINEAR_CONVERSION - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #pragma multi_compile_fragment _ DEBUG_DISPLAY #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" From ac3031c958207b5db026eba79179502684de6444 Mon Sep 17 00:00:00 2001 From: tomzig16 Date: Thu, 11 Nov 2021 12:45:41 +0200 Subject: [PATCH 2/4] Make USE_DRAW_PROCEDURAL variation only for vertex programs This change was done only for shaders inside PostProcessing folder --- .../Shaders/PostProcessing/Bloom.shader | 2 +- .../Shaders/PostProcessing/BokehDepthOfField.shader | 2 +- .../Shaders/PostProcessing/CameraMotionBlur.shader | 2 +- .../Shaders/PostProcessing/FinalPost.shader | 2 +- .../Shaders/PostProcessing/GaussianDepthOfField.shader | 2 +- .../Shaders/PostProcessing/PaniniProjection.shader | 2 +- .../Shaders/PostProcessing/StopNaN.shader | 2 +- .../PostProcessing/SubpixelMorphologicalAntialiasing.shader | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/Bloom.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/Bloom.shader index 8bf80d133da..ba1cbcbb017 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/Bloom.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/Bloom.shader @@ -3,7 +3,7 @@ Shader "Hidden/Universal Render Pipeline/Bloom" HLSLINCLUDE #pragma exclude_renderers gles #pragma multi_compile_local _ _USE_RGBM - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/BokehDepthOfField.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/BokehDepthOfField.shader index 4ef6283f48a..f41b031a447 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/BokehDepthOfField.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/BokehDepthOfField.shader @@ -3,7 +3,7 @@ Shader "Hidden/Universal Render Pipeline/BokehDepthOfField" HLSLINCLUDE #pragma exclude_renderers gles #pragma multi_compile_local_fragment _ _USE_FAST_SRGB_LINEAR_CONVERSION - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/CameraMotionBlur.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/CameraMotionBlur.shader index 900497f3a10..dd95925dee8 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/CameraMotionBlur.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/CameraMotionBlur.shader @@ -3,7 +3,7 @@ Shader "Hidden/Universal Render Pipeline/CameraMotionBlur" HLSLINCLUDE #pragma exclude_renderers gles - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Random.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/FinalPost.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/FinalPost.shader index f3b0f279f5a..1f407e44afe 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/FinalPost.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/FinalPost.shader @@ -6,7 +6,7 @@ Shader "Hidden/Universal Render Pipeline/FinalPost" #pragma multi_compile_local_fragment _ _FILM_GRAIN #pragma multi_compile_local_fragment _ _DITHERING #pragma multi_compile_local_fragment _ _LINEAR_TO_SRGB_CONVERSION - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #pragma multi_compile_fragment _ DEBUG_DISPLAY #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/GaussianDepthOfField.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/GaussianDepthOfField.shader index 4342a30ea86..1a3f82658c8 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/GaussianDepthOfField.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/GaussianDepthOfField.shader @@ -4,7 +4,7 @@ Shader "Hidden/Universal Render Pipeline/GaussianDepthOfField" #pragma target 3.5 #pragma exclude_renderers gles - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl" #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/PaniniProjection.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/PaniniProjection.shader index 36c7e73346b..d2c282e1fd5 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/PaniniProjection.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/PaniniProjection.shader @@ -5,7 +5,7 @@ Shader "Hidden/Universal Render Pipeline/PaniniProjection" #pragma exclude_renderers gles #pragma multi_compile_local _GENERIC _UNIT_DISTANCE - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" #include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl" diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/StopNaN.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/StopNaN.shader index 9a41155deee..791525a7ef4 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/StopNaN.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/StopNaN.shader @@ -2,7 +2,7 @@ Shader "Hidden/Universal Render Pipeline/Stop NaN" { HLSLINCLUDE #pragma exclude_renderers gles - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #pragma exclude_renderers gles #pragma target 3.5 diff --git a/com.unity.render-pipelines.universal/Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader b/com.unity.render-pipelines.universal/Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader index 132340687ca..4dbb4dfcc1f 100644 --- a/com.unity.render-pipelines.universal/Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader +++ b/com.unity.render-pipelines.universal/Shaders/PostProcessing/SubpixelMorphologicalAntialiasing.shader @@ -9,7 +9,7 @@ Shader "Hidden/Universal Render Pipeline/SubpixelMorphologicalAntialiasing" HLSLINCLUDE #pragma multi_compile_local _SMAA_PRESET_LOW _SMAA_PRESET_MEDIUM _SMAA_PRESET_HIGH - #pragma multi_compile _ _USE_DRAW_PROCEDURAL + #pragma multi_compile_vertex _ _USE_DRAW_PROCEDURAL #pragma exclude_renderers gles ENDHLSL From 3d2e5efd622e8fd07d39ff5a6b1c574a2f9dd05a Mon Sep 17 00:00:00 2001 From: tomzig16 Date: Thu, 18 Nov 2021 17:04:21 +0200 Subject: [PATCH 3/4] Update changelog --- com.unity.render-pipelines.universal/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 7986dc8671f..839cee27acd 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Multiply blend now keeps DstAlpha as it's RGB only. - Particle AlphaModulate() renamed to AlphaModulateAndPremultiply() as it does both. Moved separate AlphaModulate() and AlphaPremultiply() to URP shader library. Fix double alpha multiply for ParticleLit. - Improved blending modes trigger a material update which tries to keep the existing look intact. This is not always possible and manual blend mode changes might be required. +- Changed "_USE_DRAW_PROCEDURAL" to be used only in vertex shader in Post Processing related shaders as they are not needed for fragment shaders. In result we now generate less shader variants. ### Fixed - Fixed incorrect premultiply blend mode. case 1260085, case 1357703, [case 1347301](https://issuetracker.unity3d.com/product/unity/issues/guid/1347301/) From cdc0e0b995e70f3755c0df030ad54259c6a2c984 Mon Sep 17 00:00:00 2001 From: "noreply@unity3d.com" Date: Thu, 18 Nov 2021 15:48:13 +0000 Subject: [PATCH 4/4] Apply formatting changes --- com.unity.render-pipelines.universal/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index 839cee27acd..d2c68d8b6fc 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -25,7 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Multiply blend now keeps DstAlpha as it's RGB only. - Particle AlphaModulate() renamed to AlphaModulateAndPremultiply() as it does both. Moved separate AlphaModulate() and AlphaPremultiply() to URP shader library. Fix double alpha multiply for ParticleLit. - Improved blending modes trigger a material update which tries to keep the existing look intact. This is not always possible and manual blend mode changes might be required. -- Changed "_USE_DRAW_PROCEDURAL" to be used only in vertex shader in Post Processing related shaders as they are not needed for fragment shaders. In result we now generate less shader variants. +- Changed "_USE_DRAW_PROCEDURAL" to be used only in vertex shader in Post Processing related shaders as they are not needed for fragment shaders. In result we now generate less shader variants. ### Fixed - Fixed incorrect premultiply blend mode. case 1260085, case 1357703, [case 1347301](https://issuetracker.unity3d.com/product/unity/issues/guid/1347301/)