*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();
*โ๏ธ 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?
Developers making custom game engines
Students building canvas-based simulations
Creators who want to avoid WebGL/GLSL complexity
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)