WebGL Water Simulator
madebyevan.com
madebyevan.com
Drag the mouse rapidly back and forth in a very tiny area so that it creates a layered 'ripple' that grows and grows. If you spend about 2 minutes doing this you can make the ripple go like 10 feet high completely off the screen.
Then unpause the simulation for a massive tsunami.
for i in $(seq 1 100); do cliclick c:.; doneedit: The white sphere don't use the real level of water to decide where it should float (when gravity is activated)
water.addDrop(x, y, radius, strength)
0,0 is the center, bounds are -1 to 1. 0.1 radius is a reasonable spike, 1 radius is a huge swell. 1 strength is really big. 10 is ridiculous. Try negative numbers too!Try:
water.addDrop(0, 0, 0.1, 5)I thought that champagne overflowing from a bottle was not made with real champagne over and over again until you got the perfect shot.
I was also surprised to find out that when the background had a nice motion blur it was sometimes actual motion blur made with a rotating rig that had the camera and the object to be shot on it.
I wonder if those very realistic shots are usable in UK adverts without disclaimers? As an example, see ads for mascara which get regulated if they use computer enhanced lashes and no disclaimer.
https://www.youtube.com/watch?v=Ow-dDfarZuY
I'd say without a doubt that shots like 0:25 or 3:00 were CGI...
So, does that Flex system BASICALLY imply that in another few decades the individual granularity of those particles will become so small and so numerous that we'll basically be modeling liquids and solids at the molecular level? It seems to me that it's only a lateral step then to mimic the fluid like effects of explosive forces being applied to solids.
Also not a graphics programmer, but I am a scientist who has model liquids and solids at the molecular level–a lot of this is doable today, but I doubt it'll ever be applied directly to a macroscopic graphics engine. There are quite simply too many atoms: there's 1 mole (6e23 atoms) in 18g of water. At best, todays chips have several billion transistors (5e9). Even at one transistor per molecule, the numbers just don't add up.
There are lots of multi-scale modelling techniques though, where you directly model the system on the atomic scale in just a few small volumes, e.g. at the tip of a crack just before it propagates. It's not impossible that sort of thing will make an appearance, though I'd still be surprised. Graphics programming is all smoke and mirrors; if it's easier to approximate something using an unphysical process that looks right, people will favour that over an exact simulation that takes far more computing power.
UNTIL THEN, All it has to do is get granular enough to fill the resolution of the current generation of monitor technology. Just like how ray tracing really only requires enough granularity to appear seamless at the current resolution.
Regardless. It's awesome that a browser with WebGL can achieve that kind of speed and behavioral complexity. Is ray tracing the reflections part of OpenGL? Or is that a separate library?
The only minor nit I can come up with is the lack of surface tension. When you pull the ball up through the surface of the water, some of the water should stick to the ball. Maybe the ball is made out of lotus leaves, though.
I'd also expect some more bubbles when violently stirring the pool with the ball.
A particle-based system could simulate the effects you describe (by keeping track of the positions of some large number of water "molecules" and exchanging forces between each pair of particles), however the simulation would be far too costly to run in real-time on typical hardware today. It also has its downsides. With a height-map based representation it is trivial to calculate the normal to the surface of the water, which is necessary for the lighting effects, but with a particle system you would need to reconstruct the surface of the water in an additional step each frame, using something like the marching cubes algorithm.
A nice use for this would be to emulate a ripple tank, as used in high school physics labs.
Error: Rendering to floating-point textures is required but not supported.If you're interested, you can check what your device supports with a tool like this: https://play.google.com/store/apps/details?id=com.darkrockst...
Not all of the GLES extensions will be exposed to WebGL, but most WebGL extensions directly map to a GLES one (GL_OES_texture_float in this case).
https://dolphin-emu.org/blog/2013/09/26/dolphin-emulator-and...
Works great on my iPad mini 2. Pretty incredible.
Error: Rendering to floating-point textures is required but not supported.
And on my Ubuntu 14.10 laptop with X1400 I get: Uncaught Error: link error: error: Too many vertex shader texture samplersSo if they wanted to make it what you would see underwater, they should just blur the crap out of it.
I think I can find an angle where you can't see the skybox.