Problem with Material remaining transparent, even when at full alpha?

Hello people.

I’m trying to get a transparent material to go from 0 to 100% opacity for the sake of a fade in effect.

I have an issue with a material ( all materials ) remaining overly transparent even when at 100% alpha.
I’m using the URP 10.7.0 with Hybrid Renderer v2 0.11.0 ( as I’m working with DOTS ).

There are two materials in question, the BaseColour and TeamColour of this structure are both ( as in the picture ) set to Surface Type transparency, with Base Map alpha == 100%. However are still visibly transparent.

Have a look at the picture attached.
Any advice would be welcome.

Hey @Lapsapnow
URP uses a depth buffer to sort fragments and the transparent materials don’t write to depth by design. I think your best options is to recreate the shader as a shadergraph. In the graph settings you can force depth to be written by transparent materials. That should make the fragments sort properly :slight_smile:

7878076--1001851--upload_2022-2-8_9-28-17.png

2 Likes

My version of the graph editor doesn’t contain any of the parameters beyond Blending Mode… What do I need in order to see that? Minimal version? etc?

Ah sorry, I didn’t catch that you are on hybrid. I’m actually not sure when depth write was exposed in shadergraph. Does it also not expose alpha clipping?

Hi, I have a similar issue. Any Lit shader graph shaders(even if it’s just the default Lit Shader graph shader) would not render(invisible) in built(standalone) version. They would be visible in Editor mode, but stay completely transparent except for ambient occlusion if I have a texture there. I think this may be a bug. Any idea how to fix it?

Hey @mashixuan8
This doesn’t sound like it’s related to the depth write issues discussed in this thread. Could you maybe start a new thread showing some images of what you’re seeing?

no problem. But I have already pinpointed what the problem is. It’s with the Render feature: Decal. When you add that in with the Default “Techanique: Automatic”, any Lit Shadowgraph shader would not render. I tried changing the technique to “Screen space” with a normal blend of High, and the shader graphs would render correctly; not sure about the other techniques and settings. Tested multiple times on Unity 2021.2.11f1(latest version). I think this is definitely a bug, and it’s really easy to reproduce. You can test this very quickly yourself too. If you are with the Unity team, do you mind giving it a try and reporting this bug?

Just tested the technique: DBuffer with surface data of Albedo Normal MAOS, and the shaders did not render correctly. I think the default automatic uses this technique and makes all shader graph lit shaders invisible.

Remember to test it in in the built version. In Editor it would look just fine.

Also I just created the thread:
https://discussions.unity.com/t/871821

That’s alright Jonas. Yes sadly because I’m on hybrid I’m careful to update the URP in fear of breaking it.

( PS. I wish I could delete this other guy’s unrelated messages in my thread… )

The graph does expose alpha clip.
This is what it gives me.
7898197--1006024--Screenshot 2022-02-15 143847.png

Alright. I don’t know what effect you’re going for but you could experiment with a dither pattern and alpha clip in an opaque shader. Something like this:

Not easy to see in a gif but I’m putting it in anyway :slight_smile:
7900582--1006492--dither_alpha.gif

Thank you very much sir!