Skip to content

Modern Renderer#56

Merged
ericmcdaniel merged 26 commits into
mainfrom
engine/renderer
Jul 11, 2026
Merged

Modern Renderer#56
ericmcdaniel merged 26 commits into
mainfrom
engine/renderer

Conversation

@ericmcdaniel

Copy link
Copy Markdown
Owner

Creates a modern rendering engine are a part of the game engine. Previous games were over-privileged by both supporting game state and data, but also directly making manipulations to the LED strip (particularly the buffer). A rendering engine was created to promote a separation of concerns, allowing game business logic to remain separate from the LED manipulation logic. Decoupling the two creates a simplified and scalable game development experience, as the game no longer needs to be responsible for things like boundaries checking, compositing, blending, and more.

tl;dr - Rendering transforms from imperative instructions from each game to a declarative approach, decoupling business logic from presentation logic, and forces games to delegate presentation logic to the Rendering engine.

Technical Details

  • Decouples game logic from LED strip logic. So far the only rendering modes supported are direct requests to adjust individual pixels, and an Entity rendering mode. Entities are UI-presentable characters (including the player and enemies), and composition rules are defined within each game. As long as an entity is Renderable by implementing Engine::RenderModel, the Renderer can paint the entity to the LED strip.
  • Validation checks like boundary checking is built into the Renderer instead of being managed by each game. The former was extremely brittle as LumenLab configuration change, requiring code changes per game.
  • A layer system is made so that the Renderer knows which entity has high priority to paint over others. Layers are defined in Engine::Layer. Current layers supported are the background, four game layers, and one effects layer for muzzle flashes and any other effects.
  • Blending and composition is supported, allowing colors to blend with entities along side them, if desired. Previously, the entity last handled in the game loop gets the highest priority, getting painted on top and ignoring all previous entities.
  • Alpha channel is now supported, allowing for colors to blend with the background colors. Setting the alpha to the maximum (0xFF) will make the color opaque, fully overwriting anything below it.

@ericmcdaniel ericmcdaniel merged commit 1920498 into main Jul 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant