Boid Shapes

Questions/discussion about contributing to Alchemy

Boid Shapes

Postby crowline on Thu, 01 Dec 2011 06:30:34 GMT

Just a little video peek at a module i have worked on - Boid Shapes.

This module sets up a basic 3d boid particles system, and traces the pathes of the particles, mapping line width to z depth.

http://vimeo.com/32952405

Has a some issues yet (namely the boids slow down mysteriously...)
also no settings toolbar or z normalization for more flexible line width control yet.

https://en.wikipedia.org/wiki/Boids
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby smudo on Thu, 01 Dec 2011 12:14:37 GMT

madness! 8-)
smudo
 
Posts: 12
Joined: Mon, 03 Oct 2011 01:34:07 GMT

Re: Boid Shapes

Postby crowline on Sat, 03 Dec 2011 09:58:31 GMT

seems the slowdown was from the canvas redrawing having a hard time keeping up with the increasingly heavy current shape data. when i tell the module to commit (and start new) shapes every 60 (or so) updates (on ~13 shapes/boids) it seems to keep up (on my core i5 laptop). Can maybe try to keep the shape data weight down by updating based on a timer rather than mouse drag event... may be interesting to look into breaking the boid updates and canvas rendering into threads.

I havent had success running in opengl rendering mode lately, but i wonder if that would provide enough of a rendering speedup to solve the problem.

The only real downside to committing the shapes is that right now i am getting a gap between the end of the previous line and the start or the new one. Havent had success getting around this, but hopefully will be able to figure it out...
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby crowline on Sun, 04 Dec 2011 09:43:57 GMT

here's a file for anyone interested in trying out the boid shapes module. The code could use a lot of optimizing/cleaning up, but it works pretty well as it is. Toolbar implemented so you can play with the parameters....
Attachments
org.alchemy.create.BoidShapes-1.0.0.zip
(22.83 KB) Downloaded 81 times
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby crowline on Sun, 04 Dec 2011 09:56:03 GMT

also, it seems that it was the parameter xmx256m that has been causing problems launching the opengl alchemy executable.

Launches fine with that removed... no noticeable speedup though...

whatever the bottleneck is, it must not be getting offloaded onto the gpu via that opengl setting. have to do some more profiling, but i 'think' its not pushing the (increasingly complex) shapes to the canvas that is slowing things down as much as it is constantly recalculating the (potentially changed by affect modules) locations of the (increasing number of) vertex points.
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby smudo on Thu, 08 Dec 2011 21:35:45 GMT

truly cool this one !
thanx for all the effort crowline :D
smudo
 
Posts: 12
Joined: Mon, 03 Oct 2011 01:34:07 GMT

Re: Boid Shapes

Postby crowline on Fri, 23 Dec 2011 06:46:12 GMT

Been looking into using threads, which looks pretty straightforward in java... but it also got me thinking that (Alchemy's) main loop of vector calculations may be a pretty good candidate for some OpenCL experimentation.

Moving all of the vector points around on every shape update gets pretty costly as the shape gets more complex, but pushing all those calculations in parallel onto the GPU seems feasible, and should allow for more simultaneous, or denser shapes without slowdowns.

Not gonna mess with this anytime soon probably, but might eventually do some reading on opencl and see if it could work, or if im just being one of those dudes who thinks GPU computing is the answer to everything without knowing enough about it ;)
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby crowline on Fri, 23 Dec 2011 12:18:50 GMT

Got a threaded version of the module running, seems to run better, and offers some more control over the density of the vertices/speed of shape generation. Also allows the boids to keep updating even if the mouse isnt moving. Just gotta solve some shape flickering.
testing build of swatchified/undo alchemy > https://docs.google.com/open?id=0B8RcV-g3_nP-VHFwZnMtaGNYajQ
alchemy sketches > http://al.chemy.org/forum/sketches/topic433.html#p1712
character/color inspiration > http://characterwell.blogspot.com
User avatar
crowline
 
Posts: 94
Joined: Wed, 23 Dec 2009 06:37:35 GMT

Re: Boid Shapes

Postby kollatt on Fri, 20 Apr 2012 03:37:16 GMT

i'm absolutely having a blast with this one! works great and feels very 'alchemy'-like. commit it!
kollatt
 
Posts: 57
Joined: Thu, 24 Apr 2008 00:39:31 GMT


Return to Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron