This version
What ‘voxel’ means now: a grid of cubes. Each ray steps cell by cell through the height columns (a DDA) and lights the face it hits.
How this version works
This fragment shader runs at a render scale of 0.8 and defines block-column heights by flooring a combination of sine and cosine waves. Each pixel traverses up to 90 horizontal grid cells, testing whether its ray enters a column side or crosses the column's flat top. Column height selects blue, green, brown or near-white colouring, while the hit face supplies an axis-aligned lighting normal. Fractional hit coordinates darken cube boundaries, and exponential fog blends distant surfaces into a blue sky. The camera moves diagonally at a fixed height above the static grid.
The trick in this version
A two-dimensional DDA advances directly to the next grid boundary instead of taking small uniform ray steps. Although the result shows cube faces, this code represents solid height columns procedurally rather than storing a general three-dimensional voxel volume.
Historical context · GPU
2017 · Sebastian Macke
Voxel Space, explained in the browser
The terrain renderer reduced to a short, inspectable algorithm, with front-to-back drawing and y-buffer occlusion explained.
- Platform
- GPU · grid traversal
- Era
- GPU
- Rendered on
- GPU
- Tags
- DDA · cubes