Search Unity

Shaders and sprite atlases

Discussion in 'Shaders' started by Frontcloud, Oct 16, 2017.

  1. Frontcloud

    Frontcloud

    Joined:
    Feb 25, 2016
    Posts:
    2
    Hey, I've got the following problem:



    I've looked around and couldn't find any definitive answers regarding this. Given that if you set the texture manually via the inspector it's displays correctly it would seem that some sort of backend solution is in place, but I can't seem to figure how to get to work correctly.

    I've messed around with mat.SetTextureOffset a bit it seems hacky and just incorrect.

    What am I missing, what am I doing wrong?

    I'm aware that this is only partially a shader problem, so feel free to move this if it's in the wrong section.

    EDIT: I'm aware of the possibility of converting a sprite to a texture2d given the right conditions. I guess what I'm curious about is if theres some sort of elegant shader solution available.
     
    Last edited: Oct 16, 2017
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,028