• Welcome to Dark Bit Factory & Gravity.
 

Trippy swirly pattern generator!

Started by Kirl, January 22, 2011

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Kirl

I'm working on a dynamic pattern thingy, it is based on SuperLineFollow with which I wasted hours of my life. I always wanted to recreate it to add more variation options. Love to hear any suggestions.

Try it here!
[UPDATE] updated file
[UPDATE2] final (?) version

Mouse move: create swirly patterns!
Left Mouse Button: change color
Up/Down arrows: add or remove clones
Ctrl: toggle between particles/lines (Alt: switch particle shape)
www.kirl.nl
Challenge Trophies Won:

va!n

I really like it! The mode with the circles/particles (which looks like curves lines) is my favourite one! The one with boxes will produce some very nice/interesting patterns too!

Particles and lines mode runs here at 17fps - but when adding a lot of clones, the particled mode runs a lot faster (still aroung 17 fps) while the lined mode rund down to 1 fps (is this normal?)

Anyway very nice work! =) *thumbs up*
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

benny!

[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

va!n

@Kirl:
I think you draw all particles (elements) for the whole screen, each frame - right?

Since the effect is everytime centered, you could possible optimize its speed by doing a small trick! What about splitting the screen into 4 parts (1 horizontal and 1 vertical line)?

So you just only need to calculate/draw the top/left part (and mirror this part in x and y). Maybe this could speed up your effect...
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

LittleWhite

I have 19 FPS in the first mode ( 10 Particules ... )
Why are you displaying ten when I am changing the colour

Really nice :)
The demoscene will never die, never!

va!n

#5
@LittleWhite:
The "ten" just tells you the number of used clones ^^ (you can change with cursors up/down to get some really nice effects)


@Kirl:
Found just a small bug ^^ Just add something like:

numberOfClones = (numberOfClones < 1) ? 1 : numberOfClones;
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

LittleWhite

I didn't get that I have to click to change the parameters.
I love it
The demoscene will never die, never!

zawran

Cool effect, almost hypnotic with some of the patterns.

Kirl

@LittleWhite
You need to click to set the focus of the page to the Flash file, it's something Flash requires when te page is loaded.

@va!n
Thanks for spotting the bug! The optimisation trick won't work because the 2 axis of symmetry rotate in opposite directions with an even nr of clones.

There are still some optimisations I can do, and I spotted a serious one-line slowdown for particle mode. I'll post an update soon.
www.kirl.nl
Challenge Trophies Won:

Xetick

Really nice effect. Have you tried to apply a gradient to the ribbons?
So it becomes something like


Not sure what the speed in flash would be for that though

Quote from: Kirl on January 23, 2011
@LittleWhite
You need to click to set the focus of the page to the Flash file, it's something Flash requires when te page is loaded.

If you want to fix that problem you can use SWFObject. Google even has it in its javascript directory so you dont need to store the .js file on your own server.
Plane9 - Home of the Plane9 3d screensaver/music visualizer
Challenge Trophies Won:

valis

This is very pretty.  I'd like to see it implemented in C.

Kirl

I uploaded an updated version which should run slightly faster.

@ Xetick
Thanks for the suggestion, transparency in Flash can become quite slow but a nice colour gradient shouldn't be a problem. Where did you get the image from?

I'll live with setting the focus manually, I usually link to the swf directly for convenience sake. Thanks for the tip though!

@valis
If you (or anybody) feel like porting it, I'll post the source when I'm done cleaning it up a bit, the actual math is pretty straightforward.
www.kirl.nl
Challenge Trophies Won:

LittleWhite

#12
With 69 particules ... it freezes O_o
Controls answer ... if I am passing something on the middle I saw the number (to 1 now ... ) but nothing else.

Some for 68.
Way to do it:
- Do some move ... increase to +60
- Do some move
- FREEZE

Second note:

Yes it's faster ... but the FPS counter not working for sure now ;)

I can freeze it with 34 too ... I have attached screenshot ;)
It's often when particles go in mass to the center
The demoscene will never die, never!

Xetick

Quote from: Kirl on January 24, 2011
Where did you get the image from?

It's from the next unreleased version of my visualizer Plane9. When I saw your flash effect I wanted to try to make something like it and 15 minutes later I had that image.

It's just a pixel shader/shader node

float4 PS_Program(PSInput pi) : COLOR
{
float2 p = -1.0 + 2.0 * pi.tex;
float3 col = _hsv2rgb(pi.diffuse.a, 0.5, 0.5);
return float4(col*in1.x, pi.tex.y*(1.0-abs(p.x)));
}


in1.x is a evaluated from a expression and sent into the shader "in1.x = min(1,0.5+beat(1)*5);". It makes it pulse to the beat of the music

That shader is then connected to a ribbon node that draws a number of ribbons using a expression

rnr = ribbonnr/numribbons;
radius = noise1(time)*1.8;
pos.x = sin(time+PI*2*rnr)*radius;
pos.y = cos(time+PI*2*rnr)*radius;
pos.z = 0;
col.a = rnr;
width = 0.05;


noise1 generates a 1d noise value using simplex noise. Just to create some random but controlled motion since I have no support for user input like you do.

The ribbon node is connected to a clone node that creates another copy and rotates it 180 degrees to create the mirror effect.

So not as nice movement as you have but it's something. You seems to have a form of rubber/string effect attached to the moving particles that creates quite a lot of the effect.
Plane9 - Home of the Plane9 3d screensaver/music visualizer
Challenge Trophies Won:

Shockwave

Ah, it's nice and reminds me of lots of happy hours playing with Jeff Minters trip a tron in a dark room!
Shockwave ^ Codigos
Challenge Trophies Won:

Kirl

#15
@LittleWhite
Does it actually come to a complete halt, or is it a temporary freeze? It can get really slow at points.

@Xetick
Yes, I use an array of xy points of which the 1st springs to the mouse, following points spring to each previous point. These form a ribbon which I copy and rotate. With an even number of ribbons the xscale of every other ribbon is flipped.

Plane9 looks great, love the rotating glowing lines!

@Shockwave
The name is enough to know I missed something great.
www.kirl.nl
Challenge Trophies Won:

LittleWhite

#16
It freezes completeley ... I have wait aroud ... 3 minutes ...

EDIT: Ok ... forget about the issue ... was certainly Firefox / or my PC because I didn't restart it since a long time.
Now it's not bugging (even with 90 particles :))
Nice optimisation job
The demoscene will never die, never!

Kirl

That's weird, what browser are you using?  ???
Can you crash the first version as well?
www.kirl.nl
Challenge Trophies Won:

LittleWhite

Quote from: Kirl on January 25, 2011
That's weird, what browser are you using?  ???
Can you crash the first version as well?
GNU/Linux Ubuntu 10.04 / Firefox 3.6.13
But ... It was the first time that I get your app freeze. Maybe some memory issue with Firefox. Since I can't recrash it, and since the crash environment was: Don't switch off the computer during one week ...
(Youtube video were not starting ... so ... best is to restart the whole Firefox (which I have forgot to do before reporting the issue)
The demoscene will never die, never!

Kirl

#19
I finished up this pattern thingy and slapped an ad on it, love to hear what you think.

Try it here!
www.kirl.nl
Challenge Trophies Won: