[ad_1]
Probably an enormous query, however it looks like it must be easy sufficient. I’ve an object in my recreation composed of a number of elements (related GameObjects with their very own renderers). I wish to make this complete object semi-transparent, with out seeing the elements of the item by way of itself.
This is an instance of what I’ve thus far:
There are two cubes, with one other stretched dice connecting them. The sphere within the background is simply to indicate an object within the background. Discover how one can see the ends of the connecting dice inside the opposite cubes. That is what I do not need. I solely need the front-most faces of the general “composite object” to be seen. I need interior faces of the item to be occluded, whereas maintaining the item as an entire semi-transparent.
Turning on “depth write” virtually kind of works, however it offers me this:
I’ve looked for hours to try to work out easy methods to implement this. This is the closest factor I’ve discovered, however it’s for URP, and I am unable to work out easy methods to translate it over to HDRP. I’ve run into discuss creating shaders, however at this level I’ve by no means touched shader design (on any platform), and might hardly start to determine how I’d accomplish this.
I really feel like I am unable to be the primary particular person to have this drawback on this setup. Can anybody define for me easy methods to get the transparency I would like, particularly in Unity’s Excessive Definition Render Pipeline?
EDIT:
Attempting the suggestion from:
Fade in rendering mode would not work as meant
I’ve duplicated the item and utilized the next shader to one of many overlapping copies.
Shader "Unlit/DepthReserve"
{
Properties
{
}
SubShader
{
Tags { "RenderType" = "Opaque" "Queue"="AlphaTest+1" }
LOD 100
Mix Zero One
Move
{
}
}
}
This very almost works, however it ends in some unusual glitching. Watch how the background object erratically pokes by way of the clear one after I transfer the digicam.
If there is a solution to repair that, this methodology (as hacky a workaround as it’s) might work for me.
[ad_2]