How to deal with wall occlusion

Godot Version

4.7.2

Question

Hi

I am making a 3d, angled view-down. I’ve written for myself a wall disappearing system. Whenever the protagonist walks behind a wall, the wall fades to invisibility. It works pretty well, I was happy with it until I finalized the primitive prototype stage. I am now moving to rich prototype stage, I want the environs to actually look nice and I worry my system is just untenable.

It works by casting rays from camera to the protagonist. If the ray intersects a wall, a properly marked StaticBody3D, that wall fades and disappears. But how would I use that in an actual game? I’d have to cut up any complex scene in Blender into wall-sized fragments, basically rebuild them in Godot with StaticBodies which means using Godot as a 3D modelling tool. This would be an awful experience. I can instead do this with a shader, run an occlusion cone from the camera to the protagonist, disappearing everything within that cone, but that in turn will expose ugly geometries living between and inside the objects.

Is there a Godot-canonical way of doing this? How are you dealing with it?

Most large scale games I know have modular pieces that the devs / mappers put together, having one giant model for a whole room or something is almost always a bad idea for a lot of different reasons, and this is just one of them. Unfortunately your best bet is probably to break up all your models into smaller, modular bits and pieces, then piece them back together inside godot.

It goes without saying that separating a mesh into multiple meshes has no bearing on the Godot-side of things; the model will import the meshes in the same way. Unless you are already manually exporting each model from Blender into a glTf file, I don’t see how cutting up the complex scenes into more meshes produces a problem.

Could you describe your Blender-to-Godot workflow for us so we can get a better understanding of the context of your problem? Your problem might be elsewhere.

If you do this properly, I don’t see how the cone you use to perform the stencil test will expose any hidden parts. You are literally hiding everything within the cone, so how can it expose something within itself?