Live data from Hacker News

WebGL Fluid Simulation

paveldogreat.github.io

51–60 of 61 posts

Re: WebGL Fluid Simulation

#51

Earlier quoted context omitted.

How difficult would it be to prevent the ink from disappearing? Any tips would be appreciated, I'd love to integrate this into a drawing app.

very easy, its a free parameter in the simulation see the "Ink dissipation" slider, you can set it to > 1 for some weird effects.

No such slider on mine. (https://i.imgur.com/m1tODYK.png)

Re: WebGL Fluid Simulation

#53
post #19

Does anyone know of more examples of water simulations in WebGL? I’m looking for ways to implement waves with foam. I love Evan’s Pool demo. https://madebyevan.com/webgl-water/

Was reading somewhere that one isn't a simulation. Rather super clever tricks to make it look like water, swimming pool, a thing in it.

You're right. Move the ball so it's half-immersed, wait for the water to settle, and then cause a single ripple. The ripple will propagate past the ball, coming out the other side with no diffraction.

Still very, very cool.

Re: WebGL Fluid Simulation

#54
post #41

Earlier quoted context omitted.

This was the first thing I did when I wrote a fluid sim as well - I’ve spent a ton of time and energy pursuing ways to get subtractive color effects (the richness and light-subjectivity of pigment) in digital artifacts and have mostly come up empty, but I take every chance I can get.

Have you checked out mixbox[0]? The outputs do feel intuitively "right" as someone who has dabbled in watercolor, and the paper/videos cover the thinking and Kubelka-Munk theory well. [0] https://github.com/scrtwpns/mixbox

Spectral.js might also be interesting. It comes with a GLSL implementation of Kubelka-Munk and is MIT.

https://github.com/rvanwijnen/spectral.js

Re: WebGL Fluid Simulation

#56

I have an HDR monitor and OMG it's so bright it's almost painful. So beautiful!

I don't think this demo uses your monitor's HDR. You can test by pausing the simulation, then paint your whole screen with the pointer. Your screen is now all white. Compare brightness with a regular white page, it's the same brightness.

I have an OLED display too. SDR content looks really good on OLED displays because of the incredible contrast. It might appear HDR but is SDR.

Re: WebGL Fluid Simulation

#57
post #12

Sebastian Lague recently created a related video for those interested in rendering fluids: https://www.youtube.com/watch?v=kOkfC5fLfgE

Lague's videos have been consistently incredible and inspiring. Highly recommend for anyone interested in the space

Re: WebGL Fluid Simulation

#58

Earlier quoted context omitted.

Is that not navier-stokes ?

You can derive naviger stokes from newtons laws, or I suppose some conversation laws.

Wasn't sure so I checked. Not a physicist.

If navier-stokes equations can be derived from Newton's laws, then Newton's laws can be derived from Galileo, Archimedes before him, even some older thinkers before them.

Newton ignored viscosity, and density. He made some discoveries on fluid dynamics but his famous laws only apply to solid objects. Same for velocity, he knew about that of course but only worked it out for solids. Ignoring two critical components meant he didn't establish relations between them either.

That's my read.

Not to dismiss credits to Newton, who's is in another league than navier and stokes. In his own league even. He probably would have figured out what was only solved centuries later had he explored further, or had he benefited from perhaps just a few other later discoveries.

But that's dismissive of navier-stokes significant discoveries on fluid dynamics to not simply give them credit for the formula behind this simulation.

Oh, did you mean conservation?

Re: WebGL Fluid Simulation

#59
post #51

Earlier quoted context omitted.

very easy, its a free parameter in the simulation see the "Ink dissipation" slider, you can set it to > 1 for some weird effects.

No such slider on mine. ( https://i.imgur.com/m1tODYK.png )

you are looking at the wrong app https://observablehq.com/@tomlarkworthy/ink
Post reply on HN