Search Unity

Transparent cutout with Amplify Shader Editor and LWRP

Discussion in 'Shaders' started by ozturk_brk, Nov 9, 2019.

  1. ozturk_brk

    ozturk_brk

    Joined:
    Jun 27, 2018
    Posts:
    10
    I'm trying to create a transparent cutout shader with Amplify Shader Editor and LWRP but not succeeded.

    I have a mesh that has two planes intersect with each other and an image with a transparent background. This is my shader and result so far:

    amp.PNG

    As you will see I can see the butterfly beneath the other one. Somehow something is missing. But I could not find it. When I change the shader to "Unlit/Transparent Cutout" the result is this:

    unlit_TransparentCutout.PNG

    It is quite perfect. This has probably an easy solution but I am very new to this stuff. What am I doing wrong? Thanks in advance.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    Cutout shaders do not use alpha blending. They are opaque shaders using alpha testing. For most node based shader editors this is implemented via an alpha threshold value. Output your alpha normally and set a threshold value of 0.5.
     
    Kali2048 likes this.
  3. giantkilleroverunity3d

    giantkilleroverunity3d

    Joined:
    Feb 28, 2014
    Posts:
    383
    @bgolus Here is my attempt at the transparent cutout shader. I am starting to believe my nodes are incorrect.
    The water was a bit lighter so I used to GIMP to darken it and that worked. Then I enhanced it in ASE. But I can not get the dark to become a transparent here. I put the cube in the middle so when the transparency works I will see it better.
    I have posted this a number of places and getting the feeling I am being disregarded as a noob who didnt RTFM.
    I have made, dissected and converted shaders in the past and with the NEXT one always comes a learning experience. The dark area might have other attributes that I am not aware of at the moment.
    Any help or advice would be appreciated. I know I am probably missing something very basic.
     
  4. Baasket

    Baasket

    Joined:
    May 20, 2018
    Posts:
    26
    It's been a long time, but thank you, that was just what I needed...