Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/lamont/test/mandel-BUG1.diderot
ViewVC logotype

Annotation of /branches/lamont/test/mandel-BUG1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1896 - (view) (download)
Original Path: branches/vis12/test/mandel-BUG1.diderot

1 : glk 1896 // ../bin/diderotc --exec mandel.diderot && ./mandel && unu quantize -b 8 -i rgb.nrrd -o mandel.png
2 :    
3 :     // Global definitions
4 :     input int reso = 800;
5 :     input int maxiter = 1000;
6 :     input vec2 center = [0.0,0.0];
7 :     // BUG: uncaught exception Fail [Fail: getExp(crIdx0136)]
8 :     // raised at common/phase-timer.sml:76.50-76.52
9 :     // raised at common/phase-timer.sml:76.50-76.52
10 :     // raised at IL/value-numbering-fn.sml:47.36-47.83
11 :     input real fov = 1.0;
12 :    
13 :     // Strand definition
14 :     strand mandel(vec2 c) {
15 :     vec2 z = [0.0, 0.0];
16 :     int iter = 0;
17 :     output vec3 rgb = [0.0, 0.0, 0.0];
18 :     update {
19 :     z = [z[0]^2 - z[1]^2, 2.0*z[0]*z[1]] + c; // z = z^2 + c
20 :     iter += 1;
21 :     if (z•z > 4.0) {
22 :     // point has escaped; set color based on iteration
23 :     real t = 11.0*real(iter)^0.2;
24 :     rgb = [sin(t), sin(t + 2.0*π/3.0), sin(t - 2.0*π/3.0)];
25 :     rgb = ([1.7, 1.7, 1.7] + rgb)/2.7;
26 :     stabilize;
27 :     }
28 :     if (iter > maxiter) {
29 :     rgb = [0.0, 0.0, 0.0];
30 :     stabilize;
31 :     }
32 :     }
33 :     }
34 :    
35 :     // Strand initialization
36 :     initially [ mandel([lerp(center[0]-fov, center[0]+fov,
37 :     1.0, real(crIdx), real(reso)),
38 :     lerp(center[1]-fov, center[1]+fov,
39 :     1.0, real(ciIdx), real(reso))])
40 :     | ciIdx in 1..reso, crIdx in 1..reso ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0