Search Unity

Question Is it possible to do conditional overlapping of textures in shader graph?

Discussion in 'Shader Graph' started by farazk86, May 30, 2023.

  1. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    Hi,

    Im trying to overlap 3 textures. One is the base textures that should always exist (the map view) and I want to be able to change the other 2 at run time via script.

    I have made the following shadergraph to achieve this:

    image_2023-05-30_171744742.png

    This works fine when both textures and that is because the alpha of the overlapping is also an input to the Blend node.

    But when the scene starts only the base texture will be on the model, and on top of this the overlaid textures will be chosen and applied, in this case the alpha goes all the way up and it looks like this :

    image_2023-05-30_172030591.png

    How do I avoid this?

    The user should be able to select the overlapping textures, and until that happens I want to show the map, not a white blank screen?

    Can I set the alpha of blend to a set value when there is no texture selected in overlap_1 and overlap_2 and when there is a texture selected to take from the texture?

    Thanks
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    You can set default textures to transparent ones.
     
    Qriva likes this.
  3. farazk86

    farazk86

    Joined:
    May 31, 2017
    Posts:
    195
    Thats a good idea, thanks I'll give it a try. :)