Search Issue Tracker

By Design

Votes

0

Found in

2018.4

2018.4.18f1

2019.4

2020.2

2021.1

2021.2

Issue ID

1302778

Regression

No

[Android][iOS] unity_Lightmap_HDR.x value is 1 instead of 4.59 when UNITY_LIGHTMAP_DLDR_ENCODING is used

Mobile Graphics

-

How to reproduce:
1. Open the user's attached project "LightmapHDR.zip"
2. Load the Scene "SampleScene"
3. Change the "New Material" render queue in the Inspector to "Transparent"
4. Change the platform build to Android or iOS
5. Build and Run to an Android or iOS device

Expected result: The cube in the Scene is white, "if(abs(unity_Lightmap_HDR.x - 1.0) < 0.1)" activates properly
Actual result: The cube in the Scene becomes blue as "if(abs(unity_Lightmap_HDR.x - 1.0) < 0.1)" runs instead of "if(abs(unity_Lightmap_HDR.x - 4.59) < 0.1)" in the Shader "Test.shader"

Reproducible with: 2018.4.30f1, 2019.4.18f1, 2020.2.2f1, 2021.1.0b3, 2021.2.0a2

Reproducible on:
VLNQA00332, Samsung Galaxy XCover4 (SM-G390F), Android 9, CPU: Exynos 7 Quad 7570, GPU: Mali-T720
VLNQA00288, Samsung Galaxy J7 (SM-J730F), Android 8.1.0, CPU: Exynos 7 Octa 7870, GPU: Mali-T830
VLNQA00004, Meizu MX5 (MX5), Android 5.0.1, CPU: MediaTek Helio X10 MT6795T, GPU: PowerVR Rogue G6200
VLNQA00333, Hmd Global Nokia 7 plus (Nokia 7 plus), Android 10, CPU: Snapdragon 660, GPU: Adreno (TM) 512
VLNQA00099, Google Pixel XL (Pixel XL), Android 9, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530
iPhone 12 Pro (iOS 14.2.1)

Notes:
- In "UnityCG.cginc" it states that "// decodeInstructions.x contains 2.0 when gamma color space is used or pow(2.0, 2.2) = 4.59 when linear color space is used on mobile platforms"
- In step 4 the colour of the cube already changes
- Colour space is set to "Linear" (this can be found in the Project Settings > Player > Other Settings > Color Space)
- Does not reproduce with Windows Standalone/WebGL/Universal Windows Platform (when these platforms are chosen in the Editor)

  1. Resolution Note (2021.2.X):

    unity_Lightmap_HDR values are filled from the lightmap bound to shader. As the shader in question does not use lightmaps unity_Lightmap_HDR gets "default" values

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.