How to make transparent parts not show up when behind their own part

im using urp and the default Lit shader.


the problem (Surface type: Transparent)
9830214--1413711--bruh.png

what i want but transparent (surface type: Opaque)
9830214--1413714--NOT TRANSPARENT.png

by the way I only want its own parts not to show when behind. not everything else

Maybe I am not understanding your last sentence, but it sounds like you just want an Opaque-but-low-Alpha object that fades like the old built-in “Fade” render mode. You see stuff behind the object, but you don’t see overlapping areas of the front faces of concave portions of the same object.

In URP, you don’t have the same ability, but you can recreate it by drawing twice, with two special (but simple to create) shaders/materials. You can force Unity to draw an object twice by just adding a second material slot on the renderer.

Both materials should be TRANSPARENT rendering pass. With the top material, draw once with a zero alpha and a forced depth (and skip any other lighting effects like ambient occlusion or specular/metallic reflections. With a second material, draw the same object a second time, outputting whatever alpha level you want (even animated).

(Imgur links die eventually, but this is a quick knockup example.)

2 Likes

Not animated, but same concept.

1 Like

I dont get it. i dont know alot about render stuff.
can you like visual it?


2 Likes

its not doing the transparent thing. it just turns to lit to unlit

and i didnt know what this node was
9837300--1415274--node.png

You’re close.

Your “Split node” is taking the R output, not the A output. In my shot I squished that node so that may have been confusing. The A output should wire into the multiply node below it.

The little node is called a Redirector, it’s just a visual bend in the wire, not required.

When you compile the shader graphs, they make a nice little material (with the ball icon) inside themselves, but you can’t adjust it. Duplicate that ball material and it makes a new material asset. In the duplicate, you will be able to assign whatever textures you like to the “Base Map” input (just as your original material may have had), and adjust the Alpha for overall transparency.

1 Like

Thank you! it works