Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

[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:
Transparent Object Test

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:
Transparent Object Test with depth write enabled

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.

Glitchy background object

If there is a solution to repair that, this methodology (as hacky a workaround as it’s) might work for me.

[ad_2]

Leave a Reply

Your email address will not be published. Required fields are marked *