DEV Community

Cover image for ๐Ÿš€ Kenzo Graphics Library v2 โ€“ Build Lightweight 2D/3D Apps Without Dependencies
Kenzo Basar
Kenzo Basar

Posted on

๐Ÿš€ Kenzo Graphics Library v2 โ€“ Build Lightweight 2D/3D Apps Without Dependencies

*KGL (Kenzo Graphics Library v2)* is a lightweight, math-based 2D/3D rendering engine made for the web. Designed with speed and simplicity in mind, it allows you to create browser-based visual applications with no external dependenciesโ€”just a and JavaScript.

โœจ Why I Built KGL

As a developer who hates bloatware and overly complex engines, I wanted something fast, small, dependency-free, and still powerful enough to handle 3D scenes, voxel rendering, and UI overlays. So, I built KGL โ€” a clean canvas-based engine that helps you go from idea to visuals in seconds.

๐Ÿ”ง Key Features

๐Ÿšซ Zero Dependencies: No Three.js, no Babylon.js, no WebGL shaders.

๐ŸŽฎ 2D & 3D Support: Render both flat UIs and rotating cubes in one canvas.

๐Ÿงฑ Voxel Engine: Chunk-style voxel rendering for sandbox-style games.

๐Ÿ‘พ Entity System: Position, animate, and update 3D objects easily.

๐Ÿ–ฑ๏ธ UI Overlay (KglUI + KglHTSTB): Build menus and overlays using HTML-like tags.

๐Ÿ› ๏ธ Custom Math Engine: Pure math-based transformations (no GPU trickery).

๐Ÿ“ฆ Installation

You can install KGL from npm:


npm install kenzo-graphics-library-v2

Or use JSdelivr KGL.js

You can also download manually: Manual Download

๐Ÿงช Sample Code
Here's how easy it is to create a rotating cube using Kgl:

const canvas = document.getElementById('myCanvas');
const engine = new Kgl(canvas);

const cube = new KGLentity.Cube({ x: 0, y: 0, z: 0 }, 50, '#00FF00');

function loop() {
  engine.clear();
  cube.rotateY(0.03);
  engine.drawEntity(cube);
  requestAnimationFrame(loop);
}

loop();
Enter fullscreen mode Exit fullscreen mode

*โœ”๏ธ No setup. No WebGL context. Just you, canvas, and code.*

๐ŸŒ Try the Demo

๐Ÿ‘‰ Try out KGL Live
๐Ÿ‘‰ Browse on github

๐Ÿงฑ Module Overview

Kgl - Main renderer and engine core
Kgl2D - 2D drawing helpers
KglUI - HTML-style GUI system for canvas
KGLvoxel - Chunk-based voxel renderer
KGLentity - Cube/sphere/shape entity renderer
KGLscenes - Scene management (load/unload)
KGLconfig - Configure engine compatibility
KglHTSTB - Lightweight HTML-style textbox builder

๐Ÿง  Who Is It For?

  1. Developers making custom game engines

  2. Students building canvas-based simulations

  3. Creators who want to avoid WebGL/GLSL complexity

  4. OS developers who need a browser-based GUI renderer

โš ๏ธ Not for...

This is *not* a replacement for full engines like *Three.js* or *Unity WebGL*. KGL is meant for lightweight, fast, and experimental development.

๐Ÿ”„ Roadmap

  • โœ… KGLv2 Complete

  • ๐Ÿ“ฆ KGL on NPM

  • ๐Ÿงฉ Plugin System

  • ๐ŸŒ Built-in Scene Editor (Prototype)

  • ๐Ÿ“Š Benchmark & GPU fallback (Planned)

๐Ÿ™Œ Support & Contributions

If you like what Iโ€™m doing, you can:

  • โญ Star the repo

  • ๐Ÿ› File issues

  • ๐Ÿ“ข Share the project

๐Ÿ’ฌ Final Words

KGL started as a *hobby project*, but I believe it can help others who want control, speed, and simplicity in their graphics projects. If you're building something cool with it โ€” let me know!

*Happy rendering! ๐ŸŽจ*

โ€” Kenzo

Top comments (0)