Search Issue Tracker

Won't Fix

Votes

3

Found in

2020.3.44f1

2021.3.17f1

2022.2.2f1

2023.1.0b2

2023.2.0a1

Issue ID

UUM-3250

Regression

No

[OpenGLES3] GLSL Shader always renders in (0, 0, 0) position when built and deployed

-

Reproduction steps:
1. Open project "GLSL_URP.zip"
2. Open Scene "SampleScene"
3. Move the cube away from (0, 0, 0), for example, to (1, 0, 1) using the Inspector
4. Build and run

Expected result: The red cube is placed wherever the user placed it in the 3rd reproduction step
Actual result: The cube is placed in (0, 0, 0) position

Reproducible with: 7.5.2 (2019.4.18f1), 9.0.0-preview.72 (2020.1.17f1), 10.2.2 (2020.2.2f1, 2021.1.0b1)
Can't test with: 2018.4.30f1 (does not support Universal RP package)

Reproducible with:
Player on Windows 10
VLNQA00277, Asus ROG Phone, Android: 8.1.0, CPU: Snapdragon 845 SDM845, GPU: Adreno (TM) 630
VLNQA00006, Samsung Galaxy S7, Android: 8.0.0, CPU: Exynos 8 Octa 8890, GPU: Mali-T880
VLNQA00121, Samsung Galaxy S9, Android: 9, CPU: Exynos 9 Series 9810, GPU: Mali-G72

Not reproducible with:
Editor on Windows 10
Editor and Player on iMac 10.15.7, 3,4 GHz Quad-Core Intel Core i5 (OpenGLCore)
VLNQA00030, Lge LG G2, Android: 4.4.2, CPU: Snapdragon 800 MSM8974, GPU: Adreno (TM) 330
VLNQA00310 iPad Pro 12.9 1st gen (iOS 13.4.1)

Notes:
- After deleting Universal RP package, the issue does not reproduce
- Reproduces only on OpenGLES3 when running on Android

  1. Resolution Note:

    There are no fixes planned for this Bug

Comments (1)

  1. N7RX_Y

    Jan 24, 2023 21:20

    This is not a bug but a compatibility issue between GLSL shader and SRP Batcher.

    By default, URP enables SRP batcher (https://docs.unity3d.com/Manual/SRPBatcher.html), and it requires that all built-in engine properties to be declared in a single cbuffer. The GLSL vertex shader in the project uses gl_ModelViewProjectionMatrix * gl_Vertex, which internally generates a property matrix unity_ObjectToWorld that exists outside of the default cbuffer. Therefore, the matrix did not get updated properly when SRP batcher is enabled.

    There are two solutions to this issue:
    1. Use ShaderLab or ShaderGraph shaders instead of GLSL shader (recommended if possible).
    2. Disable "SRP Batcher" in the project's Universal Render Pipeline Asset settings.

    Please refer to https://github.com/Unity-Technologies/Graphics/blob/master/Packages/com.unity.render-pipelines.universal/Documentation~/shaders-in-universalrp.md#srp-batcher-compatibility for more info.

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.