Search Issue Tracker
By Design
Votes
1
Found in
2021.3.37f1
2022.3.25f1
2023.2.19f1
6000.0.0b15
6000.1.0a7
6000.2.0a1
Issue ID
UUM-69796
Regression
No
Unexpected transformations occur when executing 2D Vertex Shaders
Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Scenes/SampleScene” Scene
3. Observe the Game View
Expected result: The “Red” and “Blue” GameObjects render at their origin ignoring the transform position
Actual result: The “Red” and “Blue” GameObjects render following their transform position
Reproducible with: 2021.3.37f1, 2022.3.25f1, 2023.2.19f1, 6000.0.0b15
Reproducible on: Windows 10, Ubuntu 22.04
Not reproducible on: No other environment tested
Workarounds:
- Disable “Red” or “Blue” GameObject. The other will be rendered properly
- Use different Materials with different Shaders. In this example apply “BrokenHLSL” Material to “Red” or “Blue” GameObject. Both will render properly
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
- Assets are created in the Package folders when creating assets via custom buttons in the Inspector window or other windows
- “Select” windows are named differently on Windows and macOS
- [Windows] No minimum “Select” window size
- Enabling “Editor Extension Authoring” in UI Builder doesn’t dirty the document and saving with shortcut doesn’t persist the state
- WebRequest.Create() function fails with "URI prefix is not recognized" errors when the project is built for Linux Standalone or Windows Dedicated Server
Resolution Note:
This is by design and working as intended. Sprite renderers use dynamic batching by default, which is why you see different world matrices depending if the sprites are batched. See https://docs.unity3d.com/6000.0/Documentation/Manual/dynamic-batching.html for batching limitations.
If you require to use world position in your shaders, consider using SRP Batcher instead where per object data is preserved. See https://docs.unity3d.com/Manual/SRPBatcher.html for more information. SRP Batcher for the 2D renderer is available and enabled by default in Unity 6.
Resolution Note:
This is by design and working as intended. Sprite renderers use dynamic batching by default, which is why you see different world matrices depending if the sprites are batched. See https://docs.unity3d.com/6000.0/Documentation/Manual/dynamic-batching.html for batching limitations.
If you require to use world position in your shaders, consider using SRP Batcher instead where per object data is preserved. See https://docs.unity3d.com/Manual/SRPBatcher.html for more information. SRP Batcher for the 2D renderer is available and enabled by default in Unity 6.