Old 27th February 2008, 07:34   #1
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
Pixel Shader fractals possible?

http://blogs.msdn.com/shawnhar/archi...or-julias.aspx

how much of this code needs to change to work in milkdrop?

it's only 20 lines, is it possible?

float4 PixelShader(float2 texCoord : TEXCOORD0) : COLOR0
{
float2 c = (texCoord - 0.5) * Zoom * float2(1, Aspect) - Pan;
float2 v = 0;

float m = 0;

const float r = 5;

for (int n = 0; n < Iterations; n++)
{
v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c;

if (dot(v, v) < (r*r - 1))
m++;

v = clamp(v, -r, r);
}

if (m == Iterations)
return 0;
else
return float4(sin(m/4), sin(m/5), sin(m/7), 1) / 4 + 0.75;
}

This renders fractals in glorious technicolor:
bdrv is offline   Reply With Quote
Old 27th February 2008, 10:38   #2
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
waaah, i just read the headline and thought you read my mind last night!...

no way, not with pixelshader2.0. There are only 64 Operations and we have no loops.
Maybe someday when people will have more powerful graphics cards and Geiss launches a new MD version for higher pixelshader levels...

BUT...
some basic ferns are possible: check out this one! (it's about eight hours old...)
Flexi is offline   Reply With Quote
Old 27th February 2008, 16:44   #3
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
oh yeah, fine fractals possible with shaders...
Attached Files
File Type: milk flexi - final ferntasy.milk (13.2 KB, 567 views)
Flexi is offline   Reply With Quote
Old 27th February 2008, 21:48   #4
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
ferntastic!!! so its not possible to plot a xy graph of mandelbrote set?
bdrv is offline   Reply With Quote
Old 27th February 2008, 22:13   #5
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
nope. not with the algorithms i know.
It twisted my mind for so long now, if there's a dirty way with a wicked uv-transformation... but all i got was some serious headaches.
Rovastars Fractopia points in this direction, but i didn't play much with it, and if i'm right there will never be a deep dive-in like mad.

Last edited by Flexi; 27th February 2008 at 22:37.
Flexi is offline   Reply With Quote
Old 27th February 2008, 22:15   #6
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
oops, i forgot something

this is soulfood!
Attached Files
File Type: milk flexi - fractrip.milk (13.3 KB, 526 views)
Flexi is offline   Reply With Quote
Old 27th February 2008, 23:03   #7
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
woah thats very complicated!
oops it's 1000ds of iterations in sequence to do mendel...
here is a little remix
bdrv is offline   Reply With Quote
Old 28th February 2008, 00:09   #8
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
nice one!

mashed up with the ferntasy color mapping and some manual finetuning...
but that should be enough for today...
Attached Files
File Type: milk flexi, bdrv + geiss - aftermath.milk (13.7 KB, 497 views)
Flexi is offline   Reply With Quote
Old 28th February 2008, 13:36   #9
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
Quote:
Originally posted by Flexi
oh yeah, fine fractals possible with shaders...
?? The screen for this just goes all yellow in about 0.5 seconds?

nvidia 7600GT

same with fractrip

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 28th February 2008, 14:02   #10
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
did a quick tweak to your aftermath one to add some audio reactivity still needs some work but a building block
Attached Files
File Type: milk flexi,_bdrv_+_geiss_-_aftermath (mix).milk (14.0 KB, 406 views)

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 28th February 2008, 15:37   #11
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
disturbing mix.

argh - i made these presets on my radeon9600, where texture wrap only works with a workaround - replace all the sampler_main with sampler_fc_main to avoid mirroring to death... thx for that hint, will fix it.

in 2 weeks i will get a new PC with a HD3870. Is it sick to be thrilled for a new PC for... Milkdrop?

here's the most current of its kind.
can you please tell me whether it runs as it should.
Attached Files
File Type: milk flexi - gay eagle [call him ferny ernie].milk (14.3 KB, 391 views)
Flexi is offline   Reply With Quote
Old 28th February 2008, 16:33   #12
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
that one looks ok

nice btw
Attached Images
File Type: jpg pic.jpg (85.4 KB, 424 views)

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 28th February 2008, 16:53   #13
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
and a quick mix. Just getting to know what you did to create it.....
Attached Files
File Type: milk flexi_-_gay_eagle_[call_him_ferny_ernie mix].milk (14.5 KB, 471 views)

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 28th February 2008, 18:55   #14
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
hehe these 4 multiplications are too much for my old video card... (no PS3.0 support)
basically it's a rebuild of textured custom shapes but with a twist:
custom shapes have no option to change the aspect ratio and i also did some tricks - green and blue channels are feeded by the red one, where the main fern lies in.

the rest is simple: greyscale the rgb input and mapping a palette with a polynome on the grey value.

btw - here's a similar fractal with custom shapes only
Attached Files
File Type: milk flexi - swinging fractal.milk (13.0 KB, 358 views)
Flexi is offline   Reply With Quote
Old 28th February 2008, 19:10   #15
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
Yeah sorry I made it a PS3.0 version as I just cut and pasted variables. I should make it a more efficent one using only a few extra operations.

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 28th February 2008, 22:33   #16
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
AWESOME! those are some fine graphics.
this is cool:
Attached Files
File Type: milk shifter - dark tides bdrv mix.milk (14.5 KB, 450 views)
bdrv is offline   Reply With Quote
Old 29th February 2008, 00:45   #17
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
truly cool preset, but very slow on my machine.


...I couldn't resist...
Flexi is offline   Reply With Quote
Old 29th February 2008, 01:06   #18
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
Getting the hang of it now.

Keep it down to PS level 2.0 too.

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 29th February 2008, 05:18   #19
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
here is a conway inside a spiral...
Attached Files
File Type: milk shifter - dark tides bdrv mix 2.milk (8.9 KB, 347 views)

Last edited by bdrv; 29th February 2008 at 05:37.
bdrv is offline   Reply With Quote
Old 29th February 2008, 05:51   #20
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
a small mod...
Attached Files
File Type: milk shifter - dark tides bdrv mix 2c.milk (8.9 KB, 412 views)
bdrv is offline   Reply With Quote
Old 1st March 2008, 04:13   #21
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
...a fractal too...
Flexi is offline   Reply With Quote
Old 1st March 2008, 17:44   #22
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
it looks like a volcano !
bdrv is offline   Reply With Quote
Old 2nd March 2008, 11:45   #23
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
yeah! fractal foam and sponges...
Flexi is offline   Reply With Quote
Old 2nd March 2008, 11:46   #24
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
....
...
Flexi is offline   Reply With Quote
Old 2nd March 2008, 13:49   #25
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
okay, here's a quest:

The first one who adds a cool random dithering effect to the composite shader, wins a lollipop!
Flexi is offline   Reply With Quote
Old 2nd March 2008, 22:53   #26
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
Attached Files
File Type: milk flexi + geiss - bipolar vs. reaction diffusion.milk (6.5 KB, 442 views)
Flexi is offline   Reply With Quote
Old 3rd March 2008, 03:57   #27
Stahlregen
Senior Member
 
Join Date: Feb 2008
Posts: 218
and look at the cute things you can do with a little mashup...
Stahlregen is offline   Reply With Quote
Old 6th March 2008, 14:24   #28
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
I've got it

hehe, actually not. this isn't the Mandelbrot but a Julia set.

Go play with the shader code! - i want to see some cool spots to finally colorize em.
here's a map:
http://upload.wikimedia.org/wikipedi...ia-Teppich.png
http://en.wikipedia.org/wiki/Julia_set

be careful with the zoom var, it needs some sure instinct to find the right setting.
You can also play with the color fade: try different dynamic ranges for the 3 channels.

But now have fun!
Attached Files
File Type: milk flexi - julia set shader example.milk (5.0 KB, 364 views)
Flexi is offline   Reply With Quote
Old 6th March 2008, 14:44   #29
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
and one colored attempt.
Attached Files
File Type: milk flexi - julia set shader example 2.milk (5.1 KB, 440 views)
Flexi is offline   Reply With Quote
Old 6th March 2008, 16:36   #30
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
the future?
Attached Files
File Type: milk flexi - julian wave analyzer.milk (12.1 KB, 488 views)

Last edited by Flexi; 6th March 2008 at 17:20.
Flexi is offline   Reply With Quote
Old 6th March 2008, 17:54   #31
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
so that must be enough material for now
Attached Files
File Type: milk flexi - julia set shader example 3.milk (12.1 KB, 323 views)
Flexi is offline   Reply With Quote
Old 6th March 2008, 20:14   #32
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
now lean back and let this one kick your ass.
sry, i'll try to slow down a bit...
Attached Files
File Type: milk flexi - julian affairs [trance mix].milk (12.4 KB, 388 views)

Last edited by Flexi; 6th March 2008 at 20:46.
Flexi is offline   Reply With Quote
Old 7th March 2008, 03:55   #33
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
Quote:
http://blogs.msdn.com/shawnhar/arch...lor-julias.aspx

how much of this code needs to change to work in milkdrop?

it's only 20 lines, is it possible?
if you have a good video card... about 10.

pretty sure ps.2 has for loops, but i know 3 does got the m set right here... still working on it, I'll put it out here soon, ps3 only unfortunately as it was like 147 instructions at 10 iterations, I'm at 30i now only getting 20fps(gs7300 i think)

I'll be back..

Blah!
redi jedi is offline   Reply With Quote
Old 7th March 2008, 04:51   #34
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
here ya go...
ps3 only, beefy computer advised.. worth it..
Attached Files
File Type: zip fractals.zip (9.8 KB, 459 views)

Blah!
redi jedi is offline   Reply With Quote
Old 7th March 2008, 12:11   #35
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
i'm still waiting for my new cpu and video card to check it out (case, mobo and the rest is already here)
Meanwhile there's a lot of fun with Julia sets too. - and they run smooth even on my Radeon9600/9700

Here's one with a cubic iteration.
Attached Files
File Type: milk flexi - julian affairs [cubic edit].milk (12.6 KB, 341 views)
Flexi is offline   Reply With Quote
Old 7th March 2008, 17:34   #36
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
and another crazy remix

i had the chance to glance at the Mandelbrot presets. (very smooth on a 8800GT)
man, it's really time for a new computer. Amazing work, i didn't believe this was possible in so short code. *Thumbs up*
Attached Files
File Type: milk flexi - more fun with julia sets.milk (12.5 KB, 363 views)

Last edited by Flexi; 7th March 2008 at 17:52.
Flexi is offline   Reply With Quote
Old 7th March 2008, 21:13   #37
redi jedi
Will code for food
 
Join Date: Mar 2005
Location: orlando
Posts: 521
heres some remixes of your code, ps2 should run much better on your comp.
Attached Files
File Type: zip julian mixes.zip (8.4 KB, 411 views)

Blah!
redi jedi is offline   Reply With Quote
Old 8th March 2008, 02:20   #38
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
seems you like it rapid

btw: i had to correct the PS version for your presets with the notepad and i had to include the texture wrap workaround - but only in the 'sweet mix' i could figure out a fractal. maybe you can post a screenshot of one of the other presets.
Attached Files
File Type: milk flexi - julia set shader [neocortex wiretapping].milk (12.8 KB, 343 views)
Flexi is offline   Reply With Quote
Old 8th March 2008, 11:33   #39
bdrv
Senior Member
 
Join Date: Apr 2007
Posts: 183
wow that is truly beautiful! time to upgrade the PC.
bdrv is offline   Reply With Quote
Old 11th March 2008, 20:01   #40
Flexi
wellspring of milk
Major Dude
 
Flexi's Avatar
 
Join Date: Apr 2007
Location: 54.089866,12.11168,18.75
Posts: 2,055
Send a message via ICQ to Flexi
...the everyday fractal preset...
Attached Files
File Type: milk flexi - julia vs. sierpinski.milk (13.8 KB, 429 views)

Last edited by Flexi; 11th March 2008 at 20:17.
Flexi is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Visualizations > MilkDrop > MilkDrop 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 On
HTML code is Off

Forum Jump