Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Metaball Demo

Author
Message
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 16th Oct 2009 08:45 Edited at: 17th Oct 2009 19:17
Hey,

So I've been working on a metaball demo in C++ with OpenGL. Here are some screenshots of it so far (click for full size):




Currently, you can use the A and D keys to change the number of metaballs (up to 400), the S and W keys to change the size of the metaballs, and the 1-5 keys to change the rendering modes.

So I would appreciate if people downloaded it and took a quick look.

-Does it actually run, and does it look like it does in the screenshots? (If not, could you please run 'run.bat' and then post the resulting log.txt here?)
[EDIT] The above logging method does not seem to work if it crashes? Maybe just try to grab a screenshot?[/EDIT]
-What sort of fps do you get with 400 metaballs at a size of 256? (On an 8600 GTS I drop down to ~45, seems to be a fillrate limit)
-c&c/suggestions/etc. are welcome



Thanks,
-Jeff

Attachments

Login to view attachments
JLMoondog
Moderator
16
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 17th Oct 2009 03:55
Is it weird that at first I thought it said Meatball Demo? I was like, sweeet!

Anyway, it's some great stuff. I didn't get any slowdowns with max metaballs, kept at a steady 64fps. My favorite effect was number 2, very trippy.

You could turn this into a cool mini-game with some added mouse interaction support. Would actually make a neat little iPhone App.


NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 17th Oct 2009 03:57 Edited at: 17th Oct 2009 12:52
Framerate starts to drop with 124 metaballs at size 256 on this 9500GT... nice!

EDIT: I can't has netbook?



Attachments

Login to view attachments
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 17th Oct 2009 15:41
Nice

Similar to something I did in DBPro a while ago:
http://forum.thegamecreators.com/?m=forum_view&t=152033&b=1

Although this seems to be done in software rather than hardware, and has a far higher limit on metaballs.

People can't seem to resist meatball jokes

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 17th Oct 2009 17:37
It won't run with me... The log file is empty and it says something's invalid.

TheComet


Make the paths of your enemies easier with WaypointPro!
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 17th Oct 2009 19:15
@Josh
Yeah, sometimes I read it as Meatballs too . Thanks, effect #2 is my favorite one too. Some sort of minigame might be cool, I'll have to think about that, but I don't know how well the iPhone could handle this.


@Nex
It's strange that it starts dropping at only 124. I don't get any drop until around 295 on an 8600 GTS. See note at the bottom of the post for something that might be related.

Regarding the netbook - looks like I need more error checking. Perhaps the netbook doesn't have enough video memory. The program uses an offscreen framebuffer, and a 512x512 texture and 256x256 texture by default.


@Diggsey
Thanks. I remember seeing your demo, it looks pretty cool. Initially I tried a similar technique, drawing lots of fullscreen quads with a pixel shader and additive blending, but that ran into fillrate problems pretty quickly.

This is actually still done with hardware. I found that I could create a pretty similar effect by using point sprites. So I just additive blend a whole ton of point sprites together. I still run into fillrate problems, but it depends on the size of the point sprites being drawn. I can have 800 size 64 metaballs at 60 fps. 800 size 256 runs at 22 fps.


@Comet
How does it crash? Is the console visible long enough to get a screenshot of what it says? And could you please post your system specs? Thanks.


A note: Even if the framerate drops below ~60 fps, that does not mean that it cannot run faster. I have the program sleeping for 15ms every loop, until I can find a nice way to cap it at 60. So depending on how fast the cpu can bounce around all the metaballs, there might be a slight drop in fps that wouldn't be there if it didn't sleep 15ms every loop. But if the framerate changes when you increase or decrease the metaball size, then its a fillrate problem, and that's as fast as it can go.

Looks like I need to come up with a better way to log error messages, it seems that if the program crashes, then using 'Metaballs.exe > log.txt' doesn't actually save anything in log.txt. And I guess I still have a ways to go with getting it to crash gracefully.

So thanks for testing it and leaving feedback.

-Jeff

NeX the Fairly Fast Ferret
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 17th Oct 2009 23:15
Quote: "A note: Even if the framerate drops below ~60 fps, that does not mean that it cannot run faster. I have the program sleeping for 15ms every loop, until I can find a nice way to cap it at 60. So depending on how fast the cpu can bounce around all the metaballs, there might be a slight drop in fps that wouldn't be there if it didn't sleep 15ms every loop. But if the framerate changes when you increase or decrease the metaball size, then its a fillrate problem, and that's as fast as it can go."


What sleep/timer commands are available to you? I have a near perfect timing system using GLFW's double precision float timer and sleep command.

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Oct 2009 01:29
The specs:

4GB RAM (expandable to 16GB)
Quad core 2.66GHz processor
2TB Harddisk
64bit BUS
One of the newest nVidia graphics cards available (Can't remember those darn graphics cards...).

I can't get a screen shot of it. A black console shows up for about a 60th of a second, and vanishes again. It doesn't say anything on it though...

TheComet


Make the paths of your enemies easier with WaypointPro!
thenerd
16
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 18th Oct 2009 01:57
I smell screensaver...


forever loading...
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Oct 2009 14:20
Very nice.

Quote: "So I would appreciate if people downloaded it and took a quick look.

-Does it actually run, and does it look like it does in the screenshots? (If not, could you please run 'run.bat' and then post the resulting log.txt here?)
[EDIT] The above logging method does not seem to work if it crashes? Maybe just try to grab a screenshot?[/EDIT]
-What sort of fps do you get with 400 metaballs at a size of 256? (On an 8600 GTS I drop down to ~45, seems to be a fillrate limit)"


Yes it runs and looks just like the screenshots.

Steady FPS of 59 (?) at all settings using fullscreen.

GFX card: NVIDIA GeForce GTX 285.
xplosys
19
Years of Service
User Offline
Joined: 5th Jan 2006
Playing: FPSC Multiplayer Games
Posted: 19th Oct 2009 15:20
Funny, I also read meatballs.

Yes, It looks just like the screen shots.

400@256 default screen = 20FPS
400@256 full screen = 50+FPS
That's kinda' strange.

NVIDIA GeForce 8600GT 512.

Brian.

Login to post a reply

Server time is: 2025-06-04 20:23:37
Your offset time is: 2025-06-04 20:23:37