Skip to content
Menu
Mob City
  • Home
  • Contact
  • Patreon
  • 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:

  • buildings
  • graphics
  • Isometric
  • occlusion

2 thoughts on “Building occlusion”

  1. John says:
    October 2, 2025 at 10:53 pm

    Hey man, I’m really looking forward to this coming out! I wish you the best in your development! I was a huge fan of GOC back in the day, and I would love to play !

    Log in to Reply
    1. thedomzo says:
      December 14, 2025 at 7:57 pm

      Thank you!

      Log in to Reply

Leave a Reply Cancel reply

You must be logged in to post a comment.

Recent Posts

  • Start Menu & Art Work
  • Procedural City Generation
  • Modular Portraits
  • UI: Using Dear ImGui via the imgui_bundle Python binding, rendered through ModernGL as the GPU backend
  • Night mode 2.0
©2026 Mob City