Skip to content
ImBlix

← WorkW/01 — Case study

Misk Engine

A C++ graphics and game engine, written from scratch and still under construction.

Type
Engine
Status
In development
Year
2026 — ongoing
Role
Sole developer
Stack
  • C++20
  • Vulkan 1.3
  • CMake
  • Jolt Physics
  • glTF (cgltf)
  • FreeType + HarfBuzz
  • Dear ImGui
  • miniaudio
A first-person view down a lit office hallway rendered by the Misk engine: tiled ceiling lights, wooden door frames, framed pictures and the game's HUD with the day, quota and wallets
fig. 1 — Paper Trail on Misk: the office hallway

(01) — Overview

Misk is my own engine: a C++ graphics and game engine, written from scratch and currently in development. It renders with Vulkan 1.3, runs physics through Jolt, loads glTF models with their skeletons and animation clips, and draws Arabic and English text side by side.

It is built to host small first-person games. A game is a folder next to the engine with a fixed set of entry points (LoadAssets, Build, Update, SubmitLights, DrawUi and a few more) and one case in the level switch. The current one is Paper Trail, a low-poly management game set in a paper company's branch office. Every screenshot on this page was taken by the engine itself, with its own --screenshot flag.

(02) — Implementation

The engine is a set of subsystems, each a namespace with one header split into <Subsystem>_<domain>.cpp files: no exceptions, no smart pointers, failures logged and returned as sentinels.

  • Renderer. Vulkan 1.3, forward. One scene pass into an HDR target, then a post pass. Bindless textures (1,024), one material table, and one shared vertex and index buffer. Skinned meshes have their own vertex stream and pipeline.
  • Scene. Not an ECS and not a scene graph: a flat list of objects (transform, model, bounds, physics body, name) addressed by generational handles.
  • Assets. glTF 2.0 and GLB through cgltf, including skeletons and animation clips. PNG and JPG textures through stb, material packages (a folder of maps), and generated primitives.
  • Physics. Jolt behind a seam, with an axis-aligned fallback. A character controller with stairs, slopes and crouch; raycasts, overlaps and layers.
  • Tooling. Dear ImGui and ImGuizmo for an in-game editor and a dev panel, a CPU and GPU profiler, a render-pass inspector, a crash handler, and command-line flags to start anywhere, at any hour, and take a screenshot.
The Misk material test scene: five spheres and five cubes on a pale floor, each in a different PBR material (plaster, a checker, grass, polished metal and dark wood), with the engine's debug overlay in the corners
fig. 2 — the material test scene: five PBR material packages on spheres and cubes

Shading is per-fragment PBR (metal and roughness, normal and detail maps) with up to 32 point lights a frame, one shadow-mapped spot light, and image-based lighting: irradiance, a prefiltered environment and a BRDF lookup table, all generated by compute shaders. Exposure adapts through a compute histogram. The post pass adds bloom, vignette, grain, aberration, tone mapping and an optional volumetric haze, driven by profiles in a JSON file.

The Misk test course: a room of checker-textured boxes with a ramp, a pillar and a flight of steps, used to test the character controller
fig. 3 — the test course: ramps, steps and walls for the character controller

It builds with CMake, which fetches every dependency: GLFW, vk-bootstrap, the Vulkan Memory Allocator, GLM, Jolt Physics, cgltf, stb, FreeType, HarfBuzz, SheenBidi, nlohmann/json, miniaudio, Dear ImGui and ImGuizmo. Shaders are compiled to SPIR-V by glslc as a build step.

(03) — Challenges

  • Arabic text. Arabic letters change shape with their neighbours and run right to left, often mixed with numbers and English. The UI shapes every string with FreeType, HarfBuzz and SheenBidi, so the game can switch language live and mirror its whole HUD.
Paper Trail in Arabic: the office hallway with the HUD mirrored, wallets on the left, the day and time on the right, all labels shaped Arabic text
fig. 4 — the same HUD in Arabic, mirrored and shaped at runtime
  • Honest screenshots. Capturing the window from outside copies whatever sits on top of it, and the game cannot tell. Misk reads the frame back from the swapchain image it actually presented, so a capture is exactly what the player saw, even with the window covered or partly off-screen. That made it possible to check visual changes from scripts.
  • A game without engine changes. Paper Trail needed a sky, a day and a night, characters and routes. Each was solved in the game with the smallest fix: the sky is a few emissive slabs that follow the camera, the day is a lighting setting on the host, people are box figures posed in code, and routes are short waypoint lists. The only change to the engine was one setter, Camera::SetFarPlane.
Paper Trail at night: the office's parking lot under a dark sky, the building's windows black, parking lines and a bench lit by the low night ambient
fig. 5 — the same lighting at 21:45: the sun, the ambient and the image-based light scaled down for night

(04) — Outcome / Next

Misk runs Paper Trail end to end: a building of 23 spaces modelled in Blender and drawn over the game's collision boxes, people on schedules, keyboard and gamepad screens, save and load, and two languages. The game's rules live in a separate library that is tested headless, and an in-game self-test plays through the screens as a player would.

What the engine still lacks is listed plainly in its own report: no instancing, culling or batching (one draw per mesh; about 1,700 draws are fine for now), no navigation mesh, and no planar reflections. Those come next, as the games built on it need them.