Birthday lavalamp :)

Community Forums/Showcase/Birthday lavalamp :)

Xip(Posted 2007) [#1]
Hi all :)

well, I have been away from this forum for a while, but it seems like im back ;)

oh well, i started on this project only a few houers ago, trying to finnish it(or atleast have a working version) as a screensaver on my birthday(today 7sept)

and here is what i came up with, I have always been inspierd by lavalamps :)

still a few things to fix and tweak, the balls are not always the ultimate size on start, so you might have to generate a new senario (hit SPACE) a few times.


created in bmax if any one is wondering :)

The resolution is a bit low, but this is a result of me working on a very bad laptop, and also the fact that the processing is not that fast.
a possible config for graphic details might be added later :)

might be a nice screensaver when it is finnished, feedback is always wellcome...
but be nice, its my birthday after all.. hehe :P

(the screenshot relly dont give it justice...)



http://xip.software.googlepages.com/lavaLamp.zip


_33(Posted 2007) [#2]
I'd prefer the source code ;)
For VJ use.


Xip(Posted 2007) [#3]
I might give out the source later, but since i was in a bit of a hurry... I dident bother to clean it up much...
hehe so... well, maybe later :)

>I'd prefer the source code ;)
>For VJ use.

Thats a bit crypical, Does it mean you dont like how the effect looks?:P

VJ? never heard of it.


AJirenius(Posted 2007) [#4]
I have never heard it either but a guess would be that it is the Visual equivalent to DJ (mixing music.


_33(Posted 2007) [#5]
You don't enecssarely need real comple imagery for VJ usage, sometimes it's just color blends and whatnot. This is one of the effects that I'd really like to have in my setup as it would be possible for me to use it (with tweaks) as either a 2D layer either in graphics or ascii art type, or reuse the data for 3D art.

It's specially for the animation of it that I'm interested (code wize).


North(Posted 2007) [#6]
Happy B-Day!


Kistjes(Posted 2007) [#7]
Very nice!
And happy Birthday!

Curious how you did it...


Tri|Ga|De(Posted 2007) [#8]
Happy birthday to you!


Xip(Posted 2007) [#9]
Tanx all :)

>It's specially for the animation of it that I'm interested (code wize).

What else is there? :P

@Tri, nice to se a close neighbour (/me swedish) ;D

@Kistjes: the idea is not that complex, but it might be tricky to se what is really going on.

any one ho can guess it?:)


Yo! Wazzup?(Posted 2007) [#10]
LOL I just like zoned out for a few seconds watching it :)


tonyg(Posted 2007) [#11]
Looks good. Not sure which language you're using but it would look good mixed with this
Happy Birthday.


Xip(Posted 2007) [#12]
@tonyg

Dont think thay can be mixed together in a nice way.
The style is so very different.


it is writen in blitzmax, as mention abouve :)

and tanx ;-)

btw, im currently working on a more complex and realistic lava-lamp movement on the balls, making them stick/glue to each other and orbeting other blob feilds, looks very cool.. but i have a slight problem with blobs starting to sling-shot each other like crazy all over the place... hehe
will take a while to tweak it :)


McSeb(Posted 2007) [#13]
Very cool, the animation is great but I don't remember my lava lamp being so pixelized ;)


Xip(Posted 2007) [#14]
McSeb:

you must have had one of those hi-tec high-resolution lava-lamps :P

oh well, jokes aside... it is only a result of performance issues, i have a few ideas for optimazions... but im not sure it will make it possible for 1x1 resolution.


ImaginaryHuman(Posted 2007) [#15]
If you are having problems with the speed at this low of a resolution then I'm wondering what kind of an algorithm you are using, it sounds very inefficient.

You are basically doing blobby objects, right? ie metaballs? or is it some kind of cellular autonoma type of thing? Maybe it is the way that you are drawing the blobs which is slow?


Xip(Posted 2007) [#16]
Problem is that i have to caclulate evry value in a large matris, 400x600 in this case.

evry position in matrix messures the distance to each object (ball) on the screen, generate an value from this and add it to background matris.
this means that all brightnes from all 'blob/meta' objects will be added to each position in the matrix.

i then render the values from the matrix abouve a certen value (250 i think in my case) on the screen.

this huge 600x400 loop takes time, and then the rendering on top of that.

The reason why i dont only try to work with matrix around balls, is that it would cause a few problems with the clearing of old values from matrix. (the one farther away) ... then i would have to clear the matrix evry once in a while, and we would be back to sqare one again.

if i could work around this however, things could be allot faster.

this would atleast dramasticly remove the ammount of unnessesery loops, but i still need to draw it quik to the screen, and if im not misstaking, fullscreen drawing using WritePixel is still a bit slow, is it not?.

also, pleas note that i have a very crapy laptop that is basicly falling apart, i had to use half the details just to get a decent framerate when devoleping it, however... on most other computers i have tested this, i could run it in 2x the details with full fps.

Edit:
hmm... after some thinking, im not even sure the 'matrix clearing' would be a big issue... i will have to do some thinking on the mather and see if i cant modify things :)


ImaginaryHuman(Posted 2007) [#17]
Your method of trying to calculate the distance between the objects is extremely inefficient for this type of rendering especially in 2D.

Create a grayscale image containing intensity values which are based on precalculated distances from the center of the object. If I remember correctly you want to use something like distance squared to get a nice gradual falloff. Then all you have to do is draw the image with an `addition` mode ie additive blend. The images overlapping will automatically create a shared field of intensity values and then it is simply a matter of only drawing the pixels which are above a given threshold. There's no point recalculating the blob field and distance values if the size of the blob object itself does not change, and even if it does change you can use scaling or precalculated images at each size.


Xip(Posted 2007) [#18]
I have alredy thought on your solition a long time ago, but i wanted to try and solve it with out the use of pre-drawn images.

tanx anyway :)

besides, give me a break... i put it together in an houer or so, 10 minutes before my birthday... just so i could have some screensaver-thingy on my computer when i was away.

im sure ther are tons of things that could be done bether, but i did not write it to create some sort of performance record, it was a nice demo effect, without the use of images... calculated with math (my big weak spot).

also, intentional or not... personaly, i think this 'pixely' feeling gives it a very nice retro-demo style, witch i dont mind at all :)

so seriusly, who cares?:)


ImaginaryHuman(Posted 2007) [#19]
Seems like you care ;-D

Just joking. It's not a big deal, I just thought you were trying to improve it.


Xip(Posted 2007) [#20]
hehe i was trying to improve it, the existing algoritms that is:)

but it was a one-day project, im not going to put to mutch time into it, and i have 10+ other more serius projects that needs my time at the moment :)

however, its nice to be back on this site tho :)