Search Issue Tracker


Under Consideration for 2021.3.X, 2022.3.X



Found in









Issue ID




Wrong grass shader when creating TerrainData at runtime in a build



Reproduction steps:
1. Open the attached project “Test Dynamic“
2. Open the “/Assets/Scenes/SampleScene.unity” Scene
3. Build And Run on an Android device

Expected result: The grass is displayed correctly
Actual result: The grass appears as the green rectangles

Reproducible with: 2021.2.0a20, 2021.3.12f1, 2022.1.21f1, 2022.2.0b13, 2023.1.0a17
Not reproducible with: 2020.3.41f1, 2021.1.28f1
Could not test with: 2021.2.0a1 - 2021.2.0a19 (com.unity.test-framework@2.0.1-pre.18\UnityEditor.TestRunner\TestRun\Tasks\Player\SetupBuildPlayerOptionsTask.cs(26,26): error CS1061: 'BuildPlayerOptions' does not contain a definition for 'subtarget' and no accessible extension method 'subtarget' accepting a first argument of type 'BuildPlayerOptions' could be found (are you missing a using directive or an assembly reference?))

Reproducible with devices:
PC Standalone build on Windows 10 Enterprise 21H2
VLNQA00318, Oneplus OnePlus 7 Pro (GM1913), Android 11, CPU: Snapdragon 855 SM8150, GPU: Adreno (TM) 640
VLNQA00231, Huawei HUAWEI Mate 20 Pro (LYA-L29), Android 9, CPU: HiSilicon Kirin 980, GPU: Mali-G76
VLNQA00332, Samsung Galaxy XCover4 (SM-G390F), Android 9, CPU: Exynos 7 Quad 7570, GPU: Mali-T720
VLNQA00325, Samsung Galaxy Note10 (SM-N970F), Android 12, CPU: NOT FOUND, GPU: Mali-G76
VLNQA00231, Samsung Galaxy A5(2017) (SM-A520F), Android 8.0.0, CPU: Exynos 7 Octa 7880, GPU: Mali-T830

Reproduced on: Windows 10 Enterprise 21H2


* When creating TerrainData and grass at runtime in the Editor (Built-in Render Pipeline), Hidden/TerrainEngine/Details/WavingDoublePass shader is used and the grass is displayed correctly
* In the Player on PC and Android, Legacy Shaders/Diffuse shader is used, and the grass is displayed incorrectly
* If TerrainData is not dynamic, the grass is displayed correctly
* Adding WavingDoublePass shader to “Always Included Shaders” didn't help, although it is present and can be found using Shader.Find()

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.