Home Game Development transparency – Transparent Composite Object In Unity HDRP

transparency – Transparent Composite Object In Unity HDRP

0
transparency – Transparent Composite Object In Unity HDRP

[ad_1]

Potentially a big question, but it seems like it should be simple enough. I have an object in my game composed of multiple parts (connected GameObjects with their own renderers). I want to make this entire object semi-transparent, without seeing the parts of the object through itself.

Here’s an example of what I have so far:
Transparent Object Test

There are two cubes, with another stretched cube connecting them. The sphere in the background is just to show an object in the background. Notice how you can see the ends of the connecting cube inside the other cubes. That’s what I don’t want. I only want the front-most faces of the overall “composite object” to be visible. I want inner faces of the object to be occluded, while keeping the object as a whole semi-transparent.

Turning on “depth write” almost sort of works, but it gives me this:
Transparent Object Test with depth write enabled

I’ve searched for hours to try and figure out how to implement this. This is the closest thing I’ve found, but it’s for URP, and I can’t figure out how to translate it over to HDRP. I’ve run into talk about creating shaders, but at this point I’ve never touched shader design (on any platform), and can hardly begin to figure out how I would accomplish this.

I feel like I can’t be the first person to have this problem in this setup. Can anyone outline for me how to get the transparency I need, specifically in Unity’s High Definition Render Pipeline?

[ad_2]