I have been trying to find a way to reliably blow a hole in a mesh, for my case, a wall.
Since actually modifying a mesh to make a hole is practically impossible, I had to turn to shaders. I managed to hide things within the mesh AND behind the mesh.
This doesn't make much sense if you made a bullet hole on a wall and that hole allows you to see through every wall, it wouldn't it? Every single wall behind the hole would also be punched through because they share the same rendering queues.
Giving every wall and its hole object different rendering queues would also be a bad idea. At some point, there would be holes that can see through other player bodies and so on.
In short : hide meshes within a object but show other meshes that are either in front of or behind of the transparent object.
↧