Search Unity

Question Transparent shader causing strange square shapes on other particles

Discussion in 'Shaders' started by Zack_C, Jan 5, 2023.

  1. Zack_C

    Zack_C

    Joined:
    Jul 21, 2015
    Posts:
    6
    Hi,

    Hope someone will be able to help me on this.

    I made a very simple erode shader that looks like this.
    upload_2023-1-5_9-49-53.png
    upload_2023-1-5_9-55-4.png

    And I made a material with this settings
    upload_2023-1-5_9-50-46.png

    I used it as a particle system and noticed it produces this strange square shape on other particles as well. It doesn't happen on regular meshes. I tried changing the source/dst factors and blend modes but it keeps appearing. I've enabled the GPU instancing as well but it doesn't change anything.

    upload_2023-1-5_9-47-45.png

    If it helps, I'm using 2019.4.31f and on URP.

    Would anyone be able to point out what is causing the square shapes to appear? Thanks!
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    By default Unity shaders write to depth, which you don't want for transparent materials. You'll want to add this:
    ZWrite Off
    (or add it as another thing you can modify via properties.)