TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

VoxelSpace: Terrain rendering algorithm in less than 20 lines of code (2020)

339 点作者 lnyan4 个月前

17 条评论

imiric4 个月前
This is very neat. I miss the era when novel and elegant algorithms like this delivered magical experiences.<p>This could just be from getting old, but I feel like games have lost the magic they had when availability of hardware resources was limited. Back in the 80s, 90s and early 2000s we saw games push the medium forward practically every year, and certainly every generation. Developers squeezed all the performance they could from the hardware, using novel techniques and pure wizardry. Hardware advancements certainly helped, but it was never in abundance as it is today, so developers couldn&#x27;t get complacent. Necessity is indeed the mother of invention.<p>These days I find fantasy platforms like the PICO-8 much more interesting than the latest rehashed release from any AAA studio. I don&#x27;t understand how games that are essentially asset flips can be so successful year after year.
评论 #42591820 未加载
评论 #42591080 未加载
评论 #42591719 未加载
评论 #42591708 未加载
评论 #42591797 未加载
评论 #42591920 未加载
评论 #42591960 未加载
评论 #42591227 未加载
评论 #42593451 未加载
评论 #42593189 未加载
评论 #42592743 未加载
评论 #42590930 未加载
dang4 个月前
Related. Others?<p><i>VoxelSpace – Terrain rendering algorithm in less than 20 lines of code</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38051859">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=38051859</a> - Oct 2023 (2 comments)<p><i>Voxel Space: Comanche&#x27;s terrain rendering in less than 20 lines of code (2020)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26631995">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26631995</a> - March 2021 (71 comments)<p><i>Terrain rendering algorithm in less than 20 lines of code</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21944573">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=21944573</a> - Jan 2020 (116 comments)<p><i>Terrain rendering in fewer than 20 lines of code</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15772065">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15772065</a> - Nov 2017 (93 comments)<p><i>Show HN: Voxel Space – terrain rendering in less than 20 lines of code</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15339016">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15339016</a> - Sept 2017 (2 comments)
davrosthedalek4 个月前
I just say mars.com (no, not a domain. A program. A video: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_zSjpIyMt0k" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=_zSjpIyMt0k</a>)<p>Edit: Pouet has it: <a href="https:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=4662" rel="nofollow">https:&#x2F;&#x2F;www.pouet.net&#x2F;prod.php?which=4662</a>
评论 #42591215 未加载
评论 #42596487 未加载
评论 #42590576 未加载
评论 #42600922 未加载
Sleaker4 个月前
Its a neat way to render, but I don&#x27;t think it qualifies as voxel, it can&#x27;t render arbitrary volumes, and the data storage can&#x27;t contain more than a single position for a given x,y. It&#x27;s just a neat implementation of a heightmap renderer no?
评论 #42593274 未加载
评论 #42593570 未加载
评论 #42599777 未加载
评论 #42591533 未加载
mthoms4 个月前
I have such fond memories of building a terrain viewer like this (first in Pascal, then in C &amp; Assembly) in the 1990&#x27;s at the same time I was learning the requisite trigonometry in high school.<p>Back then, all kinds of low-level optimizations were necessary to make it work.<p>Figuring out how to do it, and optimize it with no books or internet to reference is one of the most personally rewarding things I&#x27;ve ever done.
a1o4 个月前
Hey, I made a game using this technique here<p><a href="https:&#x2F;&#x2F;eri0o.itch.io&#x2F;i-rented-a-boat" rel="nofollow">https:&#x2F;&#x2F;eri0o.itch.io&#x2F;i-rented-a-boat</a><p>It&#x27;s made in Adventure Game Studio. It was made in a previous version of the engine that we hadn&#x27;t optimized yet and I was too lazy to update it on itch page (but will one day). I have a write up there explaining how I made it but there are more details in the AGS forums.
评论 #42600926 未加载
khedoros14 个月前
[2020] could go in the title (or even [2017], looking at other comments in the thread in the following discussion link).<p>There was also a discussion in 2021 of the same repository:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26631995">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=26631995</a><p>(and that thread links to other discussions too)<p>It&#x27;s not quite the same, but I remember when I was first learning programming, I wrote a program that would generate a terrain heightmap, and do an isometric-style rendering using similar techniques. It was in QBasic, running on my middle school&#x27;s 386-era DOS machines, and used graphics memory as its scratch space. Slow as heck, but I was fascinated with the output. It&#x27;s one of the things that encouraged me to keep going with programming.
NKosmatos4 个月前
I remember reading about this somewhere (could be from an older HN post), but this time I decided to add a comment so that I don’t lose it. Being a flight sim fan, I still remember playing Comanche for the first time and the wow factor. It was something from the future or from the movies, you got the feeling that you were leaving in the computer era :-)
评论 #42594616 未加载
评论 #42592023 未加载
jchook4 个月前
This is so cool.<p>In most contemporary games, you can occasionally see the mountains are hollow (from weird camera angles, clipping issues, etc).<p>However, with this method, your mountains are solid &gt;:)
namuol4 个月前
Highly recommend doing software renderer stuff like this for fun. Raytracers are a popular sort of project but this sort of retro realtime rendering code makes for a great weekend project too. I implemented basically the same algorithm ages ago (actually I ported some SDL code as an exercise to learn canvas2d): <a href="http:&#x2F;&#x2F;namuol.github.io&#x2F;earf-html5&#x2F;" rel="nofollow">http:&#x2F;&#x2F;namuol.github.io&#x2F;earf-html5&#x2F;</a><p>Obviously the linked implementation is way more performant and far simpler than mine, so if you’re looking for a reference I wouldn’t recommend my old coffeescript code…
layer84 个月前
I’d love to live in an alternative timeline where GPUs are voxel-based.
评论 #42590387 未加载
评论 #42591014 未加载
评论 #42594034 未加载
评论 #42591694 未加载
评论 #42591903 未加载
评论 #42590602 未加载
sota_pop4 个月前
Very cool project and nice work! While I&#x27;m not very experienced with graphics rendering, I use a lot of computational geometry for work. I also implemented the Diamond-Square algorithm in matlab to generate randomized landscape terrains for a grad school project. Combining my generator with this rendering algorithm would be pretty fun to create and explore digital landscapes!
jesterswilde4 个月前
I built a web version based on your post: <a href="https:&#x2F;&#x2F;jesterswilde.dev&#x2F;vertrend.html" rel="nofollow">https:&#x2F;&#x2F;jesterswilde.dev&#x2F;vertrend.html</a>
stevefan19994 个月前
This reminds me of how Wolfenstein 3D and to some extents how Doom works
harha_4 个月前
It looks really good for such a simple algorithm. I love this!
评论 #42590568 未加载
IAmGraydon4 个月前
Every time I see a voxel landscape it reminds me of this:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Comanche_(video_game_series)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Comanche_(video_game_series)</a>
评论 #42591586 未加载
louthy4 个月前
Voxels was an interesting technique for about five minutes in the early 90s, but they could never really be rendered at a high enough resolution for them to look good imho.
评论 #42590154 未加载
评论 #42590205 未加载
评论 #42590671 未加载
评论 #42590227 未加载