Logo by Cyclops - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. March 29, 2024, 10:17:44 AM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 ... 5 6 [7]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Buddhabrot on GPU  (Read 36808 times)
0 Members and 1 Guest are viewing this topic.
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #90 on: August 09, 2010, 01:36:52 AM »

i found an insane bug in my code.

oops! wink  It appears you've switched to Mandelbulbs now.

I am making some progress with nVidia's 3DVision stereo blit API. Now I need to merge this code with some nVidia sample code that allows CUDA to write to a DirectX texture - when done I should be able to do some Buddhabrot renders in 3D stereo.

The one year old nvidia drivers 186.18 have an anaglyph mode ("3DVision Discover") that shows the output in red/cyan anaglyph mode. Too bad they removed this option for older GPUs in later drivers. I actually had to go back to this ancient driver to do some testing on my laptop.

The thing needs to run in full screen mode, that is the only downside.
Logged
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #91 on: August 09, 2010, 06:43:58 AM »

i found an insane bug in my code.

oops! wink  It appears you've switched to Mandelbulbs now.


I'm learning mandelbulb and this thing named "triplex" by coding.
I'll be back to buddhabrot soon after that, i'm not satisfied with actual "implementation" of both 3D Mandelbrot and 3D Buddhabrot.
I'm not sure if i'll find anything, but i have to try ... because i can smiley
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #92 on: August 11, 2010, 02:11:55 AM »

I am making some progress with nVidia's 3DVision stereo blit API.

I finally managed to render something to screen using CUDA in 3D stereoscopic mode. Both red/cyan glasses and LCD shutter goggles work.  3D Buddhas approaching anytime now ,)
« Last Edit: August 11, 2010, 02:20:30 AM by cbuchner1 » Logged
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #93 on: September 06, 2010, 09:42:06 PM »

guess what i bought today ...

http://www.nvidia.com/object/3d-vision-home-users.html   embarrass
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #94 on: September 06, 2010, 10:13:16 PM »

guess what i bought today ...

What's the monitor you're using with these fantastic nerd goggles?
Logged
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #95 on: September 07, 2010, 08:50:56 AM »

guess what i bought today ...

What's the monitor you're using with these fantastic nerd goggles?


samsung 2233RZ, 22"
it was one of the 1st 3D Vision screen. Very expensive (450€) when it was out, it now cost 250€ (bought it last week) which is fair for a good screen (still a bit expensive for a 22"), and the cheapest 120hz "3D visions" screen i found.

A lot of games are not really playable with 3D Vision : ugly 2D effect, 2D billboard that render at wrong depth, ...
For same games it's "ok" : texts render at wrong depth (eg: guild wars)
And for a few games, it's perfect and mind blowing : Left4Dead, RUSE, Avatar, ...
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
ker2x
Fractal Molossus
**
Posts: 795


WWW
« Reply #96 on: December 03, 2010, 08:57:47 PM »

I cleaned my openCL code.

Code:
//Check if choosen point is in MSet
bool isInMSet(
    const float2 c,
    const uint minIter,
    const uint maxIter,
    const float escapeOrbit)
{
    int iter = 0;
    float2 z = 0.0;

    if( !(((c.x-0.25)*(c.x-0.25) + (c.y * c.y))*(((c.x-0.25)*(c.x-0.25) + (c.y * c.y))+(c.x-0.25)) < 0.25* c.y * c.y))  //main cardioid
    {
        if( !((c.x+1.0) * (c.x+1.0) + (c.y * c.y) < 0.0625))            //2nd order period bulb
        {
            if (!(( ((c.x+1.309)*(c.x+1.309)) + c.y*c.y) < 0.00345))    //smaller bulb left of the period-2 bulb
            {
                if (!((((c.x+0.125)*(c.x+0.125)) + (c.y-0.744)*(c.y-0.744)) < 0.0088))      // smaller bulb bottom of the main cardioid
                {
                    if (!((((c.x+0.125)*(c.x+0.125)) + (c.y+0.744)*(c.y+0.744)) < 0.0088))  //smaller bulb top of the main cardioid
                    {
                        while( (iter < maxIter) && (z.x*z.x + z.y*z.y < escapeOrbit) )      //Bruteforce check 
                        {
                            z = (float2)(z.x * z.x - z.y * z.y, (z.x * z.y * 2.0)) + c;
                            iter++;
                        }
                        if( (iter > minIter) && (iter < maxIter))
                        {
                            return false;
                        }
                    }
                }
            }
        }
    }
    return true;
}

//Main kernel
__kernel void buddhabrot(
    const float realMin,
    const float realMax,
    const float imaginaryMin,
    const float imaginaryMax,
    const uint  minIter,
    const uint  maxIter,
    const uint  width,
    const uint  height,
    const float escapeOrbit,
    const uint4 minColor,
    const uint4 maxColor,
    __global float2* randomXYBuffer,
    __global uint4*  outputBuffer)
{

    float2 rand = randomXYBuffer[get_global_id(0)];   

    const float deltaReal = (realMax - realMin);
    const float deltaImaginary = (imaginaryMax - imaginaryMin);

    //mix(a,b,c) = a + (b-a)*c //(c must be in the range 0.0 ... 1.0
    float2 c = (float2)(mix(realMin, realMax, rand.x) , mix(imaginaryMin, imaginaryMax, rand.y));

    if( isInMSet(c, minIter, maxIter, escapeOrbit) == false)
    {
        int x, y;
        int iter = 0;
        float2 z = 0.0;
   
        while( (iter < maxIter) && ((z.x*z.x+z.y*z.y) < escapeOrbit) )
        {
            z = (float2)(z.x * z.x - z.y * z.y, (z.x * z.y * 2.0)) + c;
            x = (width * (z.x - realMin) / deltaReal);
            y = (height * (z.y - imaginaryMin) / deltaImaginary);

            if( (iter > minIter) && (x>0) && (y>0) && (x<width) && (y<height) )
            {
                if( (iter > minColor.x) && (iter < maxColor.x) ) { outputBuffer[x + (y * width)].x++; }
                if( (iter > minColor.y) && (iter < maxColor.y) ) { outputBuffer[x + (y * width)].y++; }
                if( (iter > minColor.z) && (iter < maxColor.z) ) { outputBuffer[x + (y * width)].z++; }
            }
            iter++;
        }
    }
}

__kernel void xorshift(
    uint s1,
    uint s2,
    const int bufferSize,
    __global float2* randomXYBuffer
)
{
    uint st;

    for(int i=0; i < bufferSize; i++)
    {
        st = s1 ^ (s1 << 11);
        s1 = s2;
        s2 = s2 ^ (s2 >> 19) ^ ( st ^ (st >> 18));
        randomXYBuffer[i] = (float2)((float)st / UINT_MAX,(float)s1 / UINT_MAX);
    }
}


Now i'll be able to test some other idea smiley
Logged

often times... there are other approaches which are kinda crappy until you put them in the context of parallel machines
(en) http://www.blog-gpgpu.com/ , (fr) http://www.keru.org/ ,
Sysadmin & DBA @ http://www.over-blog.com/
ant123
Guest
« Reply #97 on: April 03, 2011, 11:58:16 PM »

you might be able to make it using shaders for milkdrop vis, although it would faster it could look abit lamer.
Logged
Pages: 1 ... 5 6 [7]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Interpolations in Buddhabrot General Discussion woronoi 4 3687 Last post November 07, 2016, 09:40:52 AM
by woronoi
Buddhabrot everywhere !! Images Showcase (Rate My Fractal) ker2x 0 699 Last post September 13, 2016, 05:42:09 PM
by ker2x
buddhabrot x20838019 Images Showcase (Rate My Fractal) ker2x 0 640 Last post September 20, 2016, 09:58:04 PM
by ker2x
Buddhabrot Mag(nifier) - A realtime buddhabrot zoomer Announcements & News « 1 2 3 4 » Sharkigator 46 18673 Last post September 30, 2017, 11:26:53 AM
by Sharkigator
just another buddhabrot Still Frame - Wildstyle claude 0 961 Last post June 20, 2017, 08:43:10 PM
by claude

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.153 seconds with 24 queries. (Pretty URLs adds 0.007s, 2q)