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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1901 - (view) (download)

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 : jhr 1901 // fixed in r1900 -- JHR
12 : glk 1896 input real fov = 1.0;
13 :    
14 :     // Strand definition
15 :     strand mandel(vec2 c) {
16 :     vec2 z = [0.0, 0.0];
17 :     int iter = 0;
18 :     output vec3 rgb = [0.0, 0.0, 0.0];
19 :     update {
20 :     z = [z[0]^2 - z[1]^2, 2.0*z[0]*z[1]] + c; // z = z^2 + c
21 :     iter += 1;
22 :     if (z•z > 4.0) {
23 :     // point has escaped; set color based on iteration
24 :     real t = 11.0*real(iter)^0.2;
25 :     rgb = [sin(t), sin(t + 2.0*π/3.0), sin(t - 2.0*π/3.0)];
26 :     rgb = ([1.7, 1.7, 1.7] + rgb)/2.7;
27 :     stabilize;
28 :     }
29 :     if (iter > maxiter) {
30 :     rgb = [0.0, 0.0, 0.0];
31 :     stabilize;
32 :     }
33 :     }
34 :     }
35 :    
36 :     // Strand initialization
37 :     initially [ mandel([lerp(center[0]-fov, center[0]+fov,
38 :     1.0, real(crIdx), real(reso)),
39 :     lerp(center[1]-fov, center[1]+fov,
40 :     1.0, real(ciIdx), real(reso))])
41 :     | ciIdx in 1..reso, crIdx in 1..reso ];

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