Search Unity

Question Sprite Secondary Texture Support

Discussion in 'Shader Graph' started by deep_deep, Oct 5, 2020.

  1. deep_deep

    deep_deep

    Joined:
    Aug 10, 2019
    Posts:
    16
    Using LTS 2019.4.1f1

    Shader Graph doesn't seem to support reading from secondary texture in a sprite. Am I correct? Or just doing something wrong.

    Yes, I double-checked the name. Tried setting _MaskTex as well instead of my custom name _OverlayTex.

    Any idea how I would do sprite renderer + multiple textures otherwise?
     

    Attached Files:

  2. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,514
    I'm using 2019.4.11 and it works for a custom texture. The SpriteRenderer automatically pulls the correct Main and secondary texture information to Shader Graph.

    It does not, however, work for Sprite Atlas. That only works in 2020.2. Is this sprite in an Atlas? It should still work in Scene, if so. It swaps to the Atlas on Play, which is where it'll fail.

    Do you have a setup similar to 2D Renderer sample? https://github.com/Unity-Technologies/2d-renderer-samples

    If you're truly desparate you can supply a Material to the SpriteRenderer with the correct textures assigned in the Inspector.

    Also, you should try assigning some random textures to your material in the Inspector. I've noticed some oddness now that I'm thinking about it in getting it to appear the first time. I needed to assign something (even something incorrect) on the material, like the null texture wasn't getting it to notice a secondary is needed.