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
- Memory leak when a lot of UI elements are spawned and despawned
- Warnings are not logged in the Console window when using external code analyzers
- Errors “TLS Allocator ALLOC_TEMP_TLS, underlying allocator ALLOC_TEMP_MAIN has unfreed allocations, size 288“ appear constantly when Prefab is open
- Crash on PPtr<Shader>::operator or NullException errors spammed in console when calling Dispose() on null GraphicsBuffer with baked Reflection Probes
- “EndRenderPass: Not inside a Renderpass” and other Render Graph errors in the Player when Render Graph is enabled and Overlay UI is used
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