Search Unity

Is it a problem if I don't expose my _MainTex property for a sprite shader in shader graph?

Discussion in 'Shaders' started by jeango, Feb 10, 2021.

  1. jeango

    jeango

    Joined:
    Dec 19, 2012
    Posts:
    109
    Hi all,
    as you probably all know, you have to define a _MainTex property for sprite shaders. However I find it a bit silly that you get a warning message from unity in the SpriteRenderer component if the _MainTex is not exposed in the shader's inspector.

    I find this a bit silly because afaik, trying to put any texture in there will just have 0 impact, as the SpriteRenderer will override anything you put in there and replace it with the sprite's texture.

    Afaik, when I leave "_MainTex" unexposed, the shader works just fine.

    So I was wondering if I should just ignore this warning message and leave my _MainTex "exposed" box unchecked or if there was something else at play that I'm missing?
     

    Attached Files: