[HN Gopher] Show HN: VoxelChain - An Experimental Voxel Engine
       ___________________________________________________________________
        
       Show HN: VoxelChain - An Experimental Voxel Engine
        
       VoxelChain is an experimental tool to create voxel worlds in the
       browser. The lighting is fully ray traced in real-time and there is
       powerful cellular-automata based programming system, which allows
       to create complex digital circuits and model the behaviour of
       voxels (behaviour such as falling sand or water).  Technology wise,
       I'm using WebGL2 for the rendering and the simulation is coded in
       C89 and gets compiled to WebAssembly (with multi-threading) using
       Clang. The simulation is basically a custom cellular automaton and
       is fully parallelized. Once WebGPU is released, I'm planning to run
       the simulation on the GPU, instead of the CPU, which will give a
       massive speed up.  I've been working on this project full-time for
       over a year now, and finally came to the point of realising a
       public version of it to play with. There is already some really
       cool stuff that the community has built, and it's super fun to see
       how everything evolves!  Let me know what you think and feel free
       to ask any questions :>
        
       Author : x1m4
       Score  : 63 points
       Date   : 2022-09-06 14:24 UTC (8 hours ago)
        
 (HTM) web link (voxelchain.app)
 (TXT) w3m dump (voxelchain.app)
        
       | bob1029 wrote:
       | Pretty neat work. I was looking at voxels for a while when
       | working on a 3d engine for a side project. There are a lot of
       | very compelling math & performance reasons to go down this path.
       | 
       | That said, I wonder if newer tech like nanite has started to
       | displace these techniques. When you get to a point where you can
       | rasterize triangles that are smaller than a single pixel at
       | interactive frame rates, one starts to wonder what unique
       | advantages voxels still bring to the table.
        
         | x1m4 wrote:
         | 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
        
       | mooman219 wrote:
       | I understand the depth of field is cool, but the demos
       | (https://voxelchain.app/previewer/Demo.html) are excessively
       | blurry to the point of unusability, and rapidly changes so often
       | it gives me a headache (https://imgur.com/a/bSEFuX7).
       | 
       | Otherwise nice work!
        
         | cheeselip420 wrote:
         | Same with the chromatic aberration
        
         | x1m4 wrote:
         | 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
        
       | shodan757 wrote:
       | The optimizations that went into this must be pretty impressive
       | for it to run as well as it does on my Framework laptop (11th
       | gen, no dGPU). I did have to run it in Chrome since Firefox gets
       | the "unsupported browser" error[0]. Glad I tried it out since
       | typically "I made a voxel engine" wouldn't catch my attention. ;)
       | 
       | [0] console: "WebGL warning: readPixels: Format and type
       | RGBA_INTEGER/UNSIGNED_BYTE incompatible with this RGBA8UI
       | attachment. This framebuffer requires either
       | RGBA_INTEGER/UNSIGNED_INT or
       | getParameter(IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE)
       | RGBA_INTEGER/UNSIGNED_INT."; Firefox 104.0.1; openSUSE Leap 15.4
        
         | x1m4 wrote:
         | 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.
        
       | marcooliv wrote:
       | Not a developer but I'm really impressed with the quality and
       | high fps. Following to keep updated. Good luck!
        
       | brink wrote:
       | Nice work!
        
       | [deleted]
        
       | ajudson wrote:
       | Are you planning to release the source? I want to learn wasm +
       | webgl and this seems like an great project to learn from. If not
       | would love to hear what resources you recommend for learning
        
         | x1m4 wrote:
         | 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
        
           | ajudson wrote:
           | Are there any resources you recommend for learning webgl +
           | wasm?
        
             | x1m4 wrote:
             | 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.
        
       | olah_1 wrote:
       | What is the end goal? I see there is logic included, does that
       | mean it will be a full game engine? Or maybe a fantasy console?
        
         | x1m4 wrote:
         | 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.
        
       | SuboptimalEng wrote:
       | Great to see the project on the front page of HN - congrats on
       | launching!
       | 
       | The author's got tons of video demos on their YouTube channel[0]
       | as well.
       | 
       | [0] https://www.youtube.com/c/xima1
        
         | x1m4 wrote:
         | 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 :>
        
       | matheist wrote:
       | The live demo doesn't work for me on Firefox on macOS (FF 105,
       | macOS 12.4, M1) with a "WebGL is not available" error message.
       | 
       | Console error shows:                   WebGL warning: readPixels:
       | Format and type RGBA_INTEGER/UNSIGNED_BYTE incompatible with this
       | RGBA8UI attachment. This framebuffer requires either
       | RGBA_INTEGER/UNSIGNED_INT or
       | getParameter(IMPLEMENTATION_COLOR_READ_FORMAT/_TYPE)
       | RGBA_INTEGER/UNSIGNED_INT.
        
         | x1m4 wrote:
         | 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!
        
           | danparsonson wrote:
           | Just to add that I'm seeing the same error on Fedora 36 with
           | FF 103.0.2 64-bit
        
             | x1m4 wrote:
             | Does Chrome work for you?
        
       ___________________________________________________________________
       (page generated 2022-09-06 23:00 UTC)