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

2D

-

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)

  1. 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.

Comments (4)

  1. Wolderado2

    Aug 23, 2023 16:06

    A solution for 2D, you can use object position (or vertex position) to get local coordinates

  2. 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...

  3. 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.

  4. 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

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.