In any isometric game, one of the classic challenges is figuring out how to show what’s behind buildings and more importantly, how the player can interact with anything hidden by a structure.

I went with a solution that’s simple to implement and is reminiscent of that early 2000s aesthetic: just remove the floor above and use some light artistic cues to suggest you’re now looking into a basement or lower level.
The core of the implementation is straightforward. I pass an opacity value down to the shader using my own game_object
structure via the ModernGL wrapper. The flow looks like this:
game engine instruction → ModernGL → shader.vert → shader.frag.

Next up was camera interaction. The idea is simple – whenever the camera is centered on a building and at a pre-defined zoom level, we trigger occlusion to reveal what’s underneath.

Tweaked opacity levels to be dynamic – higher the floor, higher the opacity. Here’s the final result: