Search Issue Tracker

Fixed

Fixed in 6000.0.19f1

Votes

1

Found in

6000.0.13f1

Issue ID

UUM-77050

Regression

Yes

ShaderGraph sprite is replaced by a blue box when using ShaderGraph Material

-

Reproduction steps:
1. Open the attached “BugRepro” project
2. Open the “Assets/Scenes/2D Shader Studies.unity” Scene
3. Enter the Play Mode
4. Exit the Play Mode
5. Observe the view

Expected result: ShaderGraph sprite stays the same
Actual result: ShaderGraph sprite is replaced by a blue box

Reproducible with: 2023.1.0a11, 6000.0.13f1
Not reproducible with: 2022.3.40f1, 2023.1.0a10
Couldn't test with: 2021.3.40f1 (there is no ShaderGraph material)

Reproducible on: Windows 11
Not reproducible on: No other environment tested

Note: Sprite shows up again when reimporting the ShaderGraph material or opening ShaderGraph and saving it

  1. Resolution Note:

    By design, 2D SRP-Batcher does not support access of TexelSize property in Shader. The Custom Node in the project does that and uses SRP-Batcher to render the Sprite. To fix, either please disable SRP-Batcher for that shader or add a custom node to set TexelSize within graph.

    You can simply a Vector4 MainTex_TexelSize to the ShaderGraph which also automatically populates the required value and fix the issue.

  2. Resolution Note (fix version 6000.0.19f1):

    Fix case where ShaderGraph sprite is replaced by a blue box when using ShaderGraph Material
    Fix will be available on Unity 6000.0.19f1 and above

Comments (2)

  1. jaydee_programming

    Nov 07, 2024 08:06

    "You can simply a Vector4 MainTex_TexelSize to the ShaderGraph which also automatically populates the required value and fix the issue."

    Not legible. Please re-write with clear instructions.

    As the original reporter stated, this is not an issue in 2022 LTS. The person who marked this fixed is mistaken.

  2. TheSankar

    Aug 22, 2024 19:50

    While I may be biased (it's my bug report, after all), I think this question needs to be looked a little deeper.

    In 2022 LTS you can freely use SRP-Batcher with the _TexelSize property.

    Things Broke down somewhere around this fix: https://issuetracker.unity3d.com/issues/the-maintex-texelsize-property-is-not-being-set-when-compiling-a-shader

    I personally think the focus should be in re-enabling support for _TexelSize in SRP-Batcher materials/shader, and not simply removing SRP-Batcher compatibility with these materials.

    As in 2020, _TexelSize making a material SRP-Batcher incompatible was seem as a bug:
    https://issuetracker.unity3d.com/issues/shadergraph-shader-loses-srp-batcher-compatibility-if-texel-size-node-is-used

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.