Skip to main content
5 of 5
deleted 2069 characters in body

How to use a Shader Graph to layer a texture over a sprite without being affected by the sprite's alpha?

I have a hexagon sprite MainTex over which I want to render an outline texture SecondaryTex independent of the alpha value of the MainTex. Since I have a fairly large grid with many hexagons, two sprite renderers are not possible.

I have already achieved the overlay, but can’t get it to decouple from the MainTex alpha. Whenever I set the alpha of the sprite renderer to 0, the outline is also affected. I already tried to use a Maximum Node with the MainTex and the SecondaryTex alpha and use this value, but it doesn’t work.

How can I overlay and display the outline even if the MainTex / Sprite Renderer alpha is 0?

Draft Shader-Graph

Edit:

This is the GameObject with the Sprite Renderer alpha set to 100%:

Alpha at 100%

And this with the alpha set to 10%:

Whole image faded: fill and outline both

The alpha of the outline should not be influenced by the alpha of the MainTex sprite renderer, but it is. The same behavior occurs when I add a maximum node:

Shader graph with max node

These are the import settings:

Hexagon fill import settings

Hexagon outline import settings