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
- TileMap selection resets to the default when the Scene is saved
- Opening Terrain Prefab in Prefab Editing Mode throws "NullReferenceException" error
- [Search] Dragging query pills put them behind the search text field
- A CustomPropertyDrawer that returns a PropertyField for a property named the same as a child field will not render all child fields
- Graphics Settings shows default values instead of the real values in the Rendering Debugger when Volume.profile is assigned via script
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