https://github.com/edubart/marcherstein3d
Realtime pseudo 3D raycaster on the CPU using 2D ray marching
https://github.com/edubart/marcherstein3d
nelua raycasting raymarching raytracing wolfenstein-3d
Last synced: 2 months ago
JSON representation
Realtime pseudo 3D raycaster on the CPU using 2D ray marching
- Host: GitHub
- URL: https://github.com/edubart/marcherstein3d
- Owner: edubart
- Created: 2020-03-07T21:25:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-01T13:21:08.000Z (almost 4 years ago)
- Last Synced: 2025-03-22T14:22:03.783Z (2 months ago)
- Topics: nelua, raycasting, raymarching, raytracing, wolfenstein-3d
- Language: Lua
- Homepage: https://edubart.github.io/marcherstein3d/
- Size: 275 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pseudo 3D via 2D Ray Marching
This an experiment to render 3D scenes using ray marching on 2D signed distance fields (SDFs)
in real time using only on the CPU and with some lightning support.Check this project running on the browser [here](https://edubart.github.io/marcherstein3d/).
This was inspired by [Wolfenstein 3D](https://en.wikipedia.org/wiki/Wolfenstein_3D) rendering technique and [Inigo Quilez](https://www.iquilezles.org/www/index.htm) ray marching articles.
## How it works
The renderer is ray marching on a 2D plane and outputting the scene depth and colors to a single line. Then the line is stretched vertically proportionally to its depth. The lightning
is done in 2D but can be viewed in 3D.Similar technique was used in the game Wolfenstein 3D back in 1992 to render a
pseudo 3D on low end hardware. However I've introduced ray marching into the idea, this
permits to have some lightning and morph objects across the XZ plane while still
allowing to render in realtime on the CPU.