Skip to content
Menu
Mob City
  • Home
  • Contact
  • About
Mob City

Building occlusion

Posted on September 12, 2025

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:

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • Building occlusion
  • Rendering 120k+ entities
  • Modular building graphics
  • Lit up mode in night time
  • Night mode (tinting with shaders)
©2025 Mob City