Search Unity

Question A shader that looks like a chunk is missing from a wall

Discussion in 'Shader Graph' started by dgoyette, Dec 17, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I've been using decals to make some cosmetic destruction effects, but there are limitations. I've seen shaders in some games that look like an actual hole has been carved out of a surface, and I'm trying to learn whether that concept can be achieved in Shader Graph, and what it's generally called.

    Ideally I'd be able take a model like this (just the inner part), put that onto a flat surface, and render the chunked-out part as though I had performed a boolean operation on the original surface:

    upload_2020-12-17_17-6-48.png

    So far, I haven't found the correct technique for this. I looked into Depth Offset, but that seems to be for something else. I know there's a Scene Depth node, but that just seems to tell me the depth, and it's not for adjusting the effective depth of a pixel.

    Is this sort of thing possible in Shader Graph? I'm using Shader Graph 7.5.2 with HDRP.