Search Issue Tracker
By Design
Votes
0
Found in
2019.3
2019.3.0f6
2020.2
Issue ID
1244783
Regression
No
Shader Graph UV node uses whole Sprite Atlas UVs instead of individual Sprite when entering the Play Mode
How to reproduce:
1. Open the attached project's Scene labeled "Main"
2. Observe the Sprite Atlas animated Sprite
3. Enter the Play Mode
Expected result: Shadergraph UV Node uses the individual Sprite's UVs
Actual result: Shadergraph UV Node uses the Sprite Sheet's UVs
Reproducible with: 2019.3.14f1, 2020.1.0b8, 2020.2.0a11
Couldn't test with: 2017.4.40f1 (Package Manager does not exist), 2018.4.23f1 (ShaderGraph breaks when downgrading)
Comments (4)
-
Wolderado2
Aug 23, 2023 16:06
A solution for 2D, you can use object position (or vertex position) to get local coordinates
-
dr4
Mar 06, 2022 18:14
the fact that the answer is "it is by design" and no one is looking into it... Atlas is a must for consoles like the switch that has the hardware of a calculator, now it turns out that we must decide between atlas or shaders because no one thought that we would need to use them together...
-
iseta
Aug 04, 2021 21:41
This also happens with regular shaders who rely heavily on sprite position and width/height. Not to mention that Unity has the data of the sprite pos inside the atlas quite handy with textureRect/textureRectOffset. Having to modify the shaders themselves for this to work is kind of a pain. Shader Atlas are vital to optimizing mobile gaming performance and pretty much essential to any game that uses AssetBundles. It's honestly disappointing.
-
TimBur
Jul 20, 2021 17:09
This is a problematic design. Simply saying it is 'by design' is a lame reply. Designs can be changed. Sprite Atlases are an important optimization for 2D games, and this design makes it hard to use Shader Graphs with Sprite Atlases. Revising the design to allow easy use of Sprite Atlases with Shader Graphs would be a big help to lots of 2D developers, as evidenced by this thread ... which I can't include because the Unity forms are not on your list of allowed links. :( https://forum.unity.com/threads/shader-graph-getting-local-sprite-uv-from-sprite-sheet.865834/
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
- "GetControlID at event ValidateCommand returns a controlID different from the one in Layout event" Warning is thrown when undoing the deletion of Sprite Shape Profile
- Memory related fields in the "WebAssembly Language Features" can be set to the negative numbers
- A frame spike occurs when Physics Simulation Mode is switched from Script to FixedUpdate
- "WebAssembly Language Features" Header in the Player Settings has a smaller indentation
- No audio is played when Playbable Mixer is changed at runtime
Resolution Note (2020.2.X):
By design if Shadergraph nodes modify or rely on original UV of the sprite, it cannot be part of SpriteAtlas.
Please use Single Sprite not in Atlas when doing so.