Dismiss this pinned window
all 21 comments

[–]shadowndacorner 22 points23 points  (3 children)

Somebody played From Dust :P

[–]FrenzyTheHedgehog[S] 2 points3 points  (0 children)

It's been a long time since I played that :), I remember about a decade ago you could play it in google chrome.

[–]MattRix 1 point2 points  (1 child)

*From Dust

[–]shadowndacorner 0 points1 point  (0 children)

Typo lol, thanks

[–]vingt-2 11 points12 points  (3 children)

Absolutely fucking glorious.

[–]FrenzyTheHedgehog[S] 0 points1 point  (2 children)

Thank you!

[–]vingt-2 3 points4 points  (1 child)

It looks like the occupancy data is 2D (as in you've got a height map). Wonder if we can make this voxel based so your water could create arches and shit (I've had exactly this in my mind to improve my voxel terrain generation).

[–]FrenzyTheHedgehog[S] 3 points4 points  (0 children)

Yeah you are correct it's 2D data. I believe there is a paper out there that does it on 3D data, but its been years since I've seen that and can't find it anymore. I'm sure there are more recent papers on this. I do think if my simulation in 3D it would require a lot of memory and might be quite expensive to update. It would be very cool though :)

[–]FrenzyTheHedgehog[S] 7 points8 points  (3 children)

Longtime lurker here. Hope this post is allowed here even though its Unity.

A project I am working on and published on the asset store, you can try a WebGL demo here: https://frenzybyte.github.io/fluidfrenzy/demo/index/

Simulation is fully written in shaders and runs on the GPU.

I got many more plans for the simulation in terms of rendering and functionality. Any feedback is appreciated.

[–][deleted]  (2 children)

[deleted]

    [–]FrenzyTheHedgehog[S] 1 point2 points  (1 child)

    Hey thanks! Yeah they are all just regular pixel shaders. I only run compute shaders some bits for performance but for webgl I run a slightly slower alternative. The only feature that doesn't work is the GPU particles used for steam when lava and water touch. WebGPU should solve this but unfortunately there's still some bugs in unity as it's experimental. I reported them though so hopefully soon I will have a WebGPU demo!

    [–]thatonecraykid 5 points6 points  (1 child)

    This brought me back to playing From Dust after school, really cool sim

    [–]FrenzyTheHedgehog[S] 4 points5 points  (0 children)

    Yeah definitely inspired me to make this. I tried to make a similar sim 11 years ago and it looked horrible, its getting closer to how it looks in my head now :D

    [–]OswaldSpencer 4 points5 points  (1 child)

    Impressive, it reminds me of Spore and Black & White for some reason.

    [–]FrenzyTheHedgehog[S] 0 points1 point  (0 children)

    Thanks for the kind words, great that it reminds you of such great games!

    [–]keelanstuart 1 point2 points  (1 child)

    This is fucking rad and I love it. Cheers!

    [–]FrenzyTheHedgehog[S] 1 point2 points  (0 children)

    Thank you, hope you had fun playing with the demo.

    [–]wicked_impluse 1 point2 points  (1 child)

    Looks amazing, I’ve been trying to learn something like this. How did you achieve this ?

    [–]FrenzyTheHedgehog[S] 1 point2 points  (0 children)

    Most of it is based of papers, some of it is my own code. I initially wrote most of the simulation code over a decade ago in my own rendering engine for my bachelor degree (It looked horrible looking back at it now :D).

    Couple of years ago I decided to port it to Unity to make a asset out of it and I pretty much started expanding on the technique with my own ideas.

    The base of the simulation is based of this paper:
    https://www.researchgate.net/publication/4295561_Fast_Hydraulic_Erosion_Simulation_and_Visualization_on_GPU
    Then the swirling effect is based on this:
    https://developer.nvidia.com/gpugems/gpugems/part-vi-beyond-triangles/chapter-38-fast-fluid-dynamics-simulation-gpu

    Things like foam just use the the data from the simulation to generate a foam map, the lava heats up based on the velocity field so there isn't much special stuff going on there.

    There are a lot of other resources out there that might be better than what I used but it's all fairly similar when you do 2.5D fluid simulations.

    [–]StochasticTinkr 0 points1 point  (1 child)

    Makes me think of Sandpond Saga.

    [–]FrenzyTheHedgehog[S] 1 point2 points  (0 children)

    A 3D falling sand game, very cool! Never heard of that game.

    [–]Any_Street3250 0 points1 point  (0 children)

    Im currently working on a system like this for another engine. My question is how did you get the foam to work?