Search Unity

Question How to use shader graph (or otherwise) to make an object transparent

Discussion in 'Shader Graph' started by samdaman93, Sep 5, 2021.

  1. samdaman93

    samdaman93

    Joined:
    Oct 3, 2015
    Posts:
    37
    Hello,

    I'm struggling with a wee problem at the moment. I want to make my pot transparent when its picked up. I'm struggling to learn shader graphs and can't seem to maintain the steel sheen when I change the surface to transparent, I'm using opaque at the moment. Is there a way to change it through shader graph or through scripting so its opaque until a point? Or atleast maintain the shine until it becomes transparent? I think I'm botching the workflow through the shader graph as changing the shader graph settings don't seem to do anything. All help welcomed!

    Opaque version (URP/lit)
    upload_2021-9-5_16-3-29.png

    Transparent version (URP/lit - Alpha 1)
    upload_2021-9-5_16-4-23.png

    Shader graph - opaque&transparent look the same
    upload_2021-9-5_16-7-48.png
     
  2. samdaman93

    samdaman93

    Joined:
    Oct 3, 2015
    Posts:
    37
    I just realised that there's a save asset button on the shader graph. This still causes the transparency problem seen in the second snip. Cheers!
     
  3. samdaman93

    samdaman93

    Joined:
    Oct 3, 2015
    Posts:
    37
    bump, any help I'm at wits end. I've scoured the internet and can't get my poor texture working
     
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    The problem is that transparent objects can have sorting issues.
    You could try to use the cutout function in the opaque shader variant and use the dither function to feed it.
    That will cause a percentage of the pixels to be hidden.
    Its not semi transparent but should work for your case.