|
|
>> Indeed. Although I'd actually prefer the waves to *not* reflect off
>> the edges of the framebuffer... but I can't see a way to achieve that.
>
> You kind of get that effect automatically by not bothering to calculate
> the values around the border (ie clamping the border values to zero).
> You can see this IRL by fixing a string at one end, pulling the other
> end tight, and then applying waves to the string - you will see them
> reflect off the far end.
Indeed, the *cause* is obvious. The *solution* is not.
> If you want to avoid reflections then what (I think - not tested!) you
> need to do is calculate the points around the border of your simulation
> just like the others. Of course you cannot work out the derivatives the
> same way because there are no further points out, but if you fix the
> derivative outside to zero then that should work.
Actually, my simulation treats all points the same. The only difference
is that in computing the derivatives, any point outside the actual grid
is assumed to be zero. (This effectively creates zero-clamped points
just outside the image.)
Perhaps what I should do instead is set the derivatives to zero for the
edge points? But that would still give me a set of points that never
actually move... hmm...
>> Ooo, GPU? That's gotta be pretty fast...
>
> I just checked, a 1024x1024 simulation runs at 240 fps ;-)
NOOOO!! Damn you! >_<
My simulation manages about 2 seconds per frame for 100x100...
(Actually it was 10 seconds/frame. For unknown reasons, GHC's
implementation of floor() is stupidly slow, but the equivilent
truncate() function is way faster... go figure!)
>> Have you tried playing with the reaction/diffusion equations? That's
>> also pretty fun... and yes, you have to see it in motion to truly
>> appreciate it. ;-)
>
> That was next on my list, but I never got around to it. The
> Navier-Stokes equations also look pretty cool for moving liquids (rather
> than waves). Some people have done some nice smoke/liquid simulations
> that run on the GPU:
>
> http://www.youtube.com/watch?v=D4FY75GwA00
That's a GPU?? You'd have to have, like, 50,000,000,000 polygons to make
it anywhere near that smooth! (And the RAM requirements alone preclude
doing that.)
Post a reply to this message
|
|