Skip to content
3D graphics rendering pipeline. Implemented in JavaScript. Run in a terminal.
TypeScript JavaScript
Branch: master
Clone or download
Latest commit 2f8c353 Nov 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode publish | v2 Oct 16, 2019
scene update loader | build Oct 20, 2019
src update | resize Nov 5, 2019
.gitignore publish | v2 Oct 16, 2019
license publish | v2 Oct 16, 2019
package-lock.json update | render loop Oct 28, 2019
package.json readme | version Nov 5, 2019
readme.md update | readme Nov 5, 2019
tasks.js readme | optimizations Nov 3, 2019
terminal.gif update | readme Nov 5, 2019

readme.md

Zero

A graphics pipeline implemented in JavaScript and rendered to the terminal. No GPU required.

NPM package

# start the demo in ascii mode (default)
$ npx zero-demo@latest

# start the demo in 24-bit true color mode (experimental)
$ npx zero-demo@latest --color

Overview

Zero is a small graphics demo that uses JavaScript to replicate the functionality of a GPU and uses the terminal to display its rendered output via nodejs' stdout. Zero was written for fun and to push JavaScript performance. ASCII rendering has been tested on Windows, OSX and Linux terminals. ANSI 24-bit true color rendering has been tested on Cygwin (Windows) and Linux Mint terminals, but should work on most terminals that support true color.

This project and associative materials are offered as is to anyone who may find them of use.

Zero implements:

  • Programmable Vertex and Fragment shaders (in JavaScript)
  • Perspective Z-Correct Texture Mapping
  • Per Pixel Depth Buffering
  • Adaptive Resolution on Terminal resize (TTY only)
  • Support for 24bit true color (terminal must support 24-bit color)
  • Matrix and Vector math libraries.
  • A Scene Graph

Licence MIT

Building Locally

Clone this project and run the following from the terminal.

$ npm install
$ npm run build
# run it
$ node index
You can’t perform that action at this time.