Skip to content

A simple Web based 3D Object renderer using only a 2D canvas and raytracing. No dependencies used. Less than 650 LOC.

Notifications You must be signed in to change notification settings

aboyobam/raytracing-2d-renderer

Repository files navigation

Raytracing 2D Renderer

Animated Cube Suzanne

Written in strict typescript.

It uses multithreading with WebWorkers and a SharedArrayBuffer as the storage for the pixels accross all threads. With planar projection of all faces into a quad tree, it can handle hundreds of vertecies without any performance penalty; but it is still slow.

How to run

First install all build dependencies.

npm install

Then start the webpack bundeling

npm run build

Then start the static file server

node serve.mjs

Open http://localhost:9000 There you see the userinterface

It uses no runtime dependencies and is only 4.7kb (with gzip, no 3D models)

About

A simple Web based 3D Object renderer using only a 2D canvas and raytracing. No dependencies used. Less than 650 LOC.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published