Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/fem/test/mandel.diderot
 [diderot] / branches / fem / test / mandel.diderot

# Diff of /branches/fem/test/mandel.diderot

revision 1894, Mon May 28 05:46:56 2012 UTC revision 1897, Fri Jun 1 21:11:10 2012 UTC
# Line 5  Line 5
5  input int maxiter = 1000;  input int maxiter = 1000;
6
7  // Strand definition  // Strand definition
8  strand mandel(int crIdx, int ciIdx) {  strand mandel(vec2 c) {
vec2 c = [lerp(-2.0, 2.0, 1.0, real(crIdx), real(reso)),
lerp(-2.0, 2.0, 1.0, real(ciIdx), real(reso))];
9     vec2 z = [0.0, 0.0];     vec2 z = [0.0, 0.0];
10     int iter = 0;     int iter = 0;
11     output vec3 rgb = [0.0, 0.0, 0.0];     output vec3 rgb = [0.0, 0.0, 0.0];
# Line 18  Line 16
16           // point has escaped; set color based on iteration           // point has escaped; set color based on iteration
17           real t = 11.0*real(iter)^0.2;           real t = 11.0*real(iter)^0.2;
18           rgb = [sin(t), sin(t + 2.0*π/3.0), sin(t - 2.0*π/3.0)];           rgb = [sin(t), sin(t + 2.0*π/3.0), sin(t - 2.0*π/3.0)];
19           rgb = ([1.2, 1.2, 1.2] + rgb)/2.0;           rgb = ([1.7, 1.7, 1.7] + rgb)/2.7;
20           stabilize;           stabilize;
21        }        }
22        if (iter > maxiter) {        if (iter > maxiter) {
23             // no escape yet, seems to be in set, so color black
24           rgb = [0.0, 0.0, 0.0];           rgb = [0.0, 0.0, 0.0];
25           stabilize;           stabilize;
26        }        }
# Line 29  Line 28
28  }  }
29
30  // Strand initialization  // Strand initialization
31  initially [ mandel(crIdx, ciIdx) | ciIdx in 1..reso, crIdx in 1..reso ];  initially [ mandel([lerp(-2.0, 2.0, 1.0, real(crIdx), real(reso)),
32                        lerp(-2.0, 2.0, 1.0, real(ciIdx), real(reso))])
33                | ciIdx in 1..reso, crIdx in 1..reso ];

Legend:
 Removed from v.1894 changed lines Added in v.1897