Search Unity

Question Exclusion mask overlay shader?

Discussion in 'Shader Graph' started by Digika, Mar 14, 2021.

  1. Digika

    Digika

    Joined:
    Jan 7, 2018
    Posts:
    225
    So I'm using `GL.QUADS` to draw some basic circle, however, the issues I'm encountering is that if the color has alpha, overlapping line-segments will blend and mix so instead of even circle with alpha, let's, say, 0.5, I get combined mixed alpha on the segments where line ends have to overlap. This makes circle very "ragged" looking. Unlike, let's say, with rectangle, I cant possibly do some points logic to account for that, the corners of the filled quads that act as a line will always mix.

    So my assumption is that the only way I can solve this is with pixel shader that excludes previous pixels (clears them?) and applies the overlapping quad color only. I've never worked with shaders before - any suggestions?