water simulation

Previous topic - Next topic

djtoon

i want to create this effect:
http://www.box2d.org/forum/viewtopic.php?f=8&t=7574

thay baiscly
blur the image and then add a color threshlod
any way to do that in glbasic?
10x

erico

#1
Long time ago , there was a thread that discussed some types of fast blur
I recall someone talked about the following technic:

Make a very low resolution copy of your screen, maybe 2 or 3 different smaller resolutions.
Apply, full screen scalled, them over the original with some set of transparencies and as for the color, you can psycho alpha blend something. :S

hope it helps, but I´m sure the subjects has been around a while. :good:

edit: oh, kitty got a proper reply to it on the other "full screen blur" post...and I think I posted on the wrong thread...damn it


Kitty Hello

what they do is a set of balls that react like water. I think they implemented some type of auto-attact (joint) and cut-off.

The drawings in the latest post (bottom of that page) look like they have only drawn circles around each "water" point, and used a much wider radius than the real physics partice uses, so they overlap and it "looks" like water.

You might want to ersearch on fluid dynamics:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=73110&lngWId=1

Some guy on RR did that once.
I "think" it was him:
http://www.projectorgames.net/
(Anyone remember that snow - app that run on a huge projector with 4000x3000 pixels resolution?)

djtoon

the physics is box2d that i got
then you do agussian blur on the screen
and do a color threshold and walla water :)

the blur+color threshhold that we dont have in glbasic :(

Kitty Hello

I have no idea how to program gaussian bluring.
If you want my bur code to have colour teinting, you can use POLYVECTOR instead of the ZOOMSPRITE. There's code on the forums already.

Slydog

#5
If anybody's interested, here's a great (detailed but complicated!) article on Gamasutra:
(There's a sample code link (titled 'Listing 2') near the bottom of the first page.)
Four Tricks for Fast Blurring in Software and Hardware

Or, to achieve a simple blur effect, couldn't you just shrink a sprite using STRETCHSPRITE to a much smaller size, then restretch the small image back to the original size?  This should loose a lot of detail, but not sure how good the blurred re-enlarged sprite will look!
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]