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.

DarkBASIC Professional Discussion / 2D graphics for cells?

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Feb 2012 22:54
Hi everyone!

For my next project I'd like to explore something to do with cells. I've already come across my first problem and I haven't even finished the planning phase

Here's the problem: How would I best go about creating 2D graphics for a cell so it looks like the following video?



It's constantly deforming and oozing around. I can't just use a simple sprite for this. Would it be possible to deform an image by placing "vertices" on the image and move them about?

Any ideas on how to do this?

TheComet

Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 24th Feb 2012 23:09 Edited at: 24th Feb 2012 23:09
i think the closest thing you can do is to play with some water effects.. try to dig some on this forums..
it might be 3d, but with the right camera angle, and right shaders you will make it look like 2d..

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Feb 2012 00:37 Edited at: 25th Feb 2012 00:41
Not exactly what you're looking for, but this technique gives very organic looking shapes and can be modified to be closer to what you want:
http://forum.thegamecreators.com/?m=forum_view&t=152033&b=1

See metaballs on wikipedia for how it works.

(You can do more than 8 at a time by rendering to a texture first using a separate quad for each metaball with additive blending, and then apply the cutoff when rendering the texture to the screen)

[b]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 25th Feb 2012 11:02 Edited at: 25th Feb 2012 11:31
Curse you Benjamin, now I read meatballs every time that word pops up

Thanks for the link, I'll run some tests and see what I can do with this shader

[EDIT] It's an expensive effect... I made 80 Metaballs and my computer is already slowing down :/ I'll have to make some sort of "imposter" system to replace the cells that aren't changing with simple sprites, and use this effect on the active cells, and then maybe even split the process over a few loops.

Would using memblocks to add the rendered Metaball cluster as an alpha channel in a texture be effective?

TheComet

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 25th Feb 2012 14:06
Quote: "I made 80 Metaballs and my computer is already slowing down :/"


If you do them in a single pass then yes, it will slow down, but if you draw them as separate quads it should be no slower than drawing the same number of sprites of the same size.

[b]
Burning Feet Man
18
Years of Service
User Offline
Joined: 4th Jan 2008
Location: Sydney, Australia
Posted: 26th Feb 2012 11:40
Very interested in this thread. TheComet, I'll start playing around with some ideas, will post my thoughts over the coming weeks.

Help build an online DarkBASIC Professional help archive.
DarkBasic Help Wikia
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 26th Feb 2012 11:50
@ Diggsey

I tried what you said. I made 10 quads and used 8 Metaballs per quad, and I'm still getting a massive slowdown... The project is attached.

TheComet

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th Feb 2012 14:28
That's not quite what I meant, hang on I'll make an example...

[b]
Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 26th Feb 2012 17:24
OK, here's an example showing 99 interacting metaballs.

[b]

Login to post a reply

Server time is: 2026-07-09 21:18:58
Your offset time is: 2026-07-09 21:18:58