Why Build a Stylized Engine?
The project began with a simple goal: combining complex rendering effects and object-specific stylisation directly with responsive gameplay. After a couple of conversations, a random word-generator, and an early Vulkan prototype, I teamed up with a small group to build Ubiquitous Reality (UBQR) from scratch—starting with a playable racing loop and taking full ownership of the Vulkan loader, pipeline architecture, and shader effects.
General-purpose engines often introduce unnecessary bloat, rigid inheritance trees, or multi-pass shader stutters when pushed outside their target mold. By forgoing one-size-fits-all generalization, UBQR tailors every subsystem around vehicular action and bullet-hell combat—two genres that rely on rigid, non-humanoid models (side-stepping uncanny valley and heavy skeletal animation costs) while demanding high-density entity pooling and expressive NPR-over-PBR visuals.

GameWare Entities, Hierarchies & Two-Phase Loading
To avoid deep inheritance bottlenecks like the "Deadly Diamond" or "Bubble-Up" effect when managing hundreds of active projectiles and vehicles, UBQR uses a data-oriented Entity-Component-System (ECS) core. World objects are represented as GameWares equipped with default transform components and parent-child hierarchies. Calling getWorldTransform() iteratively resolves nested local-to-world matrix chains, while getModelTransforms() gives the renderer direct, low-overhead access to active scene geometry. Transform updates operate in a ping-pong synchronization loop with the physics engine so gameplay scripts and rigid-body simulations stay cleanly in sync.
As illustrated in Fig. 1, individual Component instances attach either to standard GameWare entities or developer-subclassed Custom GameWares that expose virtual lifecycle callbacks while remaining resident in memory. From there, entities register into Scene Component Space for direct scene instantiation or into Recipe Component Space to define a reusable Pool Recipe for multi-instance object pooling—allowing pooled and non-pooled GameWares to behave identically inside the active Scene.
To keep load times balanced and extensible, startup is split into engine initialization (subsystems and global allocators) and scene loading (component-space data), paired with dual engine/game delta clocks for time dilation and a built-in checkpoint and scoreboard save system.
RenderManager.PBR, Stylised Object Shaders & Screen-Space Filters
The rendering subsystem initializes in two stages—allocating persistent Vulkan device resources and memory pools first, followed by scene-specific buffers and textures. At runtime, RenderManager orchestrates the linear multi-pass frame graph shown in Fig. 2, encapsulating Vulkan synchronization while exposing runtime shader arguments directly through the ECS.
For directional lighting, a dedicated shadow pass renders an orthographic depth map centered on the player vehicle (Fig. 3a) so shadows remain crisp in the player's view without static shadow edges swimming during movement (Fig. 3b). In the forward pass, hardware-queried max-sample MSAA resolves multi-sampled attachments to eliminate geometric aliasing (Fig. 4).
Beyond default Cook-Torrance PBR with tangent-space (TBN) normal mapping, model components can opt into custom style passes—injecting dedicated object-masking and kernel-filtering stages for dual-kernel toon-shaded smoke (Fig. 5a) and procedural noise energy-ball projectiles (Fig. 5b), followed by separable two-pass 1D Gaussian bloom (Fig. 6a), band-quantized posterization (Fig. 6b), and directional chromatic aberration:
- Cook-Torrance PBR + TBNBeckmann NDF, Schlick Fresnel approximation, Lambertian diffuse, and per-fragment tangent-space normal mapping.
- Player-Centered Shadow MapsOrthographic directional depth pass anchored to the player vehicle to eliminate static shadow swimming.
- Toon & Energy Ball ShadersTwo-stage object masking with dual square-kernel Gaussian/edge filters, color banding, and animated 2D noise.
- Screen-Space Post-ProcessingSeparable two-pass 1D Gaussian bloom, grayscale-quantized posterization, and directional chromatic aberration.







Jolt Integration & Raycast Wheeled Vehicles
UBQR integrates Jolt Physics via a multithreaded job system, mapping Rigidbody and Collider components into quadtree-partitioned BroadPhase layers with custom ContactListener callbacks.
Player vehicles are driven by Jolt’s VehicleConstraint and WheeledVehicleController. Tagged wheel GameWares automatically derive their radius, width, and chassis offsets directly from mesh bounding boxes so suspension, steering, and drifting stay visually locked to the 3D model. A dual-mode player camera (Follow and Top-Down) uses Jolt NarrowPhase shape casting with spring-damped collision avoidance to prevent wall clipping.
Backlog Event Queues & Normalized GLFW / SDL3 Input
To minimize per-frame polling overhead, UBQR uses a templated Observer event system with compile-time type IDs and a two-stage queue/backlog architecture: events emitted while draining the primary queue are deferred into a secondary backlog queue for the following frame, preventing infinite recursive event cascades.
On the input side, keyboard/mouse events from GLFW and controller/haptic rumble events from SDL3 are unified into a normalized 0–1 magnitude scale and mapped to rebindable InputAction components at runtime.
SoLoud 3D Spatial Audio & Dear ImGui Debug Suite
Spatialized 3D audio and dynamic gameplay music playlists are powered by SoLoud, with real-time listener attenuation, panning, and post-processing filters. For both gameplay HUDs and engine diagnostics, UBQR integrates Dear ImGui—enabling live scene switching without restarts, real-time GameWare entity and component inspection, G-buffer/masking debug views, and interactive sliders for tuning shader parameters like emission, bloom thresholds, and filter kernels on the fly.
System Overview Poster
