MetaBalls

Developed or developing a new product in PureBasic? Tell the world about it.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

MetaBalls

Post by traumatic »

http://files.connection-refused.org/metaballs.zip

It's far from perfect and still needs LOTS of optimizing (can't get above 50FPS on my system) but I thought
I'll post it here because I don't know if I'll ever find the time to finish...

...and I know of people saying that PB can't do this :wink:


The demonstration is based on this article:
http://astronomy.swin.edu.au/~pbourke/m ... olygonise/
Maybe some of you can find a faster way than I did.


Now I will stop posting something new everyday. Promised! :)

Image Image
Image Image
Last edited by traumatic on Tue Jan 20, 2004 12:17 am, edited 1 time in total.
Good programmers don't comment their code. It was hard to write, should be hard to read.
Saboteur
Enthusiast
Enthusiast
Posts: 272
Joined: Fri Apr 25, 2003 7:09 pm
Location: (Madrid) Spain
Contact:

Post by Saboteur »

Waw!! 8O
PB can't do this ;)

:D :D :D :D

50 FPS too....
[:: PB Registered ::]

Win10 Intel core i5-3330 8GB RAM Nvidia GTX 1050Ti
Blade
Enthusiast
Enthusiast
Posts: 362
Joined: Wed Aug 06, 2003 2:49 pm
Location: Venice - Italy, Japan when possible.
Contact:

Post by Blade »

Great!
Nice to see such stuff with PB!

Anyway you should check the normals calculations: the reflection is broken clearly in each quad, while if properly made should me more smooth...

sorry, too late to write a correct english... ;-)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: MetaBalls

Post by NoahPhense »

omg.. that kicks as$..
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

That's good.

Don't know if this info is useful, but the metaballs render pretty much as per your posted images except for 800x600x32 resolution, when rectangles (mostly red) can be seen - display starts to get the "dirty" look I am used to with this sort of stuff, but does not get as dirty as most.

FPS is around 20 in 640x480 modes, around 15 in 800x600 and 1024x768 modes.

(NVIDIA RIVA TNT2 Model64)
User avatar
J. Baker
Addict
Addict
Posts: 2181
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Post by J. Baker »

Very nice, is this reflecting an image or lights?
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef


Even the vine knows it surroundings but the man with eyes does not.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

J. Baker wrote:Very nice, is this reflecting an image or lights?
that's environment mapping, so basically an image
Good programmers don't comment their code. It was hard to write, should be hard to read.
hteamspy
User
User
Posts: 12
Joined: Mon May 05, 2003 4:54 pm
Location: Aix en provence
Contact:

Very nice

Post by hteamspy »

I get bettwen 60 and 70 FPS on 800x600 : 32bit

and constant 60 Fps on 1024x768 : 32 Bit

Nice work
..:: Win Xp Pro : XP 2600 + Barton, Gforce 4 Ti 4200, 1,5 Go ram, SB Live 5.1 :: Linux Debian : Athlon Xp 1600 +, 512 Mo ram + Kyro II ::..
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

again, on my machine, fps 60..65 :-/

hey, doesn't matter is a scene is easy or difficult, all i get is the same rate... huh... duh...

opengl or directx?

800x600x32: no (reddish) rectangles as noted above, but it's not always smooth on the blending areas
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

just noticed something... are you sure you calculate the framerate properly? if i move the mouse a lot, the reported fps varies from 25 .. 270, although it makes no difference on screen
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

blueznl wrote:are you sure you calculate the framerate properly?
yes quite, because it always reflects my refreshrate.
i'll check that tonight, thank you
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

well, it appears to be totally unrelated to my refresh rate (100hz) which makes it kinda' funny...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: MetaBalls

Post by GPI »

Could it be, that you use SetRefreshRate(RefreshRate) ?

Because my monitor flickers now in 60hz (and normaly i set VGA-Driver so, that direct-x use 100hz) and the desktop-resolution is changed! Other PB-Programms doesn't have this problem.

When yes: Can you create a little test-version without this command?
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

I found this nice Library on purearea that comes with some extra commands for Sprites...

Including SwapBuffers()...

This little baby turned my 60 FPS game (using flipbuffer()) into a 350!!! FPS game...

I was quite impressed! And give it 6 thumbs up !!!!

It's called SpriteX...
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

It crashed on my machine. As did the one previous program I tried (I forget which one now, but I have it here somewhere).

WinXP, Athlon XP2800+, 512MB ram, nForce2 chipset/audio, Ati radeon 9600. All the latest drivers and OS patches.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply