HackerTrans
TopNewTrendsCommentsPastAskShowJobs

x1m4

no profile record

Submissions

Show HN: A falling sand engine using WebGPU

voxelchain.app
1 points·by x1m4·3 jaar geleden·1 comments

Show HN: VoxelChain – An Experimental Voxel Engine

voxelchain.app
118 points·by x1m4·4 jaar geleden·39 comments

[untitled]

1 points·by x1m4·4 jaar geleden·0 comments

comments

x1m4
·3 jaar geleden·discuss
This is an early prototype of a falling sand engine, which uses WebGPU for the simulation and path tracing for the lighting.

Only works in latest desktop chrome and might freeze for a few seconds during startup.
x1m4
·4 jaar geleden·discuss
For the lighting I'm using a mix of ray tracing and stochastic cone tracing. Cone tracing mainly because it's very cache friendly and almost doesn't introduce any noise. I'm not really using a regular cellular automata or rules, it's just similar on the aspect that the simulation is based on neighbors.

I took some inspiration from Noita and Sandspiel, but I found that falling sand simulations aren't flexible enough and I was thinking about how a system could be created to visually program the behaviour of circuits or stuff like falling sand yourself. Also Noita is single buffered, while my simulation is double buffered which actually makes a huge difference in the possible features you can realize. Single buffering is faster but much more chaotic and "random", while with double buffering you get very precise behaviour. Also the simulation was designed from the ground up to be run on the GPU, while Noita and Sandspiel are CPU-based. Here's [0] a video of a previous 2D prototype doing falling sand on the GPU

- [0] https://www.youtube.com/watch?v=aWLPEzngkOo
x1m4
·4 jaar geleden·discuss
You should be able to click on the buttons with a left mouse click. Currently worlds that are exported as HTML doesn't contain any editing functionality except being able to interact with voxels.
x1m4
·4 jaar geleden·discuss
I've actually spent the majority of development time on optimization rather than actually working on the overall product. The choice to create this project in the browser instead of native certainly made this more challenging! :> And thanks for the report, I'm gonna give this another try to fix, and otherwise gonna forward this to the Firefox devs.
x1m4
·4 jaar geleden·discuss
Does Chrome work for you?
x1m4
·4 jaar geleden·discuss
Instead of WebGL, I'd recommend to give WebGPU a try first, as it's a much better designed API. I'd even say that once you've learned the few core concepts of WebGPU (such as command buffers), it's an easier to learn API than the notable chaos that WebGL/OpenGL introduces.
x1m4
·4 jaar geleden·discuss
I have no plans to open-source the engine, but there is a WIP effort [0] to allow programming with the public API that the engine exposes in the editor on the website. Currently the API is mostly used for procedurally generating worlds.

- [0] https://github.com/VoxelChain/voxelchain-programming
x1m4
·4 jaar geleden·discuss
A few days ago there was actually a Keynote [0] by Brian Karis talking about his experiments with voxels while he was working on Nanite.

- [0] https://www.youtube.com/watch?v=NRnj_lnpORU
x1m4
·4 jaar geleden·discuss
Thanks for the report! I've tried to tackle this issue multiple times now, but found that for some reason on MacOS M1, FireFox's WebGL implementation is severely broken on multiple features that the WebGL specification guarantees to be working. I can't test if this is just for the M1 or also other Mac devices, but Chrome definitely works!
x1m4
·4 jaar geleden·discuss
At the current stage, the project is more like an editor and playground for designers and coders. But I'm planning on adding a player and entity system, which would allow creators to build actual tiny games with this.
x1m4
·4 jaar geleden·discuss
Yes the DOF definitely needs some more work. For screenshots it somewhat works, but when actively exploring a scene, it's actually more confusing than useful.

EDIT: Reduced the DOF intensity
x1m4
·4 jaar geleden·discuss
Thank you! I've already tried to make a post a couple days ago, but it got immediately hit by the spam filters. Big thanks to the HN support for resolving this so quickly :>