![]() |
#1 |
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: |
![]() |
![]() |
![]() |
#2 |
wellspring of milk
Major Dude |
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...) |
![]() |
![]() |
![]() |
#3 |
wellspring of milk
Major Dude |
oh yeah, fine fractals possible with shaders...
![]() |
![]() |
![]() |
![]() |
#4 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
ferntastic!!! so its not possible to plot a xy graph of mandelbrote set?
|
![]() |
![]() |
![]() |
#5 |
wellspring of milk
Major Dude |
nope.
![]() 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. WebSocket Hub for Kinect SDK 2.0 with Milkdrop shader pipeline in VanillaJS and glsl Codepen | Shadertoy | OpenProcessing | studio sketchpad Twitter @ Google+ @ YouTube @ Facebook Last edited by Flexi; 27th February 2008 at 22:37. |
![]() |
![]() |
![]() |
#6 |
wellspring of milk
Major Dude |
oops, i forgot something
![]() this is soulfood! ![]() |
![]() |
![]() |
![]() |
#7 |
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 |
![]() |
![]() |
![]() |
#8 |
wellspring of milk
Major Dude |
nice one!
mashed up with the ferntasy color mapping and some manual finetuning... ![]() but that should be enough for today... ![]() |
![]() |
![]() |
![]() |
#9 | |
Moderator
|
Quote:
nvidia 7600GT same with fractrip ![]() "Rules are for the guidance of wisemen and the obedience of fools" Visuals - Morphyre www.Morphyre.com |
|
![]() |
![]() |
![]() |
#10 |
Moderator
|
did a quick tweak to your aftermath one to add some audio reactivity still needs some work but a building block
"Rules are for the guidance of wisemen and the obedience of fools" Visuals - Morphyre www.Morphyre.com |
![]() |
![]() |
![]() |
#11 |
wellspring of milk
Major Dude |
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. |
![]() |
![]() |
![]() |
#12 |
Moderator
|
that one looks ok
nice btw "Rules are for the guidance of wisemen and the obedience of fools" Visuals - Morphyre www.Morphyre.com |
![]() |
![]() |
![]() |
#13 |
Moderator
|
and a quick mix. Just getting to know what you did to create it.....
"Rules are for the guidance of wisemen and the obedience of fools" Visuals - Morphyre www.Morphyre.com |
![]() |
![]() |
![]() |
#14 |
wellspring of milk
Major Dude |
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 |
![]() |
![]() |
![]() |
#15 |
Moderator
|
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 |
![]() |
![]() |
![]() |
#16 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
AWESOME! those are some fine graphics.
this is cool: |
![]() |
![]() |
![]() |
#17 |
wellspring of milk
Major Dude |
truly cool preset, but very slow on my machine.
...I couldn't resist... ![]() |
![]() |
![]() |
![]() |
#18 |
Moderator
|
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 |
![]() |
![]() |
![]() |
#19 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
here is a conway inside a spiral...
Last edited by bdrv; 29th February 2008 at 05:37. |
![]() |
![]() |
![]() |
#20 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
a small mod...
|
![]() |
![]() |
![]() |
#21 |
wellspring of milk
Major Dude |
...a fractal too...
|
![]() |
![]() |
![]() |
#22 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
it looks like a volcano !
![]() |
![]() |
![]() |
![]() |
#23 |
wellspring of milk
Major Dude |
yeah! fractal foam and sponges...
|
![]() |
![]() |
![]() |
#24 |
wellspring of milk
Major Dude |
![]() ... ![]() |
![]() |
![]() |
![]() |
#25 |
wellspring of milk
Major Dude |
okay, here's a quest:
The first one who adds a cool random dithering effect to the composite shader, wins a lollipop! ![]() |
![]() |
![]() |
![]() |
#26 |
wellspring of milk
Major Dude |
![]() |
![]() |
![]() |
![]() |
#27 |
Senior Member
Join Date: Feb 2008
Posts: 218
|
and look at the cute things you can do with a little mashup...
|
![]() |
![]() |
![]() |
#28 |
wellspring of milk
Major Dude |
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! ![]() |
![]() |
![]() |
![]() |
#29 |
wellspring of milk
Major Dude |
and one colored attempt.
|
![]() |
![]() |
![]() |
#30 |
wellspring of milk
Major Dude |
the future?
WebSocket Hub for Kinect SDK 2.0 with Milkdrop shader pipeline in VanillaJS and glsl Codepen | Shadertoy | OpenProcessing | studio sketchpad Twitter @ Google+ @ YouTube @ Facebook Last edited by Flexi; 6th March 2008 at 17:20. |
![]() |
![]() |
![]() |
#31 |
wellspring of milk
Major Dude |
so that must be enough material for now
![]() ![]() |
![]() |
![]() |
![]() |
#32 |
wellspring of milk
Major Dude |
now lean back and let this one kick your ass.
sry, i'll try to slow down a bit... ![]() WebSocket Hub for Kinect SDK 2.0 with Milkdrop shader pipeline in VanillaJS and glsl Codepen | Shadertoy | OpenProcessing | studio sketchpad Twitter @ Google+ @ YouTube @ Facebook Last edited by Flexi; 6th March 2008 at 20:46. |
![]() |
![]() |
![]() |
#33 | |
Will code for food
Join Date: Mar 2005
Location: orlando
Posts: 521
|
Quote:
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! |
|
![]() |
![]() |
![]() |
#34 |
Will code for food
Join Date: Mar 2005
Location: orlando
Posts: 521
|
here ya go...
ps3 only, beefy computer advised.. worth it.. Blah! |
![]() |
![]() |
![]() |
#35 |
wellspring of milk
Major Dude |
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. |
![]() |
![]() |
![]() |
#36 |
wellspring of milk
Major Dude |
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* WebSocket Hub for Kinect SDK 2.0 with Milkdrop shader pipeline in VanillaJS and glsl Codepen | Shadertoy | OpenProcessing | studio sketchpad Twitter @ Google+ @ YouTube @ Facebook Last edited by Flexi; 7th March 2008 at 17:52. |
![]() |
![]() |
![]() |
#37 |
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.
Blah! |
![]() |
![]() |
![]() |
#38 |
wellspring of milk
Major Dude |
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. |
![]() |
![]() |
![]() |
#39 |
Senior Member
Join Date: Apr 2007
Posts: 183
|
wow that is truly beautiful! time to upgrade the PC.
|
![]() |
![]() |
![]() |
#40 |
wellspring of milk
Major Dude |
...the everyday fractal preset...
![]() WebSocket Hub for Kinect SDK 2.0 with Milkdrop shader pipeline in VanillaJS and glsl Codepen | Shadertoy | OpenProcessing | studio sketchpad Twitter @ Google+ @ YouTube @ Facebook Last edited by Flexi; 11th March 2008 at 20:17. |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|