Search Unity

Question Generating holes in meshes

Discussion in 'Shaders' started by JohnyJones, Jan 4, 2021.

  1. JohnyJones

    JohnyJones

    Joined:
    Nov 23, 2019
    Posts:
    3
    Hi, I've been reading an article that describes rendering holes in objects using SDF textures. https://80.lv/articles/creating-a-rock-melting-gun-effect-in-unity/

    I am trying to recreate this effect - I have already baked my meshes into 3D texture, but since I am not that good with shaders, I don't know how to render it correctly. The farthest I've gotten was sampling the 3D texure and rendering it (image below).

    upload_2021-1-4_21-10-16.png

    No matter what I try, the surface resolution doesn't seem that great (even if I bake at very high resolutions). That makes me think you have to render it either using two render passes, one lit shader with dissolve and another for raymarching the interior, or do I have to use two mesh renderers and align them or something? Also this is in URP, but I think that shouldn't make a difference.

    I understand the other parts of the article, it's just this step that is causing me problems. Hope you can give me a little nudge in the right direction.
     
    Last edited: Jan 4, 2021