- Home /
Create a hole in a mesh using a shader
The Problem
have a tunnel which travels through and collides with a single-sided wall. Without the need to edit the mesh or call expensive CSG boolean methods, I would like for some way to create a hole in the wall which the player can walk through (I will disable the wall collider as the player steps into the tunnel):
Desired Functionality
've been trying to find/create a shader which creates the illusion that there's a hole in a mesh. I'm trying to make it so that I can attach a shader material to some GameObject and use that GameObject to cut a hole in another mesh (similar to the way booleans work on 3d meshes). Here is the desired functionality: By looking back out the tunnel and while passing through the tunnel, the player shouldn't notice anything out of the ordinary (i.e whatever was outside of the tunnel before the player walked into the tunnel should still appear to be there after the player walks through the tunnel and looks back).
I'm fairly new to writing shaders. I've been googling around for a while and haven't been able to find anything on this that fits the problem exactly. If anyone has any insight, I would greatly appreciate any help! Here are some breadcrumbs I've found, but they didn't give the right results: