surface st_pattern_lambert_texture(float Kd = 1, /* fake brightness */ wave_move = 4, /* [0 10] */ wave_freq = 3, /* [0 10]*/ wave_amp = 0.2, /* [0.1 0.5 0.005] */ circ_size = 0.01, arch_cont = 0.4, /* [0.0 1.0 0.1] */ arch1_ignore = 0, /* [0 or 1] */ arch2_ignore = 0, /* [0 or 1] */ arch3_ignore = 0, /* [0 or 1] */ cres_ignore = 0, /* [0 or 1] */ circ_ignore = 0, /* [0 or 1] */ squar_ignore = 0, /* [0 or 1] */ squar_size = 0, /* [0 0.7 0.05] */ bar1_move = 0, /* [-0.2 0.4 0.1] */ bar2_move = 0, /* [-0.2 0.6 0.1] */ bar3_move = 0, /* [-0.2 1 0.1] */ bar4_move = 0, /* [-0.2 1.2 0.1] */ bar5_move = 0, /* [-0.2 1.8 0.1] */ bar6_move = 0, /* [-0.2 2 0.1] */ wav_tp_mov = 0, /* [-1 1 0.2] */ wav_bm_mov = 0, /* [-1 1 0.2] */ tex_opac = 0.5; string tex_name = "bnw_grid.tex"; color arch = color (1,0.8,0), background = color (0.1, 0.2, 0.7)) { normal n = normalize(N); normal nf = faceforward(n, I); color surfcolor = background; color orng = color (0.8,sin(s),0); color blu2 = color (0,0,cos(t)); color diffuseColor = diffuse(nf) * Kd; // middle - bars if ((s + t - 0.8 - bar1_move) < 1 && (s + t - 0.6 - bar1_move) > 1) surfcolor = color (sin(s),0,0.2); if ((s + t - 0.6 - bar2_move) < 1 && (s + t - 0.4 - bar2_move) > 1) surfcolor = color (0.8,sin(t),0); if ((s + t - 0.2 - bar3_move) < 1 && (s + t + 0 - bar3_move) > 1) surfcolor = color (sin(s),0,0.2); if ((s + t + 0.2 - bar4_move) > 1 && (s + t + 0 - bar4_move) < 1) surfcolor = color (0.8,sin(t),0); if ((s + t + 0.8 - bar5_move) > 1 && (s + t + 0.6 - bar5_move) < 1) surfcolor = color (sin(s),0,0.2); if ((s + t + 1 - bar6_move) > 1 && (s + t + 0.8 - bar6_move) < 1) surfcolor = color (0.8,sin(t),0); // top left - cresent/ellipse if ((t+0.1)*(t+0.1)+(s+0.1)*(s-(0.2 + arch_cont)) < 0.15 && (t+0.1)*(t+0.1)+(s+0.1)*(s-(0.2 + arch_cont)) > 0.08) if(cres_ignore == 0) surfcolor = arch; // middle - wavy diagonal float wavy = sin(s * 2 * PI * wave_freq); wavy = ((wavy + wave_move) * 0.5); wavy = wavy * wave_amp; if (t + s < wavy + wav_tp_mov) surfcolor = orng; if (t - s > wavy + wav_bm_mov) surfcolor = orng; // top rigfht - arches if ((sqrt(s * s) - pow((t * t),1)) > .7) if (arch1_ignore == 0) surfcolor = color (0.7,0.2,0); if ((sqrt(s * s) - pow((t * t),1)) > .8) if (arch2_ignore == 0) surfcolor = color (0,0.2,0.6); if ((sqrt(s * s) - pow((t * t),1)) > .9) if (arch3_ignore == 0) surfcolor = color (0.6,0.2,0); // bottom left - square if (t >= (0.7 - squar_size) && s <= (0.3 + squar_size)) if (squar_ignore == 0) surfcolor = blu2; // bottom left - circle on square if ((t-0.85)*(t-0.85)+(s-0.15)*(s-0.15) < circ_size) if (circ_ignore == 0) surfcolor = color (0.8,cos(t),0); color texMp = color texture (tex_name, 1*t, (0.4*s + 0.8)); surfcolor = surfcolor - (texMp * tex_opac); Ci = Oi * Cs * surfcolor * diffuseColor; }