logoalt Hacker News

Voxel Space

109 pointsby davikrtoday at 2:25 PM19 commentsview on HN

Comments

nine_ktoday at 3:38 PM

Technically this is not related to voxels ("volumetric pixels", so to say), which split the 3D space equally along all three axes. This is just a height map, a set of prisms, not entirely unlike a Doom map. Every prism has a regular fixed-size square base.

For 1992, this was mind-boggling though.

show 3 replies
a1otoday at 3:09 PM

When this was first posted I made a game with a port of this approach to AGS Engine. Nowadays AGS is much faster since we have improved a lot of things, but this wasn’t the case at the time, so I had to make a few little tricks to make the rendering work well with the engine at the time.

https://github.com/ericoporto/i_rented_a_boat

tdecktoday at 3:02 PM

It's interesting that the color maps seem to have shadows "built in", so that you get a 3D bevel effect from just looking at the color map.

blaze33today at 4:01 PM

Previous discussion (2017): https://news.ycombinator.com/item?id=15772065

davrosthedalektoday at 4:59 PM

Obligatory link to mars.com: https://chaos.if.uj.edu.pl/~wojtek/MARS.COM/

Jaretoday at 3:32 PM

[Edit] ah ok they clarify later as a performance enhancement. I think it was pretty integral to the algorithm, but ok.

Wait why do they say painter's algorithm. Comanche and other such voxel terrain engines went front to back and never had overdraw.

show 2 replies
mthomstoday at 4:51 PM

This sure brings back memories.

I remember figuring all this out as a self-taught teenager (pre-internet) with some books, a whole lot of time, and only a high-school level understanding of trigonometry. I built different versions - first in Pascal, then C, then Assembly.

Figuring out the algorithm was hard, but one of the optimizations I was most proud of was inventing (or so I thought) lookup tables to get around the slow floating point multiplication of my 16MHz 80286 CPU. I also remember "inventing" (ha!) the old bit shift + add technique.

There was something immensely satisfying about squeezing every last drop of performance out of a machine.

Nothing ever came of it. It was more or less a demo, but man did it make me feel like I accomplished something magical. I'd give anything to have a look at that source code today, but this post is the next best thing. So thanks for sharing. This made my day.

esafaktoday at 3:40 PM

I remember how groundbreaking Comanche was. Now I learned that it was a result of the programmer's experience in the medical industry (CT/MRI scanning): https://en.wikipedia.org/wiki/Voxel_Space

taneqtoday at 2:49 PM

If you render columns instead of rows you can render near-to-far without a Y-buffer and with zero overdraw. :)

show 2 replies
TheChaplaintoday at 2:41 PM

I really love this kind of articles, so much to learn.

haruharuhatoday at 4:58 PM

[dead]

swordlucky666today at 2:31 PM

[dead]