CG Final Project

Preview:

DESCRIPTION

CG Final Project. 600410055 陳易志. GPU Programming. Fractal. Fractal. It has a fine structure at arbitrarily small scales. It is too irregular to be easily described in traditional Euclidean geometric language. It is self-similar. It has a simple and recursive definition. 2 example. - PowerPoint PPT Presentation

Citation preview

CG Final Project

600410055 陳易志

GPU Programming

Fractal

Fractal

• It has a fine structure at arbitrarily small scales.

• It is too irregular to be easily described in traditional Euclidean geometric language.

• It is self-similar.• It has a simple and recursive definition.

2 example

Mandelbrot set Julia set

Mandelbrot set

Definition• where c is a complex parameter.

• Mandelbrot set M,

Iterative algorithm

Mandelbrot(x,y){c = complex(x,y);z0=0;

i=0;while(i<n){

zn+1 = zn2 + c;

If(| zn+1 |>s)return false;

i++;}

return true;

}

Julia set

• Difficult to give a definition.• Similar to mandelbrot set.• An example– quadratic polynomials– ,– where c is a complex parameter.

Iterative algorithm

julia(x,y,c){z0 = complex(x,y);

while(ture){zn+1 = zn

2 + c;

If(| zn+1 | is divergent)return false;

i++;}

return true;

}

problem

• High computation– Per pixel– Iterate to n or infinity

• Correctness– Can not iterate to infinity.– Do an approximation.

Proposed method

• Parallel computing in GPU– Per pixel– GLSL Fragment Processor

• assume |z|>float.MAX_VALUE is divergent.• assume s=2.

Result

Mandelbrot set• N=400• S=2

resolution average MAX

256x256 8.5 (ms) 17.5 (ms)

512x512 9.5 (ms) 21.1 (ms)

1024x1024 16.7 (ms) 46.2 (ms)

Result (cont.)

Julia set• N=200• S=10^1.5

resolution average Max

256x256 8.7 (ms) 11.4 (ms)

512x512 9.5 (ms) 21.1 (ms)

1024x1024 9.7 (ms) 29.2 (ms)

demo

Click image Click image

demo

Click image Click image

limitation

• Julia set is more difficult.• zn+1 = zn

2 + c, grow very fast.• Increase iteration=>float bits is not enough.• single-precision vs. double-precision– 8 vs. 11 bits exponent

• GLSL version 400 supports double,• but not all hardware support version 400.

Future

• Better graph card supports double.• Numerical algorithm