[QUOTE=LasGunz;20138318]Who comes to this thread just to look at pretty pictures of other peoples awesome creations and only wishes you had the capacity to do it yourself?
[/QUOTE]
[IMG]http://i45.tinypic.com/2iktjiq.jpg[/IMG]
I suck at math... so I just gave up.
how did you get that picture of null?
Only joking mate, love ya really
I've inputed some awesome patterns into the game of life, watching them dance is hypnotizing:
[img]http://img96.imageshack.us/img96/9836/gol1.png[/img]
[img]http://img25.imageshack.us/img25/6779/gol2l.png[/img]
[img]http://img22.imageshack.us/img22/3392/gol3.png[/img]
I just couldn't help it, the bandwagon is too big already :biggrin:
[IMG]http://img199.imageshack.us/img199/1711/bandwagonh.png[/IMG]
Joining the bandwagon :bandwagon:
[IMG]http://i49.tinypic.com/1z65ixe.png[/img]
I made it 2 years ago though.
Can you do it in a shader though
[media]http://www.youtube.com/watch?v=8ZfwX5adn84&feature=player_embedded[/media]
(not mine)
[QUOTE=garry;20140487]Can you do it in a shader though
[media]http://www.youtube.com/watch?v=8ZfwX5adn84&feature=player_embedded[/media]
(not mine)[/QUOTE]
That's so fucking trippy.
Holy crap oO
[editline]08:57PM[/editline]
Ok, so I TRIED to put it in a shader, but all I get is a black screen:
Mandelbrot.fx:
[code]
uniform extern texture ScreenTexture;
sampler ScreenS = sampler_state
{
Texture = <ScreenTexture>;
};
float4 PixelShader(float2 texCoord: TEXCOORD0) : COLOR
{
float xmin = -2.1;
float ymin = -1.3;
float xmax = 1.0;
float ymax = 1.3;
float intigralX = xmax - xmin;
float intigralY = ymax - ymin;
float x, y, x1=0, y1=0, xx=0;
float looper = 0;
float maxIter = 100;
x = intigralX * texCoord.x;
y = intigralY * texCoord.y;
while ((looper < maxIter) && (((x1 * x1) + (y1 * y1)) < 4))
{
looper = looper + 1;
xx = (x1 * x1) - (y1 * y1) + x;
y1 = 2.0 * x1 * y1 + y;
x1 = xx;
}
float c = 0;
if (looper != maxIter)
c = (looper / maxIter);
float4 color = float4(c,c,c,0);
return color;
}
technique
{
pass P0
{
PixelShader = compile ps_2_0 PixelShader();
}
}
[/code]
And no, I did not do the shading wrong, because if I output
float4 color = float4(1,0,0,0);
I get a completely red screen, so the pixelshader itself works perfectly.
Something else must be wrong.
As you can see, this :
[code]
float length = length(texCoord - float2(0.5,0.5));
float4 color = float4(c,c,length,0);
return color;
[/code]
outputs:
[IMG]http://img203.imageshack.us/img203/1599/shaderworksomgfwfa.png[/IMG]
Fixed it.
[QUOTE=garry;20140487]Can you do it in a shader though
[media]http://www.youtube.com/watch?v=8ZfwX5adn84&feature=player_embedded[/media]
(not mine)[/QUOTE]
[url=http://users.skynet.be/fquake/]This[/url] guy made a 3D Julia fractal in a shader (and mandelbrot in 2D of course)
Regular Polygons for my AP Computer Science Class:
[img]http://filesmelt.com/dl/Regular-Polygon.png[/img]
Here's a download:
[url]http://filesmelt.com/dl/Regular_Polygon.jar[/url]
[QUOTE=garry;20140487]Can you do it in a shader though
[media]http://www.youtube.com/watch?v=8ZfwX5adn84&feature=player_embedded[/media]
(not mine)[/QUOTE]
I freaking love fractals with color bands that change. It animates it so nicely and it looks organic
Ok so i'm starting to think that the hlsl compiler of xna studio 3.1 just doesn't compile while loops in the .fx files.
Any solutions?
I made this last night after I got sdl.net working in Mono
[img]http://dl.dropbox.com/u/1940586/arty.png[/img]
Now I've rewritten the while loop from:
[code]
while ((looper < maxIter) && (((x1 * x1) + (y1 * y1)) < 4))
{
looper = looper + 1;
xx = (x1 * x1) - (y1 * y1) + x;
y1 = 2.0 * x1 * y1 + y;
x1 = xx;
}
[/code]
to
[code]
int doit = 1;
for (int i=0; i < maxIter; i++)
{
if (doit == 1)
{
if ((x1 * x1) + (y1 * y1) < 4)
{
looper = i;
xx = (x1 * x1) - (y1 * y1) + x;
y1 = (2.0f * x1 * y1) + y;
x1 = xx;
}
else
{
doit = 0;
}
}
}
[/code]
And that should be the same loop (Of course, the loop doesn't brake as in the while loop) but it should do the same thing?!
And it's still not working, just a black screen -.-
[QUOTE=Xeon06;20136299]It eventually hangs up on certain systems when there are enough string instances instead of garbage collecting them.
That's negligible.[/QUOTE]
How do you know its hanging because of that?
Have you tried attaching a profiler?
Also, perhaps its 'hung' because the GC is actually running and cleaning up strings - and taking forever to do so. Can you test the theory by using a profiler or debugging the app when it halts?
Right, rate me dumb just because the fucking xna 3.1 shader compiler can't manage to compile nice PS3.0...
[QUOTE=s0ul0r;20143613]Right, rate me dumb just because the fucking xna 3.1 shader compiler can't manage to compile nice PS3.0...[/QUOTE]
Are you 100% sure it doesn't compile the while loop and it's not the code's fault?
[QUOTE=streeter;20143184]How do you know its hanging because of that?
Have you tried attaching a profiler?
Also, perhaps its 'hung' because the GC is actually running and cleaning up strings - and taking forever to do so. Can you test the theory by using a profiler or debugging the app when it halts?[/QUOTE]
Thing is sometimes it garbage collects fine. It seems like it's random.
[URL="http://up.mibbit.com/up/LdlhvK15.png"]PICTURE![/URL]
c++ and opengl.
Loading a md2 model, easy as hell I know.
And yes I made the crappy low poly model :P
[QUOTE=streeter;20143184]How do you know its hanging because of that?
Have you tried attaching a profiler?
Also, perhaps its 'hung' because the GC is actually running and cleaning up strings - and taking forever to do so. Can you test the theory by using a profiler or debugging the app when it halts?[/QUOTE]
I know it's hanging because of if I change this line to dispose it manually or any other option, it won't hang. I tried a memory profiler, result there:
[url]http://dl.dropbox.com/u/3310651/sfml_memleak.png[/url]
I have no idea how to debug an app without using breakpoints or exceptions, and my IDE doesn't support conditional breakpoints. And even then, there are no "is app crashed" bool.
Doesn't your debugger break upon receiving a runtime error?
[QUOTE=ZeekyHBomb;20145029]Doesn't your debugger break upon receiving a runtime error?[/QUOTE]
Sure does, but it's not a runtime error, the application just hangs up, as in an infinite loop. I'll let it run see if it ever gets out of it, but I doubt it.
Ran it for 10 minutes, no change, then I found a way to step in to debug, still don't see what I can do from there.
I finally understand line intersection :haw:
[IMG]http://errur.com/i/images/8334_Lineintersection.png[/IMG]
[QUOTE=Xeon06;20145433]Sure does, but it's not a runtime error, the application just hangs up, as in an infinite loop. I'll let it run see if it ever gets out of it, but I doubt it.
Ran it for 10 minutes, no change, then I found a way to step in to debug, still don't see what I can do from there.[/QUOTE]
It must be some sort of timing issue cause it doesn't hang if you put a thread sleep in the loop.
[QUOTE=Ortzinator;20146191]It must be some sort of timing issue cause it doesn't hang if you put a thread sleep in the loop.[/QUOTE]
Nice find! This might shape up to a solution. I used app.SetFramerateLimit(30) which I believe adds a sleep of 33ms per frame. Have you tried different values? Manually sleeping 1ms didn't work out for me.
[QUOTE=majorlazer;20146951]9th grade math.[/QUOTE]
Not where I went, and though I did already understand how to do it by hand, I didn't know how to translate that into a format that I could use in a programming language.
Thanks for attempting to completely destroy my win here, that's awfully nice of you.
Someone have an article or something to help me grasp how fractals works and can be programed ?
K, now I used pixelshader 2.0b and changed the shader to:
[code]
float4 PixelShader(float2 texCoord: TEXCOORD0) : COLOR
{
float2 c = (texCoord - 0.5) * Zoom * float2(1, 1.3333) + Pan;
float2 v = 0;
bool doit = true;
int iter = 0;
for (int n = 0; n < 100; n++)
{
v = float2(v.x * v.x - v.y * v.y, v.x * v.y * 2) + c;
}
float color = 1-dot(v,v);
float4 Colour = float4(color,color,color,0);
return Colour;
}
[/code]
gets this results:
[IMG]http://img153.imageshack.us/img153/6549/shaderdown.png[/IMG]
I can navigate through it in realtime, nice... but...
as soon as I crank up the iterations it gives me the error:
Pixelshader 2.0b does only support up to 512 arithmetic operations.
Shader 3.0 compiles just fine, but I get an all purple screen.
Already googled it up and xna just fucks up the shader 3.0 but I'm too lazy to fix this right now...
Sorry, you need to Log In to post a reply to this thread.