Search Issue Tracker
Won't Fix
Votes
1
Found in [Package]
12.0.0
Issue ID
1344181
Regression
No
CameraSortingTexture SubShader captures Normals from _NormalMap
Reproduction steps:
1. Open project "case_1344181-2DLightBug (2)"
2. Open Scene "SampleScene"
3. Enter Play Mode
4. Open Frame Debugger from Window > Analysis
5. Click Enable in the Frame Debugger window
6. Go to the #9 Event in the Frame Debugger
7. Observe Game view
Expected result: CameraSortingTexture shouldn't capture normals
Actual result: CameraSortingTexture only captures normals
Reproducible with: 11.0.0 (2021.1.16f1), 12.0.0 (2021.2.0b4, 2022.1.0a3)
Could not test with: 2019.4.29f1, 2020.3.14f1 (Doesn't have CameraSortingLayer Texture)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Any small change in UI Builder Inspector refreshes Editor Inspector
- Inaccurate Box Collider boundaries on a rotated child Cube when the parent GameObject Scale is non-uniform
- [Android] "SHADOWS_SCREEN" set as shader Keyword when no "_ShadowMapTexture" is bound leads to freeze on a build on some Mali GPU devices
- The global scene list is overridden in a project built with command line when the Override Global Scene List setting is disabled in the build profile
- Global Scenes are not included in the Build when building multiple Build Profiles at the same time
Resolution Note:
What is happening in this bug is that the _CameraSortingLayerTexture is being used after it has been freed and before it has been reallocated. Although it looks like it's capturing the normals, what is happening is the _CameraSortingLayerTexture is being used at an invalid time and is pointing to previously allocated memory that has been reused for normal rendering.
I have added a task to the backlog to point the _CameraSortingLayerTexture to a fixed texture (will either be black or pink) if it is not valid to be used, but as this could be a potential breaking change for some people, this needs design.
Additionally, I will be updating the documentation to warn against this use of the _CameraSortingLayerTexture