Search Unity

Question Alpha clip in URP

Discussion in 'Universal Render Pipeline' started by Predulus, Dec 9, 2022.

  1. Predulus

    Predulus

    Joined:
    Feb 5, 2018
    Posts:
    90
    Hi ... I'm feeling quite mystified.

    I'm trying to reproduce something like this (pic from Blender) such that I have some pieces cut out of the edges
    of posters, to indicate wear. I thought I had done this a couple of times in Unity before, and expected it to take no more than a minute. But for some reason I just can't get it to work.

    upload_2022-12-9_18-51-14.png

    I've tried using textures in both default and sprite mode.

    upload_2022-12-9_18-54-17.png

    upload_2022-12-9_18-53-33.png

    Then for the material, I think URP > Lit is the right shader to use.

    But apart from the alpha cutoff slider (changing it seems to have no effect), there don't seem to be any other settings for transparency.

    upload_2022-12-9_18-56-58.png

    And googling URP + transparent doesn't seem to give many hits, which in itself is a bit weird. Please, I know I'm just doing something stupid or missing something simple, but I can't seem to find it. What is it, please?
     
  2. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    345
    Basically everything visible in your screenshots looks correct.
    There is one thing that bothers me though. Why do you see the WorkflowMode property? That should be a dropdown from a custom inspector. The default Unity shaders make heavy use of shader features which get toggled by the custom inspector of those shaders. Specifically alpha clipping is one of those shader features which has a separate keyword toggle which needs to be set first in order for the slider to be usable.

    Why are you not seeing the default custom shader inspector?
    Any compilation issues?
    Can you reimport URP package?
    Is your inspector in debug mode?
    Try it again in a new clean project

    This is what URP unlit should look like (and lit similar):
    upload_2022-12-9_11-27-4.png
     
  3. Predulus

    Predulus

    Joined:
    Feb 5, 2018
    Posts:
    90
    Hi @fleity :) and thanks for your reply!

    Yes, I did wonder quite a bit myself, about the inspector looking like that. I just looked at the test texture in Unity (I think I have rebooted, or at least restarted Unity, since then. And guess what? It looks and works as expected, now. Must have been some kind of glitch that just required a restart. I mean, I do know to do that, but for some reason I'm not sure I tried it. Anyway all good, fixed, thanks buddy!