Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question *Help Needed* All URP shaders make material completely transparent (custom and example shaders)

Discussion in 'Shaders' started by christianblevensbarb, Jul 7, 2023.

  1. christianblevensbarb

    christianblevensbarb

    Joined:
    Sep 9, 2020
    Posts:
    1
    Hello, so my problem is that all URP shaders are making textures completely transparent. I started off making a custom shader in the built-in render pipeline due to not understanding that deleting the settings would revert a URP project to that. I have never used shaders before and also never really dabbled in materials so even after a few years in Unity I'm just learning this now.

    Anyways, I had a custom shader that worked perfectly in the built-in render pipeline. I then wanted to make some fog and glowing effects and realized that I wasn't using URP so I decided to port my project over. I then learned that I needed to remake my shader. I did this and found that my material is completely transparent now. I thought I had done something wrong, so after hours of testing things and trying to fix things, I decided to import a basic example off of the Unity website. This example shader is also transparent. I then created a new project and bam, the example shader is still transparent. What is going on? I have links to everything I've been talking about. I can upload the project too if needed

    Original built-in (working) : https://paste-bin.xyz/988078
    URP (not working): https://paste-bin.xyz/988079
    Assigning the variables that the shaders use: https://paste-bin.xyz/988080
    Example shader: https://docs.unity3d.com/Packages/c...riting-shaders-urp-basic-unlit-structure.html
     
    Nitsan448 likes this.
  2. Nitsan448

    Nitsan448

    Joined:
    Aug 22, 2019
    Posts:
    14
    I have the same problem, did you manage to solve it?
     
  3. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    631
    Hi, I think you can either disable Depth Priming (overdraw optimization) in URP renderer or add a "DepthOnly" pass to your custom shader.
     
  4. Nitsan448

    Nitsan448

    Joined:
    Aug 22, 2019
    Posts:
    14
    Disabling depth priming fixed the issue for me, thanks!