5 ms·
Voxel Space (2017)
- swordlucky666 4mo ago[flagged]
- TheChaplain 4mo agoI really love this kind of articles, so much to learn.
- taneq 4mo agoIf you render columns instead of rows you can render near-to-far without a Y-buffer and with zero overdraw. :)
- nkrisc 4mo agoYou just store the last highest Y value as you iterate near to far?
- mthoms 4mo agoThis is true. I vaguely remember there was something about the VGA architecture of the day that made this approach much slower, but I might be misremembering. My recollection of it is fuzzy. I'm hoping someone will chime in to remind me what I might be thinking of. It might also just have been that this approach didn't work well with my lookup table optimization (see my other post).
- lowbloodsugar 4mo agoI imagine that far map squares are more than one pixel wide so that read is amortized. Not so if going vertically.
- mthoms 4mo agoThis was part of it as well. At least - as I recall - with the early flat (MarioCart 1 inspired) versions I made. But in that case, the closer "terrain" pixels always became multiple on-screen pixels so my lookup table for each of the 360 degree viewpoints contained only a single byte to add to each x and y coordinate, plus a single byte for each length. Had to keep the memory use down and multiplication was really computationally expensive.
- bananaboy 4mo agoYou might be thinking of unchained VGA modes but in unchained modes you want to draw columns because that means you only have to switch which memory plane is active four times instead of every four pixels, ie select plane 0, draw column 0, 4, 8, etc then select plane 1 and draw columns 1, 5, 9, etc etc
- mthoms 4mo agoThis is what I was thinking of, thanks.
- bananaboy 4mo agoIt does render columns though. Maybe we are talking about different things but the algorithm is essentially: for x = 0 to 319 draw_vertical_line(x, height). The detail there though is whether you cast a ray for each column or do what this does and go from far plane to near plane drawing the columns.
- tdeck 4mo agoIt'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.
- a1o 4mo agoWhen 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 https://github.com/ericoporto/i_rented_a_boat
- Jare 4mo ago[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.
- swiftcoder 4mo agoReverse painters algorithm is still painters algorithm. You trade off the cost of a full screen clear before the frame, in return for eliminating overdraw
- knome 4mo agoYou could avoid a full screen clear by using the y-buffer to draw in sky segments after rendering terrain.
- swiftcoder 4mo agoYou still need to have some sort of mask to tell you which pixels have not yet been written this frame
- knome 4mo agothat's what the y-buffer is that the article mentions in the front-to-back rendering section. it tracks how tall each columns write is so you can use it to only write the diff between it and the voxel behind it, skipping writing anything at all if the voxel behind is shorter than the current height. So once you're done rendering front-to-back, you've got a y-buffer of highest-writes you can slap your blue sky across from highest-to-screentop on each line, avoiding the need to clear by write the sky to the full screen before starting the render.
- swiftcoder 4mo agoyes, I guess you can get away with only clearing the y buffer, rather than the whole screen
- nine_k 4mo agoTechnically 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.
- cubefox 4mo agoNo? Each pixel on a height map corresponds to a column of voxels of the specified height. You could represent the same height data with a fully general octree and it would look exactly the same.
- bastawhiz 4mo agoIt's kind of weird to call them "columns of voxels" when the columns can't have gaps and the "voxels" below the topmost are ignored completely. Which is to say, they're just columns...which is (definitionally) just a height map. In fact, an octree for this approach would be _meaningfully worse_ because finding "the topmost voxel" in each column is O(logn)—or maybe worse?—versus O(1) for a height map. With no benefits, because you never look at any other voxels.
- cubefox 4mo ago> It's kind of weird to call them "columns of voxels" when the columns can't have gaps No, it's not weird. The columns don't have gaps because they are columns represented by a height map, which can't display arbitrary voxel geometry (unlike octrees), but that doesn't mean they can't display voxel geometry at all. > Which is to say, they're just columns...which is (definitionally) just a height map. Yes. A height map is representing voxel data without overhangs. > In fact, an octree for this approach would be _meaningfully worse_ That's irrelevant. The fact remains that rendering the same height data using an octree would look exactly the same. If the latter displays voxel geometry, the former does too.
- bastawhiz 4mo ago
- esafak 4mo agoI 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 https://en.wikipedia.org/wiki/Voxel_Space
- blaze33 4mo agoPrevious discussion (2017): https://news.ycombinator.com/item?id=15772065 https://news.ycombinator.com/item?id=15772065
- mthoms 4mo agoThis 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.
- mrexroad 4mo ago> I remember figuring all this out as a self-taught teenager (pre-internet) with some books, a whole lot of time […] but man did it make me feel like I accomplished something magical. As a parent with kids in college, high school, and middle school, I lament (worry about?) how many obstacles youth now have reaching this dynamic. That thread of curiosity, discovery, struggle, and sense of accomplishment (or just learnings) is so profoundly formative. I’ve had mixed success creating space for it across my kids, but I sure miss the “pointless” threads I followed b/c of empty time when I was a kid.
- bananaboy 4mo agoThe 286 didnt have an integrated floating point unit so you would have been using a software floating point library that came with your compiler. That would have been very slow indeed!
- haruharuha 4mo agoThis rendering approach reminds me of a project I saw a while back that explored what the world would look like from the perspective of a 1D or 2D being. Someone actually built a interactive demo based on that exact premise. edited, I found it: https://www.reddit.com/r/gamedev/comments/m19vl2/1d_game_proof_of_concept_web_demo_works_for/ https://www.reddit.com/r/gamedev/comments/m19vl2/1d_game_pro...
- davrosthedalek 4mo agoObligatory link to mars.com: https://chaos.if.uj.edu.pl/~wojtek/MARS.COM/ https://chaos.if.uj.edu.pl/~wojtek/MARS.COM/
- karmakaze 4mo agoFirst thing that comes to my mind is the procedural generation in Rescue on Fractalus! (Behind Jaggi Lines) 1984 by LucasFilm Games which blew my mind on Atari 6502.
- mondainx 4mo agoReading Voxel always takes me back, way back.. I played Comanche for hours and read up on Voxel tech in various magazines of the day; so clever and easy to implement. Nice demo and thanks for the trip down memory lane.
- binarymax 4mo agoIs this the same algo used for Magic Carpet (1994)? The style looks very familiar, and I always wondered how they pulled it off. https://en.wikipedia.org/wiki/Magic_Carpet_(video_game) https://en.wikipedia.org/wiki/Magic_Carpet_(video_game)
- jaen 4mo agoThe game originally used a "voxel" engine [1], but the final release switched to affine texture mapping (with a heightmap-based terrain, still). The voxel-style engines tend to feature a longer draw distance (due to it being cheaper to render, as you can easily use various hacks to eg. halve texture accesses far away). For a detailed look into the rendering of Magic Carpet, start from Slide 8 of [2]. [1]: https://tcrf.net/Prerelease:Magic_Carpet_(DOS)#1993 https://tcrf.net/Prerelease:Magic_Carpet_(DOS)#1993 [2]: https://web.archive.org/web/20180330004301/http://www.glenncorpes.com/procedural-landscapes-gdce-2001 https://web.archive.org/web/20180330004301/http://www.glennc...
- totetsu 4mo agoWas this also how the flight sim that used to be hidden in EXEL.EXE had been built, I wonder.
- superjan 4mo agoOff topic: The very first assignment in this game is called “oil tank holiday”: fly the chopper to unguarded oil tanks, shoot and watch them burn, and then fly home. No enemies. Just learn to fly and shoot. I apply this in testing code. After you write some code, try to think of the absolute minimal test to prove that your code does anything at all without crashing. These are my “oil tank holiday” tests. It is always humbling to see those fail.
- ggambetta 4mo agoWhat I'm hearing is that the smoke in smoke tests comes from the oil tanks!
- acrinimiril 4mo agoLooking back even further, games like Koronis Rift did a lot with much less. Still, both are impressive and brilliant.
- DonHopkins 4mo agoI would love to see somebody code this up to run in the browser -- it's from 2003, so I bet it could now run really fast with lots of voxels. It will steal your face right off your head. Happy Halloween! https://www.youtube.com/watch?v=9SplEU05z64 https://www.youtube.com/watch?v=9SplEU05z64 Using Deformations for Browsing Volumetric Data 1,367 views Jul 31, 2009: A prototype user interface for browsing volume data. Presented at IEEE VIS 2003 by Michael J. McGuffin, Liviu Tancau, and Ravin Balakrishnan. For more information, see https://profs.etsmtl.ca/mmcguffin/research/#mcguffin_vis2003 https://profs.etsmtl.ca/mmcguffin/research/#mcguffin_vis2003 https://profs.etsmtl.ca/mmcguffin/research/volumetricBrowsing/ https://profs.etsmtl.ca/mmcguffin/research/volumetricBrowsin...
- snickerer 4mo agoC++ version of this game, using exactly the same original Comanche map and rendering algorithm: https://codeberg.org/Lew_Palm/voxelcopter https://codeberg.org/Lew_Palm/voxelcopter
- mft_ 4mo agoBrings back memories. Comanche was incredible when it came out, running on (IIRC) our family’s 386SX-16. I tried to replicate the effect in Visual Basic, albeit with very limited success at the time.
- nomel 4mo agoDelta force 2 for me [1]! The only real problem with it was you could see characters as moving single pixels across the map...and hit them without too much trouble. [1] https://youtu.be/SyBh91UYVS8 https://youtu.be/SyBh91UYVS8
- MomsAVoxell 4mo agoI played hours and hours of it, networked multiplayer version, with my work colleagues .. it was part of our regular TGIF team-building exercises, among a few bouts of Descent2, some Warcraft2 and the odd Quake .. ah, halcyon days indeed .. we all had our joysticks at the office, lol.
- Panzerschrek 4mo agoI used this approach in one of my demos: https://www.youtube.com/watch?v=xjbDxvboOjo https://www.youtube.com/watch?v=xjbDxvboOjo. Plot twist: the highmap is dynamically-generated.
- bananaboy 4mo agoThat looks really nice!
- bryantoken 4mo agohello
- deleted 4mo ago[deleted]
- deleted 4mo ago[deleted]
- IAmGraydon 4mo agoAhhh Comanche. One of my favorite games of my childhood.
- xorcist 4mo agoHot on the heels of Comanche was MARS.EXE which did was a voxel-like heightmap landscape renderer in a 4k intro. Previous discussion with plenty of background and links to similar software: https://news.ycombinator.com/item?id=44541662 https://news.ycombinator.com/item?id=44541662
- mikeaskew4 4mo agoWas mind-blowing then, for sure. Wonder if now in 2026, we’ve just been continuously splitting the cell on voxels instead of finding a better, more efficient way forward.
- wolvoleo 4mo agoI remember Comanche well. It was amazing for the time. Not many other games used this tech, probably because it's got definite limitations, like not being able to have multiple levels or overhang. But for a mountainous landscape without caves it worked well.