Live data from Hacker News

Show HN: A simple infinite world in WebGL

erkaman.github.io

11–20 of 61 posts

Re: Show HN: A simple infinite world in WebGL

#11
post #8

Earlier quoted context omitted.

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

Node

While the tooling uses Node, the bloat comes from the bundle which includes canvas-fit, regl, and gl-mat4.

Re: Show HN: A simple infinite world in WebGL

#15

There seems to be some missing triangles after a while (10-20 sec.) on Chrome on OSX Are these caused by some z-buffer issues caused by increasingly large coordinates?

I think it has something to do with the z-buffer. My other theory is that WebGL is not given enough time to upload all the geometry, as the camera traverses the world and adds more chunks. I am not really sure what causes it...

Re: Show HN: A simple infinite world in WebGL

#16
post #3
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

It is really nice. Thanks for sharing. Is there any particular reason you did this?

I just wanted to try making something vaporwave-like. I really like the aesthetics of it.

Re: Show HN: A simple infinite world in WebGL

#17
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

>var f = 0.0015974 Where did this number come from? Is it arbitrary?

Just arbitrary hand-tweaking. It was chosen because I though it looked good. When doing procedural generation like this, you basically just tweak constants 'til it looks good. There's no deeper reason behind it.

Re: Show HN: A simple infinite world in WebGL

#18
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

The .js file is over 10,000 lines of code. How did it get so bloated from your 450 lines of code?

I didn't spend much time optimising the size. I thought it loaded fast enough for me. But maybe it doesn't load as fast on a slow connection...

Re: Show HN: A simple infinite world in WebGL

#20
post #5
post #2

In this demo, I implemented an infinitely continuing, vaporwave-like world in WebGL. If you can't run it for some reason, a recorded gif of the demo can be found here: https://github.com/Erkaman/wireframe-world . As for the implementation, it is not very difficult stuff; I divide up the world into chunks(just like in Minecraft), and as the camera traverses the world, the chunks that become out of range are thrown awa…

It starts visually glitching out after 10 seconds or so, for me. Doesn't really ruin the experience, but as it appears to get more pronounced with time, I don't think we'll reach infinity. :)

After some time the glitches are reset and the process restarts.
Post reply on HN