17
CG Final Project 600410055 陳陳陳

CG Final Project

Embed Size (px)

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

Page 1: CG Final Project

CG Final Project

600410055 陳易志

Page 2: CG Final Project

GPU Programming

Fractal

Page 3: CG Final Project

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.

Page 4: CG Final Project

2 example

Mandelbrot set Julia set

Page 5: CG Final Project

Mandelbrot set

Definition• where c is a complex parameter.

• Mandelbrot set M,

Page 6: CG Final Project

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;

}

Page 7: CG Final Project

Julia set

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

Page 8: CG Final Project

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;

}

Page 9: CG Final Project

problem

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

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

Page 10: CG Final Project

Proposed method

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

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

Page 11: CG Final Project

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)

Page 12: CG Final Project

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)

Page 13: CG Final Project

demo

Click image Click image

Page 14: CG Final Project

demo

Click image Click image

Page 15: CG Final Project

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.

Page 16: CG Final Project

Future

• Better graph card supports double.• Numerical algorithm