From 9c7625b8bab1ec20df96541bd490def1251581b5 Mon Sep 17 00:00:00 2001 From: Kay Chang Date: Tue, 17 Aug 2021 13:57:16 -0700 Subject: [PATCH] Fix for https://fogbugz.unity3d.com/f/cases/1347645/. Terrain heightmap geometry internally use custom instancing code, but unity_RenderingLayer should be uniform to the whole terrain instance (no instancing). --- com.unity.render-pipelines.universal/CHANGELOG.md | 1 + .../Shaders/Terrain/TerrainLit.shader | 4 ++-- .../Shaders/Terrain/TerrainLitAdd.shader | 4 ++-- .../Shaders/Terrain/TerrainLitBase.shader | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/com.unity.render-pipelines.universal/CHANGELOG.md b/com.unity.render-pipelines.universal/CHANGELOG.md index a37c54efd67..0135a05cbdb 100644 --- a/com.unity.render-pipelines.universal/CHANGELOG.md +++ b/com.unity.render-pipelines.universal/CHANGELOG.md @@ -166,6 +166,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed artifacts in Speed Tree 8 billboard LODs due to SpeedTree LOD smoothing/crossfading [case 1348407] - Support undo of URP Global Settings asset assignation (case 1342987). - Removed unsupported fields from Presets of Light and Camera [case 1335979]. +- Fixed graphical artefact when terrain height map is used with rendering layer mask for lighting. ### Changed - Change Asset/Create/Shader/Universal Render Pipeline/Lit Shader Graph to Asset/Create/Shader Graph/URP/Lit Shader Graph diff --git a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader index c7292cd480f..e7149778059 100644 --- a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader +++ b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLit.shader @@ -86,7 +86,7 @@ Shader "Universal Render Pipeline/Terrain/Lit" #pragma multi_compile_fog #pragma multi_compile_fragment _ DEBUG_DISPLAY #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma shader_feature_local_fragment _TERRAIN_BLEND_HEIGHT #pragma shader_feature_local _NORMALMAP @@ -162,7 +162,7 @@ Shader "Universal Render Pipeline/Terrain/Lit" //#pragma multi_compile_fog #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma shader_feature_local _TERRAIN_BLEND_HEIGHT #pragma shader_feature_local _NORMALMAP diff --git a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader index c07e3926919..c37b0a4fee4 100644 --- a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader +++ b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitAdd.shader @@ -77,7 +77,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)" #pragma multi_compile _ LIGHTMAP_ON #pragma multi_compile_fog #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma multi_compile_fragment _ DEBUG_DISPLAY #pragma shader_feature_local_fragment _TERRAIN_BLEND_HEIGHT @@ -124,7 +124,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Add Pass)" //#pragma multi_compile_fog #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma shader_feature_local _TERRAIN_BLEND_HEIGHT #pragma shader_feature_local _NORMALMAP diff --git a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader index c47038e789b..4b8a96e510b 100644 --- a/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader +++ b/com.unity.render-pipelines.universal/Shaders/Terrain/TerrainLitBase.shader @@ -57,7 +57,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)" #pragma multi_compile _ DYNAMICLIGHTMAP_ON #pragma multi_compile_fog #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma multi_compile_fragment _ DEBUG_DISPLAY #pragma vertex SplatmapVert @@ -130,7 +130,7 @@ Shader "Hidden/Universal Render Pipeline/Terrain/Lit (Base Pass)" #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED #pragma multi_compile_instancing - #pragma instancing_options renderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap + #pragma instancing_options norenderinglayer assumeuniformscaling nomatrices nolightprobe nolightmap #pragma vertex SplatmapVert #pragma fragment SplatmapFragment