Search Unity

Question Tiling based on Sprite size

Discussion in 'Shader Graph' started by Bearsauce, May 4, 2021.

  1. Bearsauce

    Bearsauce

    Joined:
    Jan 4, 2019
    Posts:
    26
    I have a shader graph that can put a texture on a sprite (the original sprite is used to provide the shape). I would like the texture size to stay constant, but currently my problem is that the texture is just stretched to fit the sprite. I know how to achieve the tiling with "Tiling And Offset" node, but how could I get the Tiling input to that node to be automatic and based on the size of the sprite (unit size in game, not scale)?
     
  2. Bearsauce

    Bearsauce

    Joined:
    Jan 4, 2019
    Posts:
    26
    Does someone have ideas? I included a picture to visualize what I mean.
     

    Attached Files: