Old 16th October 2005, 00:27   #1
gordmoo
Junior Member
 
Join Date: Jun 2005
Location: Crewe, uk
Posts: 17
gravity fun times!

hey there

i made a gravity engine for a preset a while back but was never happy with it, not to mention it having a colour bug in it when i releaced it >_<. so i made a better one that i like to think resembles something more like a sun being swallowed by a black hole thats a little, irratic
seing as i don't have much time to avs stuff anymore i thought id just put this out there instead of it just wasting away on my hard drive

not that im asking, but if anyone could do anything funky with it, id love it oh and there are 10000 particles or so in this so it might run a lil slow on slower computers.. and i left out dynamic texter resizing code because resizing 10000 images is not my idea of quick, so i wouldn't recomend anything more than 512x384

oh, and whist i of course did all this windows, i changed the names to fit posting guidelines in linux and thus couldn't test it, i got a friend on a windows box to change the second texterII to the right bitmap name, but just incase the second texterII should point to 'gord - blackhole.bmp'
Attached Files
File Type: zip gord - gravityfun.zip (1.8 KB, 186 views)
gordmoo is offline   Reply With Quote
Old 16th October 2005, 16:34   #2
PAK-9
Major Dude
 
PAK-9's Avatar
 
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
Nice idea, looks quite funky

Some points:

- Use smaller texer2's where possible, blending is an expensive operation especially when you do it 10,000 times.

- You have a load of pointless buffer saves and an effect list, you dont need them (see optimised preset)

- You can do a lot of programmatic optimisation to speed it up, for example where you have:

red=(1/255)*6;
green=(1/255)*4;
blue=(1/255)*2;

Those are just constant values. At present you are doing 30,000 divides and 30,000 multiplications every frame to calculate the colour values, when you really need 0.

I've attached an optimised version. As well as the above I also set the bounding box (outbox) to 1 (why would you want it any bigger?) and reduced the particle count. This gives me about 22fps instead of 14fps (57% faster :P )
Attached Files
File Type: zip gravity fun optimised.zip (2.4 KB, 151 views)

http://PAK-9.deviantart.com

...innit
PAK-9 is offline   Reply With Quote
Old 17th October 2005, 07:52   #3
gordmoo
Junior Member
 
Join Date: Jun 2005
Location: Crewe, uk
Posts: 17
yea i know about that stuff, it was just when i was making it kinda came out that way, lots of fine tuning when you have 10000 particles, too high a value and you have white _everywhere_, too low and black. n seing as its blended as regular 1 byte channels, makes sence. but yes i should of done that

i think the biggest problem is the megabuffers, iv done tests before where you can get huge speedups.. hard to do without them though.

all the rest of the weirdness in the code come from the fact that its based on an earlyer thing i did where the mouse was used to move the gravity well, which is a _lot_ of fun to play about with, seriously -_-


the problem with using smaller bitmaps for texterII is that you end up having to use more particles to achive the same effect, catch 22 thing i guess.

i'll see if i have time to take a look at the optimised one later and remove all the filler, so to speak
gordmoo is offline   Reply With Quote
Old 17th October 2005, 08:46   #4
PAK-9
Major Dude
 
PAK-9's Avatar
 
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374
You can use a bit of a trick when using smaller texer's by setting the outbox to a value < 1, tweak the speed settings and use a movement to resize it to the whole window (with bilinear filtering). I originally had that in the optimised version with a scale of 0.5 but i took it because it was a bit noticable, I think 0.75 or so would be hard to notice tho.

http://PAK-9.deviantart.com

...innit
PAK-9 is offline   Reply With Quote
Old 18th October 2005, 11:22   #5
gordmoo
Junior Member
 
Join Date: Jun 2005
Location: Crewe, uk
Posts: 17
i had some spare time last night so i optimised it as much as i could whist keeping the same effect and fluidity. went with that resizing trick as there arn't really any sharp edges so it suits interpolated resizing nicely it runs at around 32fps on my 1.8ghz amd processor, around 200% speedup from the first version .

also _finally_ corrected some gravity code i did, before two objects with diffirent masses would fall at seperate speeds.. which.. isn't quite, right... really. now the only mass that counts is the gravity well , makes me wish i still had my notes from college really.

the gravity well movement isn't really what i want stil though, iv tryed to create some code many times that would produce the smooth effect that id like, but this will have to do.

thank you mr pak-9
Attached Files
File Type: zip gord - gravityfun (optimised) - re.zip (2.0 KB, 151 views)
gordmoo is offline   Reply With Quote
Old 18th October 2005, 16:27   #6
eheiney
und keine Eier!
 
eheiney's Avatar
 
Join Date: Mar 2005
Location: MI, USA
Posts: 1,374
Send a message via AIM to eheiney
Pretty damn nice.

I really like it when the 'thing' passes over the center and the 'stuff' explodes.

Spiral out, my friend. You will find your way back to yourself, we all will.
I'll be waiting, and shall see you on the other side...
eheiney is offline   Reply With Quote
Old 18th October 2005, 19:26   #7
PAK-9
Major Dude
 
PAK-9's Avatar
 
Join Date: Oct 2002
Location: The United Kingdom of Great Britain and Northern Ireland
Posts: 1,374

http://PAK-9.deviantart.com

...innit
PAK-9 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS > AVS Presets

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump