k3d/share/shaders/k3d_altitude_fog.sl:1:volume k3d_altitude_fog(
k3d/share/shaders/k3d_altitude_fog.sl:2:	float max_height = 1; 
k3d/share/shaders/k3d_altitude_fog.sl:3:	float min_height = 0;
k3d/share/shaders/k3d_altitude_fog.sl:7:	point PP = transform("world", P);
k3d/share/shaders/k3d_altitude_fog.sl:8:	float fog = 1 - smoothstep(min_height, max_height, ycomp(PP));
k3d/share/shaders/k3d_altitude_fog.sl:10:	Ci = mix(Ci, background, fog);
k3d/share/shaders/k3d_altitude_fog.sl:11:	Oi = mix(Oi, color(1, 1, 1), fog);
k3d/share/shaders/k3d_ambientlight.sl:1:/* ambientlight.sl - Standard ambient light source for RenderMan Interface.
k3d/share/shaders/k3d_ambientlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_ambientlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_ambientlight.sl:10:float intensity = 1;
k3d/share/shaders/k3d_antialiasedchecks.sl:2: * checks_aa.sl -- RenderMan compatible shader for checks.
k3d/share/shaders/k3d_antialiasedchecks.sl:5: *   Makes a checkered surface, fully antialiased!  This sucker should
k3d/share/shaders/k3d_antialiasedchecks.sl:11: *   frequency		determines the frequency (in s-t space) of the checks
k3d/share/shaders/k3d_antialiasedchecks.sl:19: * last modified 27 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_antialiasedchecks.sl:24:surface
k3d/share/shaders/k3d_antialiasedchecks.sl:26:float Ka = 1, Kd = 1, frequency = 10;
k3d/share/shaders/k3d_antialiasedchecks.sl:30:  point Nf;             /* Forward facing surface normal */
k3d/share/shaders/k3d_antialiasedchecks.sl:31:  float smod, tmod;     /* Texture position within the pattern */
k3d/share/shaders/k3d_antialiasedchecks.sl:32:  color checkcolor;     /* Color of the checks */
k3d/share/shaders/k3d_antialiasedchecks.sl:33:  float x, y;           /* Used to determine pattern */
k3d/share/shaders/k3d_antialiasedchecks.sl:34:  float swidth, twidth, sfuzz, tfuzz;  /* Antialiasing */
k3d/share/shaders/k3d_antialiasedchecks.sl:35:  float Nfactor;        /* Multiplicative factor for AA due to normal */
k3d/share/shaders/k3d_antialiasedchecks.sl:36:  float fuzzmax;        /* max of (sfuzz, tfuzz) */
k3d/share/shaders/k3d_antialiasedchecks.sl:38:  Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_antialiasedchecks.sl:44:  /* Figure out amount of fuzziness, taking normal into account */
k3d/share/shaders/k3d_antialiasedchecks.sl:45:  Nfactor = abs (Nf . I) / (length(Nf) * length(I));
k3d/share/shaders/k3d_antialiasedchecks.sl:46:  sfuzz = .5 * swidth * frequency / Nfactor;
k3d/share/shaders/k3d_antialiasedchecks.sl:47:  tfuzz = .5 * twidth * frequency / Nfactor;
k3d/share/shaders/k3d_antialiasedchecks.sl:48:  fuzzmax = max (sfuzz, tfuzz);
k3d/share/shaders/k3d_antialiasedchecks.sl:51:  smod = mod (s*frequency, 1);
k3d/share/shaders/k3d_antialiasedchecks.sl:52:  tmod = mod (t*frequency, 1);
k3d/share/shaders/k3d_antialiasedchecks.sl:54:  /* If the filter width is small enough, compute the pattern color */
k3d/share/shaders/k3d_antialiasedchecks.sl:55:  if (fuzzmax <= 0.5) {
k3d/share/shaders/k3d_antialiasedchecks.sl:56:      x = ((smoothstep (.5,.5+sfuzz,smod)) + (1 - smoothstep (0,sfuzz,smod)));
k3d/share/shaders/k3d_antialiasedchecks.sl:57:      y = ((smoothstep (.5,.5+tfuzz,tmod)) + (1 - smoothstep (0,tfuzz,tmod)));
k3d/share/shaders/k3d_antialiasedchecks.sl:59:      /* Gradually fade in the average color when we get close to the limit */
k3d/share/shaders/k3d_antialiasedchecks.sl:60:      Ci = mix (checkcolor, (color1+color2)/2, smoothstep (.125, .5, fuzzmax));
k3d/share/shaders/k3d_antialiasedchecks.sl:66:  /* Use the matte reflectance formula */
k3d/share/shaders/k3d_antialiasedchecks.sl:68:  Ci *= Os * (Ka*ambient() + Kd*diffuse(Nf));
k3d/share/shaders/k3d_arealight.sl:2: * arealight.sl - light source shader appropriate for an area light source.
k3d/share/shaders/k3d_arealight.sl:5: *   Makes light with cosine falloff from the normal of the light source
k3d/share/shaders/k3d_arealight.sl:6: *   surface.  This is perfect for using with area light sources.
k3d/share/shaders/k3d_arealight.sl:14:float intensity = 1; 
k3d/share/shaders/k3d_arealight.sl:18:#ifdef BMRT
k3d/share/shaders/k3d_arealight.sl:24:  /* This is so if we use one of these lights in PRMan, it will
k3d/share/shaders/k3d_arealight.sl:25:   * approximately work for a flat light source whose normal points
k3d/share/shaders/k3d_arealight.sl:33:#endif
k3d/share/shaders/k3d_background.sl:6:// This program is free software; you can redistribute it and/or
k3d/share/shaders/k3d_background.sl:7:// modify it under the terms of the GNU General Public
k3d/share/shaders/k3d_background.sl:8:// License as published by the Free Software Foundation; either
k3d/share/shaders/k3d_background.sl:9:// version 2 of the License, or (at your option) any later version.
k3d/share/shaders/k3d_background.sl:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_background.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_background.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_background.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_background.sl:17:// License along with this program; if not, write to the Free Software
k3d/share/shaders/k3d_background.sl:20:/** \file
k3d/share/shaders/k3d_background.sl:24:/// Simplified from the original by Larry Gritz
k3d/share/shaders/k3d_bluemarble.sl:16:#define PALE_BLUE        color (0.25, 0.25, 0.35)
k3d/share/shaders/k3d_bluemarble.sl:17:#define MEDIUM_BLUE      color (0.10, 0.10, 0.30)
k3d/share/shaders/k3d_bluemarble.sl:18:#define DARK_BLUE        color (0.05, 0.05, 0.26)
k3d/share/shaders/k3d_bluemarble.sl:19:#define DARKER_BLUE      color (0.03, 0.03, 0.20)
k3d/share/shaders/k3d_bluemarble.sl:20:#define NNOISE           4
k3d/share/shaders/k3d_bluemarble.sl:23:marble_color(float m)
k3d/share/shaders/k3d_bluemarble.sl:35:surface
k3d/share/shaders/k3d_bluemarble.sl:37:    uniform float Ka = 1;
k3d/share/shaders/k3d_bluemarble.sl:38:    uniform float Kd = 0.8;
k3d/share/shaders/k3d_bluemarble.sl:39:    uniform float Ks = 0.2;
k3d/share/shaders/k3d_bluemarble.sl:40:    uniform float texturescale = 2.5;
k3d/share/shaders/k3d_bluemarble.sl:41:    uniform float roughness = 0.1;
k3d/share/shaders/k3d_bluemarble.sl:47:    float i, f, marble;
k3d/share/shaders/k3d_bluemarble.sl:49:    NN = normalize(faceforward(N, I));
k3d/share/shaders/k3d_bluemarble.sl:50:    PP = transform("shader", P) * texturescale;
k3d/share/shaders/k3d_bluemarble.sl:52:    marble = 0; f = 1;
k3d/share/shaders/k3d_bluemarble.sl:53:    for (i = 0; i < NNOISE; i += 1) {
k3d/share/shaders/k3d_bluemarble.sl:54:        marble += snoise(PP * f)/f;
k3d/share/shaders/k3d_bluemarble.sl:55:        f *= 2.17;
k3d/share/shaders/k3d_bluemarble.sl:59:    Ci = Os * (Ct * (Ka * ambient() + Kd * diffuse(NN))
k3d/share/shaders/k3d_bluescreen.sl:6: *   background - the color of the background
k3d/share/shaders/k3d_bluescreen.sl:15:float resolution[3];
k3d/share/shaders/k3d_bluescreen.sl:16:float lenx, leny;
k3d/share/shaders/k3d_bluescreen.sl:19:    if (option("Format", resolution) == 1.0) {
k3d/share/shaders/k3d_bluescreen.sl:24:    if (texturename != "") {
k3d/share/shaders/k3d_brick.sl:2: * brick.sl -- Surface shader for a bricks.
k3d/share/shaders/k3d_brick.sl:5: *   Makes a wall of bricks.  Need more be said?  OK.  It makes a good
k3d/share/shaders/k3d_brick.sl:8: *   identical parameters).  Every other row of bricks is staggered.
k3d/share/shaders/k3d_brick.sl:14: *    brickcolor, mortarcolor	Pretty obvious (default is red bricks)
k3d/share/shaders/k3d_brick.sl:15: *    brickvary                 How much does the brick color vary from
k3d/share/shaders/k3d_brick.sl:17: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brick.sl:18: *    brickheight               Height of a brick (in st space)
k3d/share/shaders/k3d_brick.sl:19: *    mortarthickness           Thickness of the mortar (in st space)
k3d/share/shaders/k3d_brick.sl:20: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brick.sl:21: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brick.sl:29:surface k3d_brick(
k3d/share/shaders/k3d_brick.sl:30:float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_brick.sl:33:		  float raggedamp = 0.04, raggedfreq = 12;
k3d/share/shaders/k3d_brick.sl:34:		  float jagged = 0.006, brickvary = 0.3;
k3d/share/shaders/k3d_brick.sl:35:		  float brickwidth = .28, brickheight = .07;
k3d/share/shaders/k3d_brick.sl:36:		  float mortarthickness = .014;
k3d/share/shaders/k3d_brick.sl:37:		  float rowvary = .5;
k3d/share/shaders/k3d_brick.sl:38:		  float pitting = 0.01;
k3d/share/shaders/k3d_brick.sl:39:		  float pockfrequency = 10, groovedepth = 0.01;
k3d/share/shaders/k3d_brick.sl:42:#define sqr(x) ((x)*(x))
k3d/share/shaders/k3d_brick.sl:44:  normal Nf;
k3d/share/shaders/k3d_brick.sl:45:  float sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brick.sl:46:  float ss, tt;
k3d/share/shaders/k3d_brick.sl:47:  float swidth, twidth;
k3d/share/shaders/k3d_brick.sl:48:  uniform float BMWIDTH = (brickwidth + mortarthickness);
k3d/share/shaders/k3d_brick.sl:49:  uniform float BMHEIGHT = (brickheight + mortarthickness);
k3d/share/shaders/k3d_brick.sl:50:  uniform float MWF = (mortarthickness * 0.5 / BMWIDTH);
k3d/share/shaders/k3d_brick.sl:51:  uniform float MHF = (mortarthickness * 0.5 / BMHEIGHT);
k3d/share/shaders/k3d_brick.sl:52:  float whichbrick;
k3d/share/shaders/k3d_brick.sl:53:  float fact, disp;
k3d/share/shaders/k3d_brick.sl:56:   * the the width and height of a brick.  Overestimate the filter
k3d/share/shaders/k3d_brick.sl:60:  swidth = 1.5 * max(filterwidth(s), MINFILTWIDTH) / BMWIDTH;
k3d/share/shaders/k3d_brick.sl:61:  twidth = 1.5 * max(filterwidth(t), MINFILTWIDTH) / BMHEIGHT;
k3d/share/shaders/k3d_brick.sl:66:  /* Make the edges ragged, but different for each brick */
k3d/share/shaders/k3d_brick.sl:69:    raggedamp * snoisexy((s + tbrick * 5.15) * raggedfreq,
k3d/share/shaders/k3d_brick.sl:70:			 (t + sbrick * 23.8) * raggedfreq);
k3d/share/shaders/k3d_brick.sl:72:    raggedamp * snoisexy((s + tbrick * 11.4) * raggedfreq,
k3d/share/shaders/k3d_brick.sl:73:			 (t + sbrick * 7.2) * raggedfreq);
k3d/share/shaders/k3d_brick.sl:75:    raggedamp / 2 * snoisexy((s + tbrick * 5.15) * raggedfreq * 2,
k3d/share/shaders/k3d_brick.sl:76:			     (t + sbrick * 23.8) * raggedfreq * 2);
k3d/share/shaders/k3d_brick.sl:78:    raggedamp / 2 * snoisexy((s + tbrick * 11.4) * raggedfreq * 2,
k3d/share/shaders/k3d_brick.sl:79:			     (t + sbrick * 7.2) * raggedfreq * 2);
k3d/share/shaders/k3d_brick.sl:81:  /* Choose a color for the surface */
k3d/share/shaders/k3d_brick.sl:82:  if(swidth >= 1)
k3d/share/shaders/k3d_brick.sl:86:      clamp(filteredpulse(MWF, 1 - MWF, ss, swidth), max(1 - MWF / swidth, 0),
k3d/share/shaders/k3d_brick.sl:88:  if(twidth >= 1)
k3d/share/shaders/k3d_brick.sl:92:      clamp(filteredpulse(MHF, 1 - MHF, tt, twidth), max(1 - MHF / twidth, 0),
k3d/share/shaders/k3d_brick.sl:95:  fact = 1;
k3d/share/shaders/k3d_brick.sl:97:  if(tt < MHF)
k3d/share/shaders/k3d_brick.sl:102:  else if(tt > (1.0 - MHF))
k3d/share/shaders/k3d_brick.sl:107:  if(ss < MWF)
k3d/share/shaders/k3d_brick.sl:111:  else if(ss > (1.0 - MWF))
k3d/share/shaders/k3d_brick.sl:116:  fact = smoothstep(0, 1.3 * MHF, tt) - smoothstep(1.0 - 1.3 * MHF, 1, tt);
k3d/share/shaders/k3d_brick.sl:117:  fact *= (smoothstep(0, 1.3 * MWF, ss) - smoothstep(1.0 - 1.3 * MWF, 1, ss));
k3d/share/shaders/k3d_brick.sl:118:  fact = pitting * (0.5 * fact + 0.5);
k3d/share/shaders/k3d_brick.sl:120:    fact *
k3d/share/shaders/k3d_brick.sl:122:	((ss + sbrick) * pockfrequency / BMHEIGHT,
k3d/share/shaders/k3d_brick.sl:123:	 (tt + tbrick) * pockfrequency / BMWIDTH), 0.25);
k3d/share/shaders/k3d_brick.sl:127:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_brick.sl:130:  /* Choose a brick color that varies from brick to brick */
k3d/share/shaders/k3d_brick.sl:136:  Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brick2.sl:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brick2.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brick2.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brick2.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brick2.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brick2.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brick2.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brick2.sl:25:surface
k3d/share/shaders/k3d_brick2.sl:27:    uniform float Ka = 1;
k3d/share/shaders/k3d_brick2.sl:28:    uniform float Kd = 1;
k3d/share/shaders/k3d_brick2.sl:29:    uniform color Cbrick = color (0.5, 0.15, 0.14);
k3d/share/shaders/k3d_brick2.sl:30:    uniform color Cmortar = color (0.5, 0.5, 0.5);
k3d/share/shaders/k3d_brick2.sl:34:    point Nf;
k3d/share/shaders/k3d_brick2.sl:35:    float ss, tt, sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brick2.sl:36:    float scoord = s;
k3d/share/shaders/k3d_brick2.sl:37:    float tcoord = t;
k3d/share/shaders/k3d_brick2.sl:39:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brick2.sl:44:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brick2.sl:45:        ss += 0.5;  /* shift alternate rows */
k3d/share/shaders/k3d_brick2.sl:46:    sbrick = floor(ss); /* which brick? */
k3d/share/shaders/k3d_brick2.sl:47:    tbrick = floor(tt); /* which brick? */
k3d/share/shaders/k3d_brick2.sl:55:    /* diffuse reflection model */
k3d/share/shaders/k3d_brick2.sl:57:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brick3.sl:2: * brick.sl -- Surface shader for a bricks.
k3d/share/shaders/k3d_brick3.sl:5: *   Makes a wall of bricks.  Need more be said?  OK.  It makes a good
k3d/share/shaders/k3d_brick3.sl:8: *   identical parameters).  Every other row of bricks is staggered.
k3d/share/shaders/k3d_brick3.sl:14: *    brickcolor, mortarcolor	Pretty obvious (default is red bricks)
k3d/share/shaders/k3d_brick3.sl:15: *    brickvary                 How much does the brick color vary from
k3d/share/shaders/k3d_brick3.sl:17: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brick3.sl:18: *    brickheight               Height of a brick (in st space)
k3d/share/shaders/k3d_brick3.sl:19: *    mortarthickness           Thickness of the mortar (in st space)
k3d/share/shaders/k3d_brick3.sl:20: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brick3.sl:21: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brick3.sl:29: *      28 May 1992 -- written by lg for the "Timbre Trees" video (saucer)
k3d/share/shaders/k3d_brick3.sl:32: * last modified  12 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_brick3.sl:37:surface
k3d/share/shaders/k3d_brick3.sl:39:float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_brick3.sl:42:        float jagged = 0.006, brickvary = 0.3;
k3d/share/shaders/k3d_brick3.sl:43:        float brickwidth = .25, brickheight = .08;
k3d/share/shaders/k3d_brick3.sl:44:        float mortarthickness = .01;
k3d/share/shaders/k3d_brick3.sl:45:        float rowvary = .25; 
k3d/share/shaders/k3d_brick3.sl:48:#define BMWIDTH (brickwidth+mortarthickness)
k3d/share/shaders/k3d_brick3.sl:49:#define BMHEIGHT (brickheight+mortarthickness)
k3d/share/shaders/k3d_brick3.sl:50:#define MWF (mortarthickness*0.5/BMWIDTH)
k3d/share/shaders/k3d_brick3.sl:51:#define MHF (mortarthickness*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brick3.sl:52:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_brick3.sl:53:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_brick3.sl:54:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_brick3.sl:56:  point PP2, Nf;
k3d/share/shaders/k3d_brick3.sl:57:  float sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brick3.sl:58:  float scoord, tcoord, ss, tt;
k3d/share/shaders/k3d_brick3.sl:59:  float swidth, twidth;
k3d/share/shaders/k3d_brick3.sl:60:  float Nfactor;
k3d/share/shaders/k3d_brick3.sl:66:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_brick3.sl:68:  /* Make the shapes of the bricks vary just a bit */
k3d/share/shaders/k3d_brick3.sl:78:  /* shift alternate rows */
k3d/share/shaders/k3d_brick3.sl:79:  if (mod (tt*0.5, 1) > 0.5)
k3d/share/shaders/k3d_brick3.sl:82:  tbrick = floor (tt);   /* which brick row? */
k3d/share/shaders/k3d_brick3.sl:83:  /* Shift the columns randomly by row */
k3d/share/shaders/k3d_brick3.sl:86:  sbrick = floor (ss);   /* which brick column? */
k3d/share/shaders/k3d_brick3.sl:90:  /* Choose a color for the surface */
k3d/share/shaders/k3d_brick3.sl:91:  if (swidth >= 1)
k3d/share/shaders/k3d_brick3.sl:96:  if (twidth >= 1)
k3d/share/shaders/k3d_brick3.sl:101:  /* Choose a brick color that varies from brick to brick */
k3d/share/shaders/k3d_brick3.sl:107:  Ci = Os * Ct * (Ka * ambient() + Kd*diffuse(Nf));
k3d/share/shaders/k3d_brickanti.sl:17:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickanti.sl:18:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickanti.sl:19:#define MORTARTHICKNESS 0.02
k3d/share/shaders/k3d_brickanti.sl:21:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickanti.sl:22:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickanti.sl:23:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickanti.sl:24:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickanti.sl:26:surface
k3d/share/shaders/k3d_brickanti.sl:28:    uniform float Ka = 1;
k3d/share/shaders/k3d_brickanti.sl:29:    uniform float Kd = 1;
k3d/share/shaders/k3d_brickanti.sl:30:    uniform color Cbrick = color (0.5, 0.15, 0.14);
k3d/share/shaders/k3d_brickanti.sl:31:    uniform color Cmortar = color (0.5, 0.5, 0.5);
k3d/share/shaders/k3d_brickanti.sl:35:    point Nf;
k3d/share/shaders/k3d_brickanti.sl:36:    float ss, tt, sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brickanti.sl:37:    float scoord = s;
k3d/share/shaders/k3d_brickanti.sl:38:    float tcoord = t;
k3d/share/shaders/k3d_brickanti.sl:39:    float swidth, twidth;
k3d/share/shaders/k3d_brickanti.sl:41:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickanti.sl:46:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickanti.sl:47:        ss += 0.5;  /* shift alternate rows */
k3d/share/shaders/k3d_brickanti.sl:51:    tbrick = floor(tt); /* which brick? */
k3d/share/shaders/k3d_brickanti.sl:52:    sbrick = floor(ss); /* which brick? */
k3d/share/shaders/k3d_brickanti.sl:54:#if 0
k3d/share/shaders/k3d_brickanti.sl:65:    /* This is the preferred antialiasing using integrals. */
k3d/share/shaders/k3d_brickanti.sl:66:#define frac(x)        mod((x),1)
k3d/share/shaders/k3d_brickanti.sl:67:#define sintegral(ss)  (floor(ss)*(1-2*MWF) + \
k3d/share/shaders/k3d_brickanti.sl:68:                        max(0,frac(ss)-MWF))
k3d/share/shaders/k3d_brickanti.sl:69:#define tintegral(tt)  (floor(tt)*(1-2*MHF) + \
k3d/share/shaders/k3d_brickanti.sl:70:                        max(0,frac(tt)-MHF))
k3d/share/shaders/k3d_brickanti.sl:74:#endif
k3d/share/shaders/k3d_brickanti.sl:78:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickanti.sl:80:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brickbump.sl:2: * brickbump.sl -- displacement shader for bricks.
k3d/share/shaders/k3d_brickbump.sl:5: *   Makes displacements for a wall of bricks.  This is the companion
k3d/share/shaders/k3d_brickbump.sl:6: *   shader to the surface "brick" shader.  The parameters work exactly
k3d/share/shaders/k3d_brickbump.sl:7: *   the same.  Of course, you can use it with any surface shader, and
k3d/share/shaders/k3d_brickbump.sl:8: *   in fact matte or plastic gives those nice white cinder block walls.
k3d/share/shaders/k3d_brickbump.sl:9: *   However, if you do use it with "brick", the parameters MUST match,
k3d/share/shaders/k3d_brickbump.sl:13: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brickbump.sl:14: *    brickheight               Height of a brick (in st space)
k3d/share/shaders/k3d_brickbump.sl:15: *    mortarthickness           Thickness of the mortar (in st space)
k3d/share/shaders/k3d_brickbump.sl:16: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brickbump.sl:17: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brickbump.sl:18: *    pitting                   The amplitude of the "pits" on the face of
k3d/share/shaders/k3d_brickbump.sl:20: *    pockfrequency             The st frequency of the pits.
k3d/share/shaders/k3d_brickbump.sl:21: *    groovedepth               The depth of the grooves between bricks.
k3d/share/shaders/k3d_brickbump.sl:23: * AUTHOR: written by Larry Gritz, 1992 (and subsequently modified)
k3d/share/shaders/k3d_brickbump.sl:30:float jagged = 0.006;
k3d/share/shaders/k3d_brickbump.sl:31:			   float brickwidth = .25, brickheight = .08;
k3d/share/shaders/k3d_brickbump.sl:32:			   float mortarthickness = .01;
k3d/share/shaders/k3d_brickbump.sl:33:			   float rowvary = .25, pitting = 0.01;
k3d/share/shaders/k3d_brickbump.sl:34:			   float pockfrequency = 10, groovedepth = 0.01;
k3d/share/shaders/k3d_brickbump.sl:37:#define sqr(x) ((x)*(x))
k3d/share/shaders/k3d_brickbump.sl:38:  float sbrick, tbrick;
k3d/share/shaders/k3d_brickbump.sl:39:  float ss, tt;
k3d/share/shaders/k3d_brickbump.sl:40:  float fact, disp;
k3d/share/shaders/k3d_brickbump.sl:41:  uniform float BMWIDTH = (brickwidth + mortarthickness);
k3d/share/shaders/k3d_brickbump.sl:42:  uniform float BMHEIGHT = (brickheight + mortarthickness);
k3d/share/shaders/k3d_brickbump.sl:43:  uniform float MWF = (mortarthickness * 0.5 / BMWIDTH);
k3d/share/shaders/k3d_brickbump.sl:44:  uniform float MHF = (mortarthickness * 0.5 / BMHEIGHT);
k3d/share/shaders/k3d_brickbump.sl:49:  fact = 1;
k3d/share/shaders/k3d_brickbump.sl:51:  if(tt < MHF)
k3d/share/shaders/k3d_brickbump.sl:56:  else if(tt > (1.0 - MHF))
k3d/share/shaders/k3d_brickbump.sl:61:  if(ss < MWF)
k3d/share/shaders/k3d_brickbump.sl:65:  else if(ss > (1.0 - MWF))
k3d/share/shaders/k3d_brickbump.sl:70:  fact = smoothstep(0, 1.3 * MHF, tt) - smoothstep(1.0 - 1.3 * MHF, 1, tt);
k3d/share/shaders/k3d_brickbump.sl:71:  fact *= (smoothstep(0, 1.3 * MWF, ss) - smoothstep(1.0 - 1.3 * MWF, 1, ss));
k3d/share/shaders/k3d_brickbump.sl:72:  fact = pitting * (0.75 * fact + 0.25);
k3d/share/shaders/k3d_brickbump.sl:74:    fact *
k3d/share/shaders/k3d_brickbump.sl:76:	((ss + sbrick) * pockfrequency / BMHEIGHT,
k3d/share/shaders/k3d_brickbump.sl:77:	 (tt + tbrick) * pockfrequency / BMWIDTH), 0.25);
k3d/share/shaders/k3d_brickbump2.sl:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickbump2.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickbump2.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brickbump2.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickbump2.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickbump2.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickbump2.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickbump2.sl:25:surface
k3d/share/shaders/k3d_brickbump2.sl:27:    uniform float Ka = 1;
k3d/share/shaders/k3d_brickbump2.sl:28:    uniform float Kd = 1;
k3d/share/shaders/k3d_brickbump2.sl:29:    uniform color Cbrick = color (0.5, 0.15, 0.14);
k3d/share/shaders/k3d_brickbump2.sl:30:    uniform color Cmortar = color (0.5, 0.5, 0.5);
k3d/share/shaders/k3d_brickbump2.sl:34:    point Nf;
k3d/share/shaders/k3d_brickbump2.sl:35:    float ss, tt, sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brickbump2.sl:36:    float scoord = s;
k3d/share/shaders/k3d_brickbump2.sl:37:    float tcoord = t;
k3d/share/shaders/k3d_brickbump2.sl:38:    float sbump, tbump, stbump;
k3d/share/shaders/k3d_brickbump2.sl:40:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickbump2.sl:45:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickbump2.sl:46:        ss += 0.5;  /* shift alternate rows */
k3d/share/shaders/k3d_brickbump2.sl:47:    sbrick = floor(ss); /* which brick? */
k3d/share/shaders/k3d_brickbump2.sl:48:    tbrick = floor(tt); /* which brick? */
k3d/share/shaders/k3d_brickbump2.sl:56:    /* compute bump-mapping function for mortar grooves */
k3d/share/shaders/k3d_brickbump2.sl:62:    Nf = calculatenormal(P + normalize(N) * stbump);
k3d/share/shaders/k3d_brickbump2.sl:63:    Nf = normalize(faceforward(Nf, I));
k3d/share/shaders/k3d_brickbump2.sl:65:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickbump2.sl:67:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brickbump3.sl:2: * brickbump.sl -- displacement shader for bricks.
k3d/share/shaders/k3d_brickbump3.sl:5: *   Makes displacements for a wall of bricks.  This is the companion
k3d/share/shaders/k3d_brickbump3.sl:6: *   shader to the surface "brick" shader.  The parameters work exactly
k3d/share/shaders/k3d_brickbump3.sl:7: *   the same.  Of course, you can use it with any surface shader, and
k3d/share/shaders/k3d_brickbump3.sl:8: *   in fact matte or plastic gives those nice white cinder block walls.
k3d/share/shaders/k3d_brickbump3.sl:9: *   However, if you do use it with "brick", the parameters MUST match,
k3d/share/shaders/k3d_brickbump3.sl:13: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brickbump3.sl:14: *    brickheight               Height of a brick (in st space)
k3d/share/shaders/k3d_brickbump3.sl:15: *    mortarthickness           Thickness of the mortar (in st space)
k3d/share/shaders/k3d_brickbump3.sl:16: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brickbump3.sl:17: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brickbump3.sl:18: *    pitting                   The amplitude of the "pits" on the face of
k3d/share/shaders/k3d_brickbump3.sl:20: *    pockfrequency             The st frequency of the pits.
k3d/share/shaders/k3d_brickbump3.sl:21: *    groovedepth               The depth of the grooves between bricks.
k3d/share/shaders/k3d_brickbump3.sl:26: *      28 May 1992 -- written by lg for the "Timbre Trees" video (saucer)
k3d/share/shaders/k3d_brickbump3.sl:29: * last modified  12 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_brickbump3.sl:32:/* note from Larry:
k3d/share/shaders/k3d_brickbump3.sl:37:  displacement shader with the matte surface shader.  With appropriate
k3d/share/shaders/k3d_brickbump3.sl:40:  ~gritz/brick.tif.
k3d/share/shaders/k3d_brickbump3.sl:42:  I think good parameters for this look are:
k3d/share/shaders/k3d_brickbump3.sl:45:	       "mortarthickness" 0.02 "pitting" 0.015 "pockfrequency" 12
k3d/share/shaders/k3d_brickbump3.sl:51:float jagged = 0.006;
k3d/share/shaders/k3d_brickbump3.sl:52:            float brickwidth = .25, brickheight = .08;
k3d/share/shaders/k3d_brickbump3.sl:53:	    float mortarthickness = .01;
k3d/share/shaders/k3d_brickbump3.sl:54:	    float rowvary = .25, pitting = 0.01;
k3d/share/shaders/k3d_brickbump3.sl:55:	    float pockfrequency = 10, groovedepth = 0.01; 
k3d/share/shaders/k3d_brickbump3.sl:58:#define BMWIDTH (brickwidth+mortarthickness)
k3d/share/shaders/k3d_brickbump3.sl:59:#define BMHEIGHT (brickheight+mortarthickness)
k3d/share/shaders/k3d_brickbump3.sl:60:#define MWF (mortarthickness*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickbump3.sl:61:#define MHF (mortarthickness*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickbump3.sl:62:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_brickbump3.sl:63:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_brickbump3.sl:64:#define sqr(x) ((x)*(x))
k3d/share/shaders/k3d_brickbump3.sl:66:  float sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brickbump3.sl:67:  float scoord, tcoord, ss, tt;
k3d/share/shaders/k3d_brickbump3.sl:68:  float fact, disp;
k3d/share/shaders/k3d_brickbump3.sl:72:  /* Make the shapes of the bricks vary just a bit */
k3d/share/shaders/k3d_brickbump3.sl:80:  /* shift alternate rows */
k3d/share/shaders/k3d_brickbump3.sl:81:  if (mod (tt*0.5, 1) > 0.5)
k3d/share/shaders/k3d_brickbump3.sl:84:  tbrick = floor (tt);   /* which brick row? */
k3d/share/shaders/k3d_brickbump3.sl:85:  /* Shift the columns randomly by row */
k3d/share/shaders/k3d_brickbump3.sl:88:  sbrick = floor (ss);   /* which brick column? */
k3d/share/shaders/k3d_brickbump3.sl:92:  fact = 1;
k3d/share/shaders/k3d_brickbump3.sl:94:  if (tt < MHF) {
k3d/share/shaders/k3d_brickbump3.sl:98:  if (tt > (1.0-MHF)) {
k3d/share/shaders/k3d_brickbump3.sl:102:  if (ss < MWF) {
k3d/share/shaders/k3d_brickbump3.sl:105:  if (ss > (1.0-MWF)) {
k3d/share/shaders/k3d_brickbump3.sl:109:  fact = smoothstep (0, 1.3*MHF, tt) - smoothstep (1.0-1.3*MHF, 1, tt);
k3d/share/shaders/k3d_brickbump3.sl:110:  fact *= (smoothstep (0, 1.3*MWF, ss) - smoothstep (1.0-1.3*MWF, 1, ss));
k3d/share/shaders/k3d_brickbump3.sl:111:  fact = pitting * (0.75 * fact + 0.25);
k3d/share/shaders/k3d_brickbump3.sl:112:  disp -= fact * pow(noise ((ss+sbrick)*pockfrequency/BMHEIGHT,
k3d/share/shaders/k3d_brickbump3.sl:113:		            (tt+tbrick)*pockfrequency/BMWIDTH), 0.25);
k3d/share/shaders/k3d_brickperturb.sl:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickperturb.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickperturb.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brickperturb.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickperturb.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickperturb.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickperturb.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickperturb.sl:25:surface
k3d/share/shaders/k3d_brickperturb.sl:27:    uniform float Ka = 1;
k3d/share/shaders/k3d_brickperturb.sl:28:    uniform float Kd = 1;
k3d/share/shaders/k3d_brickperturb.sl:29:    uniform color Cbrick = color (0.5, 0.15, 0.14);
k3d/share/shaders/k3d_brickperturb.sl:30:    uniform color Cmortar = color (0.5, 0.5, 0.5);
k3d/share/shaders/k3d_brickperturb.sl:34:    point Nf;
k3d/share/shaders/k3d_brickperturb.sl:35:    float ss, tt, sbrick, tbrick, w, h;
k3d/share/shaders/k3d_brickperturb.sl:36:    float scoord = s;
k3d/share/shaders/k3d_brickperturb.sl:37:    float tcoord = t;
k3d/share/shaders/k3d_brickperturb.sl:39:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickperturb.sl:44:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickperturb.sl:45:        ss += 0.5;  /* shift alternate rows */
k3d/share/shaders/k3d_brickperturb.sl:46:    tbrick = floor(tt); /* which brick? */
k3d/share/shaders/k3d_brickperturb.sl:48:    sbrick = floor(ss); /* which brick? */
k3d/share/shaders/k3d_brickperturb.sl:56:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickperturb.sl:58:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brushedmetal.sl:9: *   uroughness, vroughness - separate roughnesses for u and v directions
k3d/share/shaders/k3d_brushedmetal.sl:13: * Reference:
k3d/share/shaders/k3d_brushedmetal.sl:14: *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
k3d/share/shaders/k3d_brushedmetal.sl:15: *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
k3d/share/shaders/k3d_brushedmetal.sl:20:surface k3d_brushedmetal(
k3d/share/shaders/k3d_brushedmetal.sl:21:float Ka = 1, Kd = 0.1, Ks = .9;
k3d/share/shaders/k3d_brushedmetal.sl:22:			 float uroughness = 0.15, vroughness = 0.5;
k3d/share/shaders/k3d_brushedmetal.sl:25:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_brushedmetal.sl:27:    MaterialBrushedMetal(Nf, Cs, Ka, Kd, Ks, normalize(dPdu), uroughness,
k3d/share/shaders/k3d_brushedmetal2.sl:1:/*  IDbrushedmetal.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_brushedmetal2.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_brushedmetal2.sl:4: *  in any way you see fit, but please leave my name near the top
k3d/share/shaders/k3d_brushedmetal2.sl:7: *  highlight, and also can use a reflection map.
k3d/share/shaders/k3d_brushedmetal2.sl:11: *  if you set Kr = 0 and specwidth = 10
k3d/share/shaders/k3d_brushedmetal2.sl:16: *  Ks			- coefficient of specular
k3d/share/shaders/k3d_brushedmetal2.sl:17: *  Kd			- coefficient of diffuse
k3d/share/shaders/k3d_brushedmetal2.sl:18: *  Ka			- coefficient of ambient
k3d/share/shaders/k3d_brushedmetal2.sl:19: *  Kr			- coefficient of reflectivity
k3d/share/shaders/k3d_brushedmetal2.sl:20: *  specwidth		- the width of the specular stripe
k3d/share/shaders/k3d_brushedmetal2.sl:22: *  specspread		- the spread of the specular stripe
k3d/share/shaders/k3d_brushedmetal2.sl:24: *  mapspread		- the spread of the image streaking
k3d/share/shaders/k3d_brushedmetal2.sl:26: *  twist		- allows you to twist the direction of anisotropy
k3d/share/shaders/k3d_brushedmetal2.sl:28: *  mapname		- name of the environment map
k3d/share/shaders/k3d_brushedmetal2.sl:29: *  specularcolor	- color of the specular hilight
k3d/share/shaders/k3d_brushedmetal2.sl:33:anisospecular (vector VA; float specspread; float specwidth)
k3d/share/shaders/k3d_brushedmetal2.sl:40:    float nonspec;
k3d/share/shaders/k3d_brushedmetal2.sl:43:    normal Nf = faceforward(NN,-V);
k3d/share/shaders/k3d_brushedmetal2.sl:44:    color pixbrdf, C = 0;
k3d/share/shaders/k3d_brushedmetal2.sl:47:    illuminance (P, Nf, PI*.5) {
k3d/share/shaders/k3d_brushedmetal2.sl:53:        if (nonspec < 1) {
k3d/share/shaders/k3d_brushedmetal2.sl:57:	    pixbrdf  = specularbrdf(LN, Nf,V,specspread);
k3d/share/shaders/k3d_brushedmetal2.sl:58:            C += Cl * pixbrdf * pow( 1-abs(VA.H), 1/specwidth );
k3d/share/shaders/k3d_brushedmetal2.sl:64:surface
k3d/share/shaders/k3d_brushedmetal2.sl:66:	float	Ks		=  1,
k3d/share/shaders/k3d_brushedmetal2.sl:77:	point Po = transform("object",P);
k3d/share/shaders/k3d_brushedmetal2.sl:80:	vector Nf, Ntmp;
k3d/share/shaders/k3d_brushedmetal2.sl:82:	float i, numsamples = 20;
k3d/share/shaders/k3d_brushedmetal2.sl:83:	float angle, jitter;
k3d/share/shaders/k3d_brushedmetal2.sl:84:	float Jspread = PI*(1/numsamples)*mapspread;
k3d/share/shaders/k3d_brushedmetal2.sl:88:	Nf = faceforward(normalize(N), -I);
k3d/share/shaders/k3d_brushedmetal2.sl:89:        Ntmp = Nf;
k3d/share/shaders/k3d_brushedmetal2.sl:91:	if( mapname != "" ) {
k3d/share/shaders/k3d_brushedmetal2.sl:92:	    for(i=0;i<=numsamples;i=i+1){
k3d/share/shaders/k3d_brushedmetal2.sl:95:	      Ntmp = rotate(Nf,angle+jitter,zro,VA);
k3d/share/shaders/k3d_brushedmetal2.sl:96:	      D = reflect(-V, Ntmp);
k3d/share/shaders/k3d_brushedmetal2.sl:97:	      D = vtransform("world", D);
k3d/share/shaders/k3d_brushedmetal2.sl:104:	Ci = Oi * (Cs * (Ka * ambient() + Kd * diffuse(-Nf)) + 
k3d/share/shaders/k3d_brushedmetal3.sl:1:/* Renamed to LGbrushedmetal for RMR -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brushedmetal3.sl:5: * The derivation and formulae can be found in:  Ward, Gregory J.
k3d/share/shaders/k3d_brushedmetal3.sl:6: * "Measuring and Modeling Anisotropic Reflection," ACM Computer
k3d/share/shaders/k3d_brushedmetal3.sl:7: * Graphics 26(2) (Proceedings of Siggraph '92), pp. 265-272, July, 1992.
k3d/share/shaders/k3d_brushedmetal3.sl:9: *   N - unit surface normal
k3d/share/shaders/k3d_brushedmetal3.sl:10: *   V - unit viewing direction (from P toward the camera)
k3d/share/shaders/k3d_brushedmetal3.sl:11: *   xdir - a unit tangent of the surface which defines the reference
k3d/share/shaders/k3d_brushedmetal3.sl:12: *          direction for the anisotropy.
k3d/share/shaders/k3d_brushedmetal3.sl:13: *   xroughness - the apparent roughness of the surface in xdir.
k3d/share/shaders/k3d_brushedmetal3.sl:14: *   yroughness - the roughness for the direction of the surface
k3d/share/shaders/k3d_brushedmetal3.sl:19:                         vector xdir;  float xroughness, yroughness;)
k3d/share/shaders/k3d_brushedmetal3.sl:21:    float sqr (float x) { return x*x; }
k3d/share/shaders/k3d_brushedmetal3.sl:23:    float cos_theta_r = clamp (N.V, 0.0001, 1);
k3d/share/shaders/k3d_brushedmetal3.sl:30:        /* Must declare because extern L & Cl because we're in a function */
k3d/share/shaders/k3d_brushedmetal3.sl:32:        float nonspec = 0;
k3d/share/shaders/k3d_brushedmetal3.sl:34:        if (nonspec < 1) {
k3d/share/shaders/k3d_brushedmetal3.sl:36:            float cos_theta_i = LN . N;
k3d/share/shaders/k3d_brushedmetal3.sl:37:            if (cos_theta_i > 0.0) {
k3d/share/shaders/k3d_brushedmetal3.sl:39:                float rho = exp (-2 * (sqr(X.H) + sqr(Y.H)) / (1 + H.N))
k3d/share/shaders/k3d_brushedmetal3.sl:50:surface
k3d/share/shaders/k3d_brushedmetal3.sl:52:float Ka = 1, Kd = 0.1, Ks = .9;
k3d/share/shaders/k3d_brushedmetal3.sl:53:		float uroughness = 0.35, vroughness = 0.2; 
k3d/share/shaders/k3d_brushedmetal3.sl:57:    normal Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_brushedmetal3.sl:60:    color spec = LocIllumWardAnisotropic (Nf, -normalize(I),
k3d/share/shaders/k3d_brushedmetal3.sl:62:    Ci = basecolor * (Ka*ambient() + Kd*diffuse(Nf) + Ks*spec);
k3d/share/shaders/k3d_bubbles.sl:5: * Felipe Esquivel  felipeer@hotmail.com
k3d/share/shaders/k3d_bubbles.sl:10:	float radius = 0.5;   /* values between -0.5 and 0.5          */
k3d/share/shaders/k3d_bubbles.sl:11:	float Kmag = 1;       /* scale                                */
k3d/share/shaders/k3d_bubbles.sl:12:	float frequency = 1; /* number of bubbles per linear surface */
k3d/share/shaders/k3d_bubbles.sl:15: float distance2point;
k3d/share/shaders/k3d_bubbles.sl:17: float magnitud = 0;
k3d/share/shaders/k3d_bubbles.sl:19: float smod = mod((s) * frequency, 1) - 0.5;
k3d/share/shaders/k3d_bubbles.sl:20: float tmod = mod((t) * frequency, 1) - 0.5;
k3d/share/shaders/k3d_bubbles.sl:23: if (distance2point <= radius) 
k3d/share/shaders/k3d_bubbly.sl:1:/*  bubbly.sl written a while ago by Ivan DeWolf
k3d/share/shaders/k3d_bubbly.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_bubbly.sl:4: *  in any way you see fit, but please leave my name near the top
k3d/share/shaders/k3d_bubbly.sl:7: *  "a cellular texture basis function" by Steven Worley in the 
k3d/share/shaders/k3d_bubbly.sl:8: *  siggraph proceedings from 1996, except this uses a noised grid of cells
k3d/share/shaders/k3d_bubbly.sl:9: *  instead of the sparse convolution in the paper.
k3d/share/shaders/k3d_bubbly.sl:13: *  try lowering bubsize for pimples.
k3d/share/shaders/k3d_bubbly.sl:14: *  try negative values for Kd.
k3d/share/shaders/k3d_bubbly.sl:15: *  try anything you feel like.
k3d/share/shaders/k3d_bubbly.sl:18: *  mult    - multiples of bubbles per unit
k3d/share/shaders/k3d_bubbly.sl:19: *  Nzscale - scale of the noise that randomizes the location of 
k3d/share/shaders/k3d_bubbly.sl:20: *            the bubbles. set this to zero for a perfect grid of bubbles.
k3d/share/shaders/k3d_bubbly.sl:22: *  Kd      - coefficient of displacement. 
k3d/share/shaders/k3d_bubbly.sl:24: *  bubsize - basicly the radius of the bubbles. distance in rVu's.
k3d/share/shaders/k3d_bubbly.sl:29:  float  mult	 = 5,
k3d/share/shaders/k3d_bubbly.sl:35:  float a,b,c,bub;
k3d/share/shaders/k3d_bubbly.sl:36:  float dist, shortest=10000;
k3d/share/shaders/k3d_bubbly.sl:37:  point Po = transform("object",P)*mult;
k3d/share/shaders/k3d_bubbly.sl:41:  vector offset;
k3d/share/shaders/k3d_bubbly.sl:43:  setxcomp(trucell,floor(xcomp(Po))+.5);
k3d/share/shaders/k3d_bubbly.sl:44:  setycomp(trucell,floor(ycomp(Po))+.5);
k3d/share/shaders/k3d_bubbly.sl:45:  setzcomp(trucell,floor(zcomp(Po))+.5);
k3d/share/shaders/k3d_bubbly.sl:48:  for(a = -1; a<= 1; a+=1){
k3d/share/shaders/k3d_bubbly.sl:49:    for(b = -1; b<=1; b += 1){
k3d/share/shaders/k3d_bubbly.sl:50:      for(c = -1; c<=1; c += 1){
k3d/share/shaders/k3d_bubbly.sl:51:	offset = vector(a,b,c);
k3d/share/shaders/k3d_bubbly.sl:52:	surrcell = trucell+offset;
k3d/share/shaders/k3d_bubbly.sl:55:	if(dist<shortest) shortest = dist;
k3d/share/shaders/k3d_castucco.sl:2: * castucco.sl -- dispacement shader for stucco.
k3d/share/shaders/k3d_castucco.sl:5: *   I call this "castucco" because it's the stuff on the walls *everywhere*
k3d/share/shaders/k3d_castucco.sl:6: *   in Northern California.  I never really saw it on the East Coast,
k3d/share/shaders/k3d_castucco.sl:10: *   freq - basic frequency of the texture
k3d/share/shaders/k3d_castucco.sl:11: *   Km - amplitude of the mesas.
k3d/share/shaders/k3d_castucco.sl:12: *   octaves - how many octaves of fBm to sum
k3d/share/shaders/k3d_castucco.sl:13: *   trough, peak - define the shape of the valleys and mesas of the stucco.
k3d/share/shaders/k3d_castucco.sl:23:				float freq = 1;
k3d/share/shaders/k3d_castucco.sl:24:			  float Km = 0.2;
k3d/share/shaders/k3d_castucco.sl:25:			  float octaves = 3;
k3d/share/shaders/k3d_castucco.sl:26:			  float trough = -0.15, peak = 0.35
k3d/share/shaders/k3d_castucco.sl:30:  float fwidth;			/* Estimated change in P between image samples */
k3d/share/shaders/k3d_castucco.sl:31:  float disp;			/* Amount to displace */
k3d/share/shaders/k3d_castucco.sl:33:  /* Do texture calcs in "shader" space, get approximate filter size */
k3d/share/shaders/k3d_castucco.sl:34:  Pshad = freq * transform("shader", P);
k3d/share/shaders/k3d_castucco.sl:35:  fwidth = filterwidthp(Pshad);
k3d/share/shaders/k3d_castucco.sl:37:  /* Compute some fractional Brownian motion */
k3d/share/shaders/k3d_castucco.sl:38:  disp = fBm(Pshad, fwidth, 3, 2, 0.6);
k3d/share/shaders/k3d_castucco.sl:40:  /* Threshold the fBm and scale it */
k3d/share/shaders/k3d_causticlight.sl:2:k3d_causticlight ( float intensity = 1;
k3d/share/shaders/k3d_causticlight.sl:4:	       point from = point "shader" (0,0,0);
k3d/share/shaders/k3d_causticlight.sl:6:	       float coneangle = radians(30);
k3d/share/shaders/k3d_causticlight.sl:7:	       float conedeltaangle = radians(5);
k3d/share/shaders/k3d_causticlight.sl:8:	       float beamdistribution = 2;
k3d/share/shaders/k3d_causticlight.sl:10:	       float  samples = 16;
k3d/share/shaders/k3d_causticlight.sl:11:	       float  blur = 0.01;
k3d/share/shaders/k3d_causticlight.sl:12:	       float  bias = 0.01;
k3d/share/shaders/k3d_causticlight.sl:13:               float  threshold = 0.5;
k3d/share/shaders/k3d_causticlight.sl:14:	       float  noiseamp = 0, noisefreq = 1, noisepow = 1;
k3d/share/shaders/k3d_causticlight.sl:17:    uniform vector axis = normalize(to-from);
k3d/share/shaders/k3d_causticlight.sl:19:    illuminate (from, axis, coneangle) {
k3d/share/shaders/k3d_causticlight.sl:20:	float cosangle = (L . axis) / length(L);
k3d/share/shaders/k3d_causticlight.sl:21:	float atten = pow (cosangle, beamdistribution) / (L . L);
k3d/share/shaders/k3d_causticlight.sl:25:        if (shadowname != "") {
k3d/share/shaders/k3d_causticlight.sl:26:            float caustic = shadow (shadowname, Ps, "samples", samples,
k3d/share/shaders/k3d_causticlight.sl:29:	    if (noiseamp != 0) {
k3d/share/shaders/k3d_causticlight.sl:30:		point PL = transform ("shader", Ps);
k3d/share/shaders/k3d_causticlight.sl:31:		caustic *= noiseamp * pow (noise(PL*noisefreq), noisepow);
k3d/share/shaders/k3d_celld.sl:5: * Uses noises.h from ARMAN
k3d/share/shaders/k3d_celld.sl:17:        float Kvoro = 0;        /* desc {amount to displace. } */
k3d/share/shaders/k3d_celld.sl:18:	float voro_freq = 1;    /* desc {Feature size } */
k3d/share/shaders/k3d_celld.sl:19:	float voro_step = 0.05; /* desc {Step value size.  If the difference
k3d/share/shaders/k3d_celld.sl:20:				   between f2 and f1 is less then this value
k3d/share/shaders/k3d_celld.sl:22:	float voro_jitter = 0;  /* desc { Amount to perturb the voroni 
k3d/share/shaders/k3d_celld.sl:23:				   function } */
k3d/share/shaders/k3d_celld.sl:24:	string PSpace = "shader";  /* desc {Space to transform P for shading calculations } */
k3d/share/shaders/k3d_celld.sl:25:	float usePref = 0;   /* type switch */
k3d/share/shaders/k3d_celld.sl:26:	varying point __Pref = point (1000, 0, -1000); /* vis hidden */
k3d/share/shaders/k3d_celld.sl:27:   	output varying float VoroVal = 0; /* vis hidden */
k3d/share/shaders/k3d_celld.sl:30:	point objP = transform (PSpace, P);
k3d/share/shaders/k3d_celld.sl:31:	point noiseP = (usePref != 0)? transform (PSpace, __Pref): objP;
k3d/share/shaders/k3d_celld.sl:32:	normal Nn = ntransform (PSpace, N);
k3d/share/shaders/k3d_celld.sl:35:	float voro_f1 = 0, voro_f2 = 0;
k3d/share/shaders/k3d_celld.sl:38:	voronoi_f1f2_3d (noiseP*voro_freq, voro_jitter, 
k3d/share/shaders/k3d_celld.sl:39:			 voro_f1, voro_pos1, voro_f2,
k3d/share/shaders/k3d_celld.sl:42:	float voro_dist = 1 - step (voro_step, voro_f2 - voro_f1);
k3d/share/shaders/k3d_celld.sl:43:#if 0
k3d/share/shaders/k3d_celld.sl:44:	if (acos(N.I) >= 90)
k3d/share/shaders/k3d_celld.sl:46:#endif
k3d/share/shaders/k3d_celld.sl:51:	P = transform (PSpace, "current", objP);
k3d/share/shaders/k3d_ceramic.sl:5:surface k3d_ceramic(float Ka = 1, Kd = 0.5, Ks = .5, roughness = 0.1;
k3d/share/shaders/k3d_ceramic.sl:6:		    float Kr = 1, blur = 0, eta = 1.5;
k3d/share/shaders/k3d_ceramic.sl:7:		    float specsharpness = 0.5;
k3d/share/shaders/k3d_ceramic.sl:10:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ceramic.sl:11:  Ci = MaterialCeramic(Nf, Cs, Ka, Kd, Ks, roughness, specsharpness);
k3d/share/shaders/k3d_ceramictiles.sl:4: * Description: Ceramic tiles (like you'd find in a bathroom)
k3d/share/shaders/k3d_ceramictiles.sl:6: * Parameters for pattern placement and size:
k3d/share/shaders/k3d_ceramictiles.sl:7: *   projection, textureprojspace, mx -  define the projection used to
k3d/share/shaders/k3d_ceramictiles.sl:8: *     establish a basic 2-D coordinate system for the pattern.
k3d/share/shaders/k3d_ceramictiles.sl:10: *     for s and t directions)
k3d/share/shaders/k3d_ceramictiles.sl:11: *   groovewidth, grooveheight - width of the spacing between tiles,
k3d/share/shaders/k3d_ceramictiles.sl:12: *     expressed as a fraction of the tile-to-tile spacing.
k3d/share/shaders/k3d_ceramictiles.sl:13: *   groovedepth - displacement amount for the grooves (expressed in
k3d/share/shaders/k3d_ceramictiles.sl:15: *   truedisp - 1 for true displacement, 0 for bump mapping
k3d/share/shaders/k3d_ceramictiles.sl:17: * Parameters for tile color and pattern:
k3d/share/shaders/k3d_ceramictiles.sl:18: *   Cbase, Cmottle - base color and mottle color of the tile
k3d/share/shaders/k3d_ceramictiles.sl:19: *   mottlefreq - frequency of the mottling between Cbase & Cmottle
k3d/share/shaders/k3d_ceramictiles.sl:20: *   Cedge - separate edge color for the tiles
k3d/share/shaders/k3d_ceramictiles.sl:21: *   Cspeck - color of the occasional specks in the tiles
k3d/share/shaders/k3d_ceramictiles.sl:24: *      turn that feature off.
k3d/share/shaders/k3d_ceramictiles.sl:25: *   varyhue, varysat, varylum - individual controls for the per-tile
k3d/share/shaders/k3d_ceramictiles.sl:29: * Parameters for illumination model:
k3d/share/shaders/k3d_ceramictiles.sl:31: *   Kdmortar - Kd for the mortar between tiles
k3d/share/shaders/k3d_ceramictiles.sl:32: *   mortarcolor - base color of the mortar
k3d/share/shaders/k3d_ceramictiles.sl:33: *   Kdtile - diffuse component weighting of the tile
k3d/share/shaders/k3d_ceramictiles.sl:34: *   Ks, roughness, specsharpness - glossy specular controls of the tile
k3d/share/shaders/k3d_ceramictiles.sl:35: *   Kr, blur, eta - reflection parameters for the tile
k3d/share/shaders/k3d_ceramictiles.sl:49:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_ceramictiles.sl:60:/* Given 2-D texture coordinates ss,tt and their filter widths ds, dt,
k3d/share/shaders/k3d_ceramictiles.sl:61: * and the width and height of the grooves between tiles (assuming that
k3d/share/shaders/k3d_ceramictiles.sl:62: * tile spacing is 1.0), figure out which (integer indexed) tile we are
k3d/share/shaders/k3d_ceramictiles.sl:66:float tilepattern(float ss, tt, ds, dt;
k3d/share/shaders/k3d_ceramictiles.sl:67:		  float groovewidth, grooveheight;
k3d/share/shaders/k3d_ceramictiles.sl:68:		  output float swhichtile, twhichtile;
k3d/share/shaders/k3d_ceramictiles.sl:69:		  output float stile, ttile;)
k3d/share/shaders/k3d_ceramictiles.sl:71:  swhichtile = floor(ss);
k3d/share/shaders/k3d_ceramictiles.sl:72:  twhichtile = floor(tt);
k3d/share/shaders/k3d_ceramictiles.sl:76:  return filteredpulsetrain(groovewidth, 1, ss + groovewidth / 2,
k3d/share/shaders/k3d_ceramictiles.sl:77:			    ds) * filteredpulsetrain(grooveheight, 1,
k3d/share/shaders/k3d_ceramictiles.sl:85: * single tile, calculate the color of the tile at that point.  Major
k3d/share/shaders/k3d_ceramictiles.sl:86: * features include: (1) mottling of the color; (2) darkening or shifting
k3d/share/shaders/k3d_ceramictiles.sl:87: * to a different color near the border of the tile (with a ragged edge
k3d/share/shaders/k3d_ceramictiles.sl:90:color tiletexture(float tileindex;
k3d/share/shaders/k3d_ceramictiles.sl:91:		  float stile, ttile, ds, dt;
k3d/share/shaders/k3d_ceramictiles.sl:92:		  float edgevary, mottling, speckly; float mottlefreq;
k3d/share/shaders/k3d_ceramictiles.sl:96:  float dst = max(ds, dt);
k3d/share/shaders/k3d_ceramictiles.sl:97:  if(mottling > 0)
k3d/share/shaders/k3d_ceramictiles.sl:99:      point noisep = mottlefreq * point(stile, ttile, tileindex);
k3d/share/shaders/k3d_ceramictiles.sl:100:      float mottle =
k3d/share/shaders/k3d_ceramictiles.sl:101:	.2 + .6 * fBm(noisep, mottlefreq * max(ds, dt), 4, 2, 0.65);
k3d/share/shaders/k3d_ceramictiles.sl:104:  if(edgevary > 0)
k3d/share/shaders/k3d_ceramictiles.sl:106:      float sedgeoffset =
k3d/share/shaders/k3d_ceramictiles.sl:107:	.05 * fBm(point(stile * 10, ttile * 10, tileindex + 10),
k3d/share/shaders/k3d_ceramictiles.sl:109:      float tedgeoffset =
k3d/share/shaders/k3d_ceramictiles.sl:110:	.05 * fBm(point(stile * 10, ttile * 10, tileindex - 3),
k3d/share/shaders/k3d_ceramictiles.sl:112:      float edgy =
k3d/share/shaders/k3d_ceramictiles.sl:114:	(smoothpulse(.05, .15, .85, .95, stile + sedgeoffset) *
k3d/share/shaders/k3d_ceramictiles.sl:115:	 smoothpulse(.05, .15, .85, .95, ttile + tedgeoffset));
k3d/share/shaders/k3d_ceramictiles.sl:118:  if(speckly > 0)
k3d/share/shaders/k3d_ceramictiles.sl:120:      float speckfreq = 7;
k3d/share/shaders/k3d_ceramictiles.sl:122:	point(stile * speckfreq, ttile * speckfreq, tileindex + 8);
k3d/share/shaders/k3d_ceramictiles.sl:123:      float specky = filteredsnoise(noisep, speckfreq * dst);
k3d/share/shaders/k3d_ceramictiles.sl:133:/* Compute the color of a ceramic object.  Like plastic, but use a
k3d/share/shaders/k3d_ceramictiles.sl:135: * diffuse model for the mortar, and a ceramic model for the tiles,
k3d/share/shaders/k3d_ceramictiles.sl:137: * off highlights and reflections.
k3d/share/shaders/k3d_ceramictiles.sl:139:color MaterialCeramicTiles(normal Nf;
k3d/share/shaders/k3d_ceramictiles.sl:141:			   float intile;
k3d/share/shaders/k3d_ceramictiles.sl:142:			   float Ka, Kdmortar, Kdtile, Ks;
k3d/share/shaders/k3d_ceramictiles.sl:143:			   float roughness, specsharpness, Kr, blur, eta;
k3d/share/shaders/k3d_ceramictiles.sl:149:  float ks = Ks * intile;
k3d/share/shaders/k3d_ceramictiles.sl:150:  float kd = mix(Kdmortar, Kdtile, intile);
k3d/share/shaders/k3d_ceramictiles.sl:152:  float fkr, fkt;
k3d/share/shaders/k3d_ceramictiles.sl:154:  fresnel(IN, Nf, 1 / eta, fkr, fkt, R, T);
k3d/share/shaders/k3d_ceramictiles.sl:155:  fkt = 1 - fkr;
k3d/share/shaders/k3d_ceramictiles.sl:156:  float kr = fkr * Kr * intile;
k3d/share/shaders/k3d_ceramictiles.sl:157:  return fkt * basecolor * (Ka * ambient() + kd * diffuse(Nf)) +
k3d/share/shaders/k3d_ceramictiles.sl:158:    ks * LocIllumGlossy(Nf, V, roughness / 10,
k3d/share/shaders/k3d_ceramictiles.sl:165:surface k3d_ceramictiles(float Ka = 1, Ks = .75, roughness =
k3d/share/shaders/k3d_ceramictiles.sl:167:			 float Kr = 1, blur = 0, eta = 1.5;
k3d/share/shaders/k3d_ceramictiles.sl:168:			 float Kdtile = 0.5;
k3d/share/shaders/k3d_ceramictiles.sl:169:			 float Kdmortar = 0.8;
k3d/share/shaders/k3d_ceramictiles.sl:172:			 float stilespacing = 10, ttilespacing = 10;
k3d/share/shaders/k3d_ceramictiles.sl:173:			 float groovewidth = 0.06, grooveheight = 0.06;
k3d/share/shaders/k3d_ceramictiles.sl:174:			 float groovedepth = 0.2, truedisp = 0;
k3d/share/shaders/k3d_ceramictiles.sl:177:			 float mx[16] =
k3d/share/shaders/k3d_ceramictiles.sl:180:			 float edgevary = 1, mottling = 1, speckly = 1;
k3d/share/shaders/k3d_ceramictiles.sl:181:			 float mottlefreq = 7;
k3d/share/shaders/k3d_ceramictiles.sl:186:			 float varyhue = 0.025, varysat = 0.4, varylum = 0.5;)
k3d/share/shaders/k3d_ceramictiles.sl:189:   * Get a 2-D texture coordinates for the texturing, then
k3d/share/shaders/k3d_ceramictiles.sl:192:  float ss, tt, dss, dtt;
k3d/share/shaders/k3d_ceramictiles.sl:203:  float swhichtile, twhichtile, stile, ttile;
k3d/share/shaders/k3d_ceramictiles.sl:204:  float intile = tilepattern(ss, tt, dss, dtt,
k3d/share/shaders/k3d_ceramictiles.sl:207:  float tileindex = swhichtile + 13 * twhichtile;
k3d/share/shaders/k3d_ceramictiles.sl:210:   * Displacement: the edges of the tile displace down a bit, as do
k3d/share/shaders/k3d_ceramictiles.sl:211:   * the grooves between tiles.  Also, add just a little bit of
k3d/share/shaders/k3d_ceramictiles.sl:212:   * per-tile normal variation to break up reflections.
k3d/share/shaders/k3d_ceramictiles.sl:214:  float tiledisp = smoothpulse(0, .075, 0.925, 1, stile);
k3d/share/shaders/k3d_ceramictiles.sl:216:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ceramictiles.sl:218:    Displace(Nf, "shader", groovedepth * (tiledisp - 1), truedisp);
k3d/share/shaders/k3d_ceramictiles.sl:221:  Nf = normalize(mix(Nf, Ntile, intile));
k3d/share/shaders/k3d_ceramictiles.sl:224:   * Here's the exciting part -- calculate the color of the spot we're
k3d/share/shaders/k3d_ceramictiles.sl:226:   * so every tile looks a little different.
k3d/share/shaders/k3d_ceramictiles.sl:230:			    mottlefreq,
k3d/share/shaders/k3d_ceramictiles.sl:235:   * Set the color of the mortar between tiles, make it look good by
k3d/share/shaders/k3d_ceramictiles.sl:236:   * scaling it by some high frequency fBm.
k3d/share/shaders/k3d_ceramictiles.sl:240:  float dQ = filterwidthp(Q);
k3d/share/shaders/k3d_ceramictiles.sl:241:  if(intile < 1.0)
k3d/share/shaders/k3d_ceramictiles.sl:242:    Cmortar *= smoothstep(0, 1, (.5 + .4 * fBm(Q, dQ, 3, 2, .6)));
k3d/share/shaders/k3d_ceramictiles.sl:248:    MaterialCeramicTiles(Nf, Cmortar, Ctile, intile, Ka, Kdmortar, Kdtile, Ks,
k3d/share/shaders/k3d_checkerboard.sl:3:surface k3d_checkerboard(float Ka = 1.0;
k3d/share/shaders/k3d_checkerboard.sl:4:			 float Kd = 1.0;
k3d/share/shaders/k3d_checkerboard.sl:5:			 float Ks = 0.5;
k3d/share/shaders/k3d_checkerboard.sl:6:			 float roughness = 0.1; color specularcolor = 1.0;
k3d/share/shaders/k3d_checkerboard.sl:7:			 uniform float TileS = 6.0; uniform float TileT = 6.0;
k3d/share/shaders/k3d_checkerboard.sl:10:  point Nf;
k3d/share/shaders/k3d_checkerboard.sl:11:  float tiles, tilet;
k3d/share/shaders/k3d_checkerboard.sl:12:  float filters, filtert, filterst;
k3d/share/shaders/k3d_checkerboard.sl:13:  float filterwidths, filterwidtht;
k3d/share/shaders/k3d_checkerboard.sl:14:  float mixamount;
k3d/share/shaders/k3d_checkerboard.sl:18:	// Calculate our "filter zone" around the edges of each tile ...
k3d/share/shaders/k3d_checkerboard.sl:19:	filters = mod((s * TileS * 2.0) - 1.0, 2.0);
k3d/share/shaders/k3d_checkerboard.sl:20:	filtert = mod((t * TileT * 2.0) - 1.0, 2.0);
k3d/share/shaders/k3d_checkerboard.sl:22:	filterwidths = SFILTERWIDTH * TileS;
k3d/share/shaders/k3d_checkerboard.sl:23:	filterwidtht = TFILTERWIDTH * TileT;
k3d/share/shaders/k3d_checkerboard.sl:25:	filters = filteredpulse(1.0 - filterwidths, 1.0 + filterwidths, filters, filterwidths);
k3d/share/shaders/k3d_checkerboard.sl:26:	filtert = filteredpulse(1.0 - filterwidtht, 1.0 + filterwidtht, filtert, filterwidtht);
k3d/share/shaders/k3d_checkerboard.sl:28:	filterst = filters + filtert;
k3d/share/shaders/k3d_checkerboard.sl:35:  if(tiles == tilet)
k3d/share/shaders/k3d_checkerboard.sl:46:  // Diffuse reflection model ...
k3d/share/shaders/k3d_checkerboard.sl:47:  Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_checkerboard.sl:50:    Os * (checkcolor * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_checkerboard.sl:51:	  specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_checkerboard_solid.sl:2:surface k3d_checkerboard_solid(
k3d/share/shaders/k3d_checkerboard_solid.sl:3:	float Ka = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:4:	float Kd = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:5:	float Ks = 0.5;
k3d/share/shaders/k3d_checkerboard_solid.sl:6:	float roughness = 0.1;
k3d/share/shaders/k3d_checkerboard_solid.sl:8:	uniform float TileX = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:9:	uniform float TileY = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:10:	uniform float TileZ = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:16:	point Nf;
k3d/share/shaders/k3d_checkerboard_solid.sl:17:	float x, y, z, sum;
k3d/share/shaders/k3d_checkerboard_solid.sl:19:	point Pshad = transform(shadingspace, P);
k3d/share/shaders/k3d_checkerboard_solid.sl:21:	x = mod(floor(xcomp(Pshad) / TileX), 2.0);
k3d/share/shaders/k3d_checkerboard_solid.sl:22:	y = mod(floor(ycomp(Pshad) / TileY), 2.0);
k3d/share/shaders/k3d_checkerboard_solid.sl:23:	z = mod(floor(zcomp(Pshad) / TileZ), 2.0);
k3d/share/shaders/k3d_checkerboard_solid.sl:26:	if(sum >= 0.5)
k3d/share/shaders/k3d_checkerboard_solid.sl:35:	// Diffuse reflection model ...
k3d/share/shaders/k3d_checkerboard_solid.sl:36:	Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_checkerboard_solid.sl:38:	Ci = Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_clamptoalpha.sl:2: * clamptoalpha.sl -- imager shader that forces Ci to be non-negative
k3d/share/shaders/k3d_clamptoalpha.sl:3: *    and with each component to greater than the alpha value of the
k3d/share/shaders/k3d_clay.sl:2: * clay.sl -- simple clay surface using MaterialClay
k3d/share/shaders/k3d_clay.sl:6: * Reference:
k3d/share/shaders/k3d_clay.sl:7: *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
k3d/share/shaders/k3d_clay.sl:8: *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
k3d/share/shaders/k3d_clay.sl:13:surface k3d_clay(float Ka = 1, Kd = 0.7, roughness = 0.1;)
k3d/share/shaders/k3d_clay.sl:15:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_clay.sl:16:  Ci = MaterialClay(Nf, Cs, Ka, Kd, roughness);
k3d/share/shaders/k3d_cloudplane.sl:16:#define NTERMS 5
k3d/share/shaders/k3d_cloudplane.sl:18:surface
k3d/share/shaders/k3d_cloudplane.sl:25:    float i, amplitude, f;
k3d/share/shaders/k3d_cloudplane.sl:26:    float x, fx, xfreq, xphase;
k3d/share/shaders/k3d_cloudplane.sl:27:    float y, fy, yfreq, yphase;
k3d/share/shaders/k3d_cloudplane.sl:28:    uniform float offset = 0.5;
k3d/share/shaders/k3d_cloudplane.sl:29:    uniform float xoffset = 13;
k3d/share/shaders/k3d_cloudplane.sl:30:    uniform float yoffset = 96;
k3d/share/shaders/k3d_cloudplane.sl:32:    Psh = transform("shader", P);
k3d/share/shaders/k3d_cloudplane.sl:33:    x = xcomp(Psh) + xoffset;
k3d/share/shaders/k3d_cloudplane.sl:34:    y = ycomp(Psh) + yoffset;
k3d/share/shaders/k3d_cloudplane.sl:38:    xfreq = 2 * PI * 0.023;
k3d/share/shaders/k3d_cloudplane.sl:39:    yfreq = 2 * PI * 0.021;
k3d/share/shaders/k3d_cloudplane.sl:41:    f = 0;
k3d/share/shaders/k3d_cloudplane.sl:42:    for (i = 0; i < NTERMS; i += 1) {
k3d/share/shaders/k3d_cloudplane.sl:43:        fx = amplitude *
k3d/share/shaders/k3d_cloudplane.sl:44:            (offset + cos(xfreq * (x + xphase)));
k3d/share/shaders/k3d_cloudplane.sl:45:        fy = amplitude *
k3d/share/shaders/k3d_cloudplane.sl:46:            (offset + cos(yfreq * (y + yphase)));
k3d/share/shaders/k3d_cloudplane.sl:47:        f += fx * fy;
k3d/share/shaders/k3d_cloudplane.sl:48:        xphase = PI/2 * 0.9 * cos(yfreq * y);
k3d/share/shaders/k3d_cloudplane.sl:49:        yphase = PI/2 * 1.1 * cos(xfreq * x);
k3d/share/shaders/k3d_cloudplane.sl:51:        xfreq *= 1.9 + i * 0.1; /* approximately 2 */
k3d/share/shaders/k3d_cloudplane.sl:52:        yfreq *= 2.2 - i * 0.08; /* approximately 2 */
k3d/share/shaders/k3d_cloudplane.sl:55:    f = clamp(f, 0, 1);
k3d/share/shaders/k3d_cloudplane.sl:57:    Ct = mix(Cs, cloudcolor, f);
k3d/share/shaders/k3d_constant.sl:1:/* constant.sl - Standard constant surface for RenderMan Interface.
k3d/share/shaders/k3d_constant.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_constant.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_constant.sl:9:surface k3d_constant(float intensity = 1.0)
k3d/share/shaders/k3d_contacshadow.sl:1:/* renamed shader to SIG2k_srf_contact to be consistent with RMR 
k3d/share/shaders/k3d_contacshadow.sl:7:** Render a contact shadow based on depth data derived from a light  
k3d/share/shaders/k3d_contacshadow.sl:8:** placed onto the surface which catches the contact shadow  
k3d/share/shaders/k3d_contacshadow.sl:13:surface 
k3d/share/shaders/k3d_contacshadow.sl:15:    string shadowname = "";     /* the name of the texture file */  
k3d/share/shaders/k3d_contacshadow.sl:16:    float samples = 10;         /* how many samples to take per Z lookup */  
k3d/share/shaders/k3d_contacshadow.sl:17:    float influence = 1.0;      /* world space distance in which effect is visible */  
k3d/share/shaders/k3d_contacshadow.sl:18:    float gamma = 0.5;          /* controls ramp on of effect over distance */  
k3d/share/shaders/k3d_contacshadow.sl:19:    float maxdist = 10000;      /* how far is considered infinity */  
k3d/share/shaders/k3d_contacshadow.sl:22:    /* get a matrix which transforms from current space to the  
k3d/share/shaders/k3d_contacshadow.sl:24:    uniform matrix matNl;  
k3d/share/shaders/k3d_contacshadow.sl:25:    textureinfo(shadowname, "viewingmatrix", matNl);  
k3d/share/shaders/k3d_contacshadow.sl:27:    /* get a matrix which transforms from current space to the  
k3d/share/shaders/k3d_contacshadow.sl:29:    uniform matrix matNP;  
k3d/share/shaders/k3d_contacshadow.sl:30:    textureinfo(shadowname, "projectionmatrix", matNP);  
k3d/share/shaders/k3d_contacshadow.sl:32:    /* transform the ground plane point into texture coordinates  
k3d/share/shaders/k3d_contacshadow.sl:34:    point screenP = transform(matNP, P);  
k3d/share/shaders/k3d_contacshadow.sl:35:    float ss = (xcomp(screenP) + 1) * 0.5;  
k3d/share/shaders/k3d_contacshadow.sl:36:    float tt = (1 - ycomp(screenP)) * 0.5;  
k3d/share/shaders/k3d_contacshadow.sl:38:    if (ss < 0 || ss > 1 || tt < 0 || tt > 1) {  
k3d/share/shaders/k3d_contacshadow.sl:39:	/* point being shaded is outside the region of the depth map */  
k3d/share/shaders/k3d_contacshadow.sl:43:	/* get the distance from the shadow camera to the closest
k3d/share/shaders/k3d_contacshadow.sl:45:	float mapdist = float texture(shadowname, ss, tt, "samples", samples);
k3d/share/shaders/k3d_contacshadow.sl:47:	/* transform the point on the ground plane into the shadow
k3d/share/shaders/k3d_contacshadow.sl:48:	   camera space in order to get the distance from the shadow
k3d/share/shaders/k3d_contacshadow.sl:50:	point cameraP = transform(matNl, P);  
k3d/share/shaders/k3d_contacshadow.sl:52:	/* the difference between the two distances is used to calculate the  
k3d/share/shaders/k3d_contacshadow.sl:53:	   contact shadow effect */  
k3d/share/shaders/k3d_contacshadow.sl:54:	float distance = mapdist - zcomp(cameraP);  
k3d/share/shaders/k3d_contacshadow.sl:56:	distance = smoothstep(0, 1, distance/influence);  
k3d/share/shaders/k3d_corktile.sl:1:/* Renamed to PQcorktile.sl for RMR -- talrmr@SpamSucks_pacbell.net */
k3d/share/shaders/k3d_corktile.sl:3:/* corktile.sl - a surface shader imitating cork tiling
k3d/share/shaders/k3d_corktile.sl:11: * Ksgap - the specular component for tile gaps : by default 0.3 * Ks
k3d/share/shaders/k3d_corktile.sl:12: * txtscale - the amount of detail / magnification of the image, this also determines
k3d/share/shaders/k3d_corktile.sl:13: *   (if tiles=1) the number of tiles fitted into the texture as s and t vary from 0 to 1
k3d/share/shaders/k3d_corktile.sl:14: * tiles - the number of tiles in a unit square of texture before txtscale is applied
k3d/share/shaders/k3d_corktile.sl:15: *	 (this means the number of tiles actually seen is the square of txtscale * tiles)
k3d/share/shaders/k3d_corktile.sl:16: * gap - the size of the gap or groove between tiles, measured as a proportion of the tile,
k3d/share/shaders/k3d_corktile.sl:17: *	 thus a gap of .05 will mean that 2.5% of the tile around each edge will be taken up with
k3d/share/shaders/k3d_corktile.sl:19: * bumpheight - the total height for bump mapped bumps - irregularities on the surface plus
k3d/share/shaders/k3d_corktile.sl:20: *   the displacement of the tile itself out of the gap
k3d/share/shaders/k3d_corktile.sl:21: * tileheight - the proportion of the bumpheight that is taken up with the rise of the tile from
k3d/share/shaders/k3d_corktile.sl:22: * 	 the gap between the tiles, the remainder of bumpheight is taken up with the bumps on the 
k3d/share/shaders/k3d_corktile.sl:23: *   surface of the tile. So if tileheight = 1 there are no bumps on the tile surface, if
k3d/share/shaders/k3d_corktile.sl:24: *   tileheight = 0 there are bumps on the tile surface of height tileheight, but no difference
k3d/share/shaders/k3d_corktile.sl:25: *   in height between the gap and the tile itself
k3d/share/shaders/k3d_corktile.sl:27: * The shader makes an attempt at being self antaliasing
k3d/share/shaders/k3d_corktile.sl:31:#include "k3d_noises.h" /* the standard BMRT include file */
k3d/share/shaders/k3d_corktile.sl:33:#define fnoise(p,width) (noise(p) * (1-smoothstep (0.2,0.75,width)))
k3d/share/shaders/k3d_corktile.sl:35:/* Bias function - Perlin and Hoffert 1989 */
k3d/share/shaders/k3d_corktile.sl:37:float
k3d/share/shaders/k3d_corktile.sl:38:bias (float b, x)
k3d/share/shaders/k3d_corktile.sl:44:							float txtscale, filtwidth)
k3d/share/shaders/k3d_corktile.sl:46:		/* 	the pattern is built up of the sum of two offset noise functions, perturbed slightly
k3d/share/shaders/k3d_corktile.sl:47:		and used to select a color from a spline, combined with an overlay of the dark 
k3d/share/shaders/k3d_corktile.sl:51:		point P2 = transform("shader",PP);
k3d/share/shaders/k3d_corktile.sl:53:		float fw = filtwidth * txtscale;
k3d/share/shaders/k3d_corktile.sl:54:		float g;
k3d/share/shaders/k3d_corktile.sl:55:		float f = fnoise(PT, fw) + fnoise((P2 + 0.553) * txtscale, fw); 
k3d/share/shaders/k3d_corktile.sl:56:		f = f * fnoise(PT * .854, fw);
k3d/share/shaders/k3d_corktile.sl:57:		f = f + (fnoise(PT * 5.342, fw) - .5) * .5;  
k3d/share/shaders/k3d_corktile.sl:58:		f = clamp(f, 0, 1);
k3d/share/shaders/k3d_corktile.sl:59:		g = fBm((P2 + 8.654) * txtscale, fw, 4, 2, .5);
k3d/share/shaders/k3d_corktile.sl:60:		Ct = color spline( 	f,
k3d/share/shaders/k3d_corktile.sl:70:		if (g > .2)
k3d/share/shaders/k3d_corktile.sl:78:surface
k3d/share/shaders/k3d_corktile.sl:79:k3d_corktile( 	float	Ka = 1;
k3d/share/shaders/k3d_corktile.sl:80:          	float	Kd = .75;
k3d/share/shaders/k3d_corktile.sl:81:         		float	Ks = .3;
k3d/share/shaders/k3d_corktile.sl:82:						float Ksgap = -1;
k3d/share/shaders/k3d_corktile.sl:83:         		float	roughness = .05;
k3d/share/shaders/k3d_corktile.sl:84:	 					float	txtscale = 1;
k3d/share/shaders/k3d_corktile.sl:85:						float tiles = 1;
k3d/share/shaders/k3d_corktile.sl:86:						float gap = .05;
k3d/share/shaders/k3d_corktile.sl:88:						float bumpheight = 0.3;
k3d/share/shaders/k3d_corktile.sl:89:						float tileheight = .8;
k3d/share/shaders/k3d_corktile.sl:90:						float bumpfreq = 0.8;)
k3d/share/shaders/k3d_corktile.sl:93:	uniform float Ksg = Ksgap > 0 ? Ksgap : Ks * .3; 
k3d/share/shaders/k3d_corktile.sl:94:	uniform float tilewidth = 1 / (tiles * txtscale); 
k3d/share/shaders/k3d_corktile.sl:95:	float disp, adjust;
k3d/share/shaders/k3d_corktile.sl:96:	point PP = transform("shader",P);
k3d/share/shaders/k3d_corktile.sl:97:	float filtwidth = filterwidthp(PP),
k3d/share/shaders/k3d_corktile.sl:100:			stfiltwidth = max(swidth, twidth) / tilewidth,
k3d/share/shaders/k3d_corktile.sl:103:	normal Nf;
k3d/share/shaders/k3d_corktile.sl:104:	float ingap = tile(s, t, tilewidth, tilewidth, swidth, twidth, gap, gap, sw, tw, so, to);
k3d/share/shaders/k3d_corktile.sl:106:	Ct = cork( P, txtscale, filtwidth);	
k3d/share/shaders/k3d_corktile.sl:107:	/* Calculate color of gap between tiles */
k3d/share/shaders/k3d_corktile.sl:108:	Cg = color( .20, 0, 0) + filteredsnoise(PP * txtscale, filtwidth * txtscale) * .2;
k3d/share/shaders/k3d_corktile.sl:112:		(1  - smoothstep(.2 * gap, gap * .8, stfiltwidth));  
k3d/share/shaders/k3d_corktile.sl:113:	disp = (tileheight + fnoise(PP * txtscale * bumpfreq + 3, filtwidth * txtscale) * (1 - tileheight)) 
k3d/share/shaders/k3d_corktile.sl:115:	Nf = faceforward(calculatenormal(P + disp *	normalize(N)), I);
k3d/share/shaders/k3d_corktile.sl:116:	Nf = normalize(Nf);
k3d/share/shaders/k3d_corktile.sl:117:	/* printf("Nf = %p\n", Nf);	 */
k3d/share/shaders/k3d_corktile.sl:119:	Ci = Os * (mix( Ct, Cg, ingap) * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_corktile.sl:120:		specularcolor * Ks*specular(Nf,-normalize(I),roughness)); 
k3d/share/shaders/k3d_craters.sl:2: * JBUMcraters.sl -- Lunar-like surface - Jim Bumgardner jbum@jbum.com
k3d/share/shaders/k3d_craters.sl:4: * Voronoi/Worley noise is combined using 1/f scaling to put craters on a surface.
k3d/share/shaders/k3d_craters.sl:14:surface
k3d/share/shaders/k3d_craters.sl:15:k3d_craters ( float Ka = 1, Kd = 0.7, roughness = 0.1;
k3d/share/shaders/k3d_craters.sl:16:   float Km = 0.03;	/* Depth of crater displacement */
k3d/share/shaders/k3d_craters.sl:17:   float swidth=.6;      /* Size of largest crater relative to s/t mapping */
k3d/share/shaders/k3d_craters.sl:18:   float pitfactor = .7; /* chance of crater occuring in a cell */
k3d/share/shaders/k3d_craters.sl:19:   float octaves=9;      /* number of scales used - use lower numbers for cartoony effects */
k3d/share/shaders/k3d_craters.sl:20:   float lac=1.91341;    /* diameter spacing between successive octaves */
k3d/share/shaders/k3d_craters.sl:21:   float amp=1.91341;    /* amplitude reduction between successive octaves */
k3d/share/shaders/k3d_craters.sl:22:   float jitter=1.0;     /* irregularity of crater spacing */
k3d/share/shaders/k3d_craters.sl:24:   /* you'll get artifacts if you go too much higher than 1 */
k3d/share/shaders/k3d_craters.sl:25:   /* but this can be avoided by looping i,j from -2 to 2 instead of -1 to 1 */
k3d/share/shaders/k3d_craters.sl:26:   float distortamp = 0.0005; /* Crater distortion.  You'll get artifacts if it goes too high. */
k3d/share/shaders/k3d_craters.sl:29:    normal Nf;
k3d/share/shaders/k3d_craters.sl:32:    float ss, tt, angle, r, rim, uu, a, i, j, sc, asc, lev;
k3d/share/shaders/k3d_craters.sl:33:    float sctr, tctr, scell, tcell,scellctr,tcellctr;
k3d/share/shaders/k3d_craters.sl:34:    float pert=0,rad,pert2;
k3d/share/shaders/k3d_craters.sl:35:    float rmax = swidth/2; /* was /2 */
k3d/share/shaders/k3d_craters.sl:36:    float	rmax1=1000000,rmax2=1000000,rrad1=0,rrad2=0,cellsizescale,ilac;
k3d/share/shaders/k3d_craters.sl:42:    for (lev = 0; lev < octaves; lev += 1)
k3d/share/shaders/k3d_craters.sl:46:	scellctr = floor(s*sc/swidth);
k3d/share/shaders/k3d_craters.sl:47:	tcellctr = floor(t*sc/swidth);
k3d/share/shaders/k3d_craters.sl:51:	for (i = -1; i <= 1; i += 1) 
k3d/share/shaders/k3d_craters.sl:54:	    for (j = -1; j <= 1; j += 1) 
k3d/share/shaders/k3d_craters.sl:57:		if ( cellnoise(7*scell-9.5, 7*tcell+7.5) < pitfactor)
k3d/share/shaders/k3d_craters.sl:59:		  /* if ( fBm_default(xp) < pitfactor)  *//* I like this distribution better - pitf = -1 -> 1 */
k3d/share/shaders/k3d_craters.sl:65:		    r = ss*ss + tt*tt; /* r is distance from center squared */
k3d/share/shaders/k3d_craters.sl:66:		    if (r < rmax1) {
k3d/share/shaders/k3d_craters.sl:67:		      /* rad is size of crater squared */
k3d/share/shaders/k3d_craters.sl:76:		    else if (r < rmax2) {
k3d/share/shaders/k3d_craters.sl:77:		      /* rad is size of crater squared */
k3d/share/shaders/k3d_craters.sl:88:	if (distortamp != 0)
k3d/share/shaders/k3d_craters.sl:90:	    rrad1 += fBm_default(P*sc)*asc*distortamp; /* add crater roughness */
k3d/share/shaders/k3d_craters.sl:91:	    rrad2 += fBm_default(P*sc)*asc*distortamp; 
k3d/share/shaders/k3d_craters.sl:94:	/* Seem crater perturbations for each scale */
k3d/share/shaders/k3d_craters.sl:95:	if (rrad1 > 0 && rmax1 > 0) 
k3d/share/shaders/k3d_craters.sl:101:	if (rrad2 > 0 && rmax2 > 0) 
k3d/share/shaders/k3d_craters.sl:111:    Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_craters.sl:114:    Ci = MaterialClay (Nf, Ct, Ka, Kd, roughness);
k3d/share/shaders/k3d_crayon.sl:1:/* Renamed shader to PQCrayon for RMR -- talrmr@SpamSucks_pacbell.net */
k3d/share/shaders/k3d_crayon.sl:3:/* crayon.sl - a surface shader making crayon like marks
k3d/share/shaders/k3d_crayon.sl:7:	This shader makes the surface look as if it had been shaded with a pastel crayon.
k3d/share/shaders/k3d_crayon.sl:13:	txtscale  - an overall scaling factor
k3d/share/shaders/k3d_crayon.sl:14:	width - the width of the crayon strokes - this is scaled by txtscale
k3d/share/shaders/k3d_crayon.sl:15:	micro - the size of the dots that make up a crayon stroke, relative to the size of
k3d/share/shaders/k3d_crayon.sl:16:		the stroke. By default they are about 15 times smaller
k3d/share/shaders/k3d_crayon.sl:17:	stretch - the length of the stroke relative to its width;
k3d/share/shaders/k3d_crayon.sl:18:	density0 - controls the amount of topcolor seen - measured as a proportion - 
k3d/share/shaders/k3d_crayon.sl:20:	density1 - if different density0 this is the density when t = 1, with a smooth
k3d/share/shaders/k3d_crayon.sl:21:		interpolation of values for density0 when t = 0, thus allowing a 
k3d/share/shaders/k3d_crayon.sl:22:		graduation of shading from top to bottom of the object
k3d/share/shaders/k3d_crayon.sl:23:	color topcolor, basecolor - the color of the crayon strokes and the color of the ground
k3d/share/shaders/k3d_crayon.sl:32:#define snoise(x,y) ((noise(x,y) - 0.5) * 2)
k3d/share/shaders/k3d_crayon.sl:34:float
k3d/share/shaders/k3d_crayon.sl:35:aanoise(float sp, tp, width)
k3d/share/shaders/k3d_crayon.sl:37:	/* an antaliased noise function, which returns noise of a wavelenth always greater than
k3d/share/shaders/k3d_crayon.sl:39:	float f, mag, ns;
k3d/share/shaders/k3d_crayon.sl:40:	/* calculate smallest integer f for which width / f < .5 */
k3d/share/shaders/k3d_crayon.sl:41:	f = ceil(width /.5);
k3d/share/shaders/k3d_crayon.sl:42:	mag = max(pow(0.85, f - 1),.1);
k3d/share/shaders/k3d_crayon.sl:43:	/*(printf("f = %f, mag = %f\n",f,mag)*/;
k3d/share/shaders/k3d_crayon.sl:44:	ns  = mag * snoise(sp / f, tp / f) * (1 - smoothstep(0, .5, width / f))
k3d/share/shaders/k3d_crayon.sl:45:		+ snoise(sp / (f * 1.33), tp / (f * 1.33)) * mag * .25 * smoothstep(0, .5, width / f);
k3d/share/shaders/k3d_crayon.sl:50:#define MINFILTWIDTH 1.0e-6
k3d/share/shaders/k3d_crayon.sl:51:#define filterwidth(x)  max (abs(Du(x)*du) + abs(Dv(x)*dv), MINFILTWIDTH)
k3d/share/shaders/k3d_crayon.sl:54:surface
k3d/share/shaders/k3d_crayon.sl:55:k3d_crayon (	float Ka = 1;
k3d/share/shaders/k3d_crayon.sl:56:        	float Kd = .5;
k3d/share/shaders/k3d_crayon.sl:57:         	float Ks = .5;
k3d/share/shaders/k3d_crayon.sl:58:         	float roughness = .1;
k3d/share/shaders/k3d_crayon.sl:60:			float txtscale = 1;
k3d/share/shaders/k3d_crayon.sl:61:			float width = .05;
k3d/share/shaders/k3d_crayon.sl:62:			float micro = 15.32;
k3d/share/shaders/k3d_crayon.sl:63:			float stretch = 10;
k3d/share/shaders/k3d_crayon.sl:64:			float density0 = .5;
k3d/share/shaders/k3d_crayon.sl:65:			float density1 = .5;
k3d/share/shaders/k3d_crayon.sl:70:  color Csurf;
k3d/share/shaders/k3d_crayon.sl:71:    float density = density0 + t * (density1 - density0);
k3d/share/shaders/k3d_crayon.sl:72:	/* work out the density for the current t */
k3d/share/shaders/k3d_crayon.sl:73:	float trs = spline(1 - density, 0 , -0.195997, -0.128361, -0.0738346,	-0.0316483,
k3d/share/shaders/k3d_crayon.sl:76:		process is described by Steven Worley in Ch 3 of "Texturing and Modelling a
k3d/share/shaders/k3d_crayon.sl:78:	normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_crayon.sl:79:	float m;
k3d/share/shaders/k3d_crayon.sl:80:	float fw = max(filterwidth(s), filterwidth(t)); /* the size of the micropolygon */
k3d/share/shaders/k3d_crayon.sl:81:	float smks = aanoise(txtscale * s * micro / width, txtscale * t * micro / width,
k3d/share/shaders/k3d_crayon.sl:82:	 		txtscale * fw * micro / width);
k3d/share/shaders/k3d_crayon.sl:83:	float lmks = (aanoise(txtscale * s / width, txtscale * t / (width * stretch), 
k3d/share/shaders/k3d_crayon.sl:84:		txtscale * fw / width) + 1) / 2;
k3d/share/shaders/k3d_crayon.sl:89:	Csurf = mix(basecolor, topcolor, m);
k3d/share/shaders/k3d_crayon.sl:91:    Ci = Os * ( Csurf * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_crayon.sl:92:		specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_crayontoon.sl:2: * Abril 2002    <felipe@siggraph.org.mx>

k3d/share/shaders/k3d_crayontoon.sl:4: * Este shader es un constant con un poco de difusion,

k3d/share/shaders/k3d_crayontoon.sl:6: * el estilo deseado. Mi intencion fue hacer un color dependiente

k3d/share/shaders/k3d_crayontoon.sl:9: * This shader is a constant with little diffusion, 

k3d/share/shaders/k3d_crayontoon.sl:11: * idea was to make one color dependable of the other but is

k3d/share/shaders/k3d_crayontoon.sl:14:surface k3d_crayontoon(color colorBase = color(1, .92, .44),

k3d/share/shaders/k3d_crayontoon.sl:16:                   float eta = 1.3,

k3d/share/shaders/k3d_crayontoon.sl:19:  float Kr1, Kt1;

k3d/share/shaders/k3d_crayontoon.sl:20:  vector Nf = normalize(N);

k3d/share/shaders/k3d_crayontoon.sl:22:  fresnel(normalize(I), faceforward(Nf, I, Nf), 1/eta, Kr1, Kt1);

k3d/share/shaders/k3d_crayontoon.sl:23:  if(Kt1 > 1) Kt1 = 1;

k3d/share/shaders/k3d_crayontoon.sl:25:  Ci = Os * (mix(colorBase, colorSombra, Kt1) + Kd * Kt1 * diffuse(Nf) * colorBase);

k3d/share/shaders/k3d_cs.sl:1:surface k3d_cs(){Ci = Cs;}
k3d/share/shaders/k3d_cyclone.sl:1:#define TWOPI (2*PI)
k3d/share/shaders/k3d_cyclone.sl:4:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_cyclone.sl:5:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_cyclone.sl:6:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_cyclone.sl:7:#define VERY_SMALL 0.001
k3d/share/shaders/k3d_cyclone.sl:10:surface k3d_cyclone(float Ka = 0.5, Kd = 0.75; float max_radius = 1;
k3d/share/shaders/k3d_cyclone.sl:11:		    float twist = 0.5; float scale = .7, offset = .5;
k3d/share/shaders/k3d_cyclone.sl:12:		    float omega = 0.675; float octaves = 4;
k3d/share/shaders/k3d_cyclone.sl:15:  float radius, dist, angle, sine, cosine, eye_weight, value;
k3d/share/shaders/k3d_cyclone.sl:18:  point PP;			/* Point after distortion */
k3d/share/shaders/k3d_cyclone.sl:19:  float l, o, a, i;		/* Loop control for fractal sum */
k3d/share/shaders/k3d_cyclone.sl:21:  /* Transform to texture coordinates */
k3d/share/shaders/k3d_cyclone.sl:22:  Pt = transform("shader", P);
k3d/share/shaders/k3d_cyclone.sl:28:  if(radius < max_radius)
k3d/share/shaders/k3d_cyclone.sl:29:    {				/* inside of cyclone */
k3d/share/shaders/k3d_cyclone.sl:30:      /* invert distance from center */
k3d/share/shaders/k3d_cyclone.sl:38:      /* Subtract out "eye" of storm */
k3d/share/shaders/k3d_cyclone.sl:39:      if(radius < 0.05 * max_radius)
k3d/share/shaders/k3d_cyclone.sl:40:	{			/* if in "eye" */
k3d/share/shaders/k3d_cyclone.sl:51:  if(eye_weight > 0)
k3d/share/shaders/k3d_cyclone.sl:52:    {				/* if in "storm" area */
k3d/share/shaders/k3d_cyclone.sl:53:      /* Compute VLfBm */
k3d/share/shaders/k3d_cyclone.sl:57:      for(i = 0; i < octaves && o >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_cyclone.sl:63:      value = abs(eye_weight * (offset + scale * a));
k3d/share/shaders/k3d_cyclone.sl:68:  /* Thin the density of the clouds */
k3d/share/shaders/k3d_cyclone.sl:73:    Oi * Cs * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_decalplastic.sl:6:// This program is free software; you can redistribute it and/or
k3d/share/shaders/k3d_decalplastic.sl:7:// modify it under the terms of the GNU General Public
k3d/share/shaders/k3d_decalplastic.sl:8:// License as published by the Free Software Foundation; either
k3d/share/shaders/k3d_decalplastic.sl:9:// version 2 of the License, or (at your option) any later version.
k3d/share/shaders/k3d_decalplastic.sl:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_decalplastic.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_decalplastic.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_decalplastic.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_decalplastic.sl:17:// License along with this program; if not, write to the Free Software
k3d/share/shaders/k3d_decalplastic.sl:20:/** \file
k3d/share/shaders/k3d_decalplastic.sl:24:surface k3d_decalplastic(
k3d/share/shaders/k3d_decalplastic.sl:25:	float Ka = 1.0;
k3d/share/shaders/k3d_decalplastic.sl:26:	float Kd = 0.5;
k3d/share/shaders/k3d_decalplastic.sl:27:	float Ks = 0.5;
k3d/share/shaders/k3d_decalplastic.sl:28:	float roughness = 0.1;
k3d/share/shaders/k3d_decalplastic.sl:31:	float s0 = 0.0;
k3d/share/shaders/k3d_decalplastic.sl:32:	float s1 = 1.0;
k3d/share/shaders/k3d_decalplastic.sl:33:	float t0 = 0.0;
k3d/share/shaders/k3d_decalplastic.sl:34:	float t1 = 1.0;
k3d/share/shaders/k3d_decalplastic.sl:38:	if(texturename != "")
k3d/share/shaders/k3d_decalplastic.sl:40:			float ss = mix(s0, s1, s);
k3d/share/shaders/k3d_decalplastic.sl:41:			float tt = mix(t0, t1, t);
k3d/share/shaders/k3d_decalplastic.sl:42:			float alpha = float texture(texturename[3], ss, tt);
k3d/share/shaders/k3d_decalplastic.sl:46:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_decalplastic.sl:49:	Ci = Oi * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_defaultsurface.sl:1:/* defaultsurface.sl - just color the surface, don't even look at lights
k3d/share/shaders/k3d_defaultsurface.sl:3: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_defaultsurface.sl:5: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_defaultsurface.sl:8:surface
k3d/share/shaders/k3d_defaultsurface.sl:9:k3d_defaultsurface(float Kd = .8, Ka = .2)
k3d/share/shaders/k3d_defaultsurface.sl:11:  float d = normalize(I).normalize(N);
k3d/share/shaders/k3d_dented.sl:2: * dented.sl -- displacement shader for dents
k3d/share/shaders/k3d_dented.sl:5: *   Makes a surface appear worn and dented.
k3d/share/shaders/k3d_dented.sl:8: *   Km 	   	the amplitude of the dents
k3d/share/shaders/k3d_dented.sl:9: *   power	   	controls the fractal dimension of the dents (1 looks
k3d/share/shaders/k3d_dented.sl:12: *   frequency  	the frequency of the dents
k3d/share/shaders/k3d_dented.sl:19: *      Dec 1992 -- written by lg for "Timbre Trees Examples" (jingle)
k3d/share/shaders/k3d_dented.sl:21: * last modified  12 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_dented.sl:23: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_dented.sl:25: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_dented.sl:30:displacement k3d_dented( float Km = 1; float power = 3; float frequency = 1; float maxoctaves = 6; )
k3d/share/shaders/k3d_dented.sl:32:	float size;
k3d/share/shaders/k3d_dented.sl:33:	float magnitude = 0;
k3d/share/shaders/k3d_dented.sl:34:	float i;
k3d/share/shaders/k3d_dented.sl:37:	PP = transform ("shader", P);
k3d/share/shaders/k3d_dented.sl:38:	size = frequency;
k3d/share/shaders/k3d_dented.sl:39:	for(i = 0;  i < maxoctaves;  i += 1)
k3d/share/shaders/k3d_depthcue.sl:1:/* depthcue.sl - Standard depthcue volume shader for RenderMan Interface.
k3d/share/shaders/k3d_depthcue.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_depthcue.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_depthcue.sl:9:volume k3d_depthcue(float mindistance = 0, maxdistance = 1;
k3d/share/shaders/k3d_depthcue.sl:12:  float d;
k3d/share/shaders/k3d_depthcue_surf.sl:1:/* k3d_depthcue_surf inspired by depthcue_surf.sl by Pixar
k3d/share/shaders/k3d_depthcue_surf.sl:2: * - Standard depthcue surface shader for RenderMan Interface.
k3d/share/shaders/k3d_depthcue_surf.sl:6:surface k3d_depthcue_surf(
k3d/share/shaders/k3d_depthcue_surf.sl:8:float mindistance = 0, maxdistance = 1, CScale=1000;
k3d/share/shaders/k3d_depthcue_surf.sl:12:  float d;
k3d/share/shaders/k3d_depthcue_surf.sl:16:	if (debug=="y")
k3d/share/shaders/k3d_depthcue_surf.sl:18:			printf("<debug shadername='k3d_depthcue_surf' shadertype='surface'>%p\t%f\t%f\t%c</debug>\n", P, depth(P), d, Ci);
k3d/share/shaders/k3d_displacementmap.sl:1:displacement k3d_displacementmap(float Km = 1;
k3d/share/shaders/k3d_displacementmap.sl:2:				 float ZeroPoint = 0.0;
k3d/share/shaders/k3d_displacementmap.sl:7:  float Ct;
k3d/share/shaders/k3d_displacementmap.sl:9:  Ct = (texturename != "") ? float texture(texturename) : 0;
k3d/share/shaders/k3d_distant_shadow.sl:2:	float  intensity=1 ;
k3d/share/shaders/k3d_distant_shadow.sl:4:	point from = point "shader" (0,0,0) ;
k3d/share/shaders/k3d_distant_shadow.sl:7:	float  samples=16;
k3d/share/shaders/k3d_distant_shadow.sl:8:	float  blur=.01;
k3d/share/shaders/k3d_distant_shadow.sl:9:	float  bias=.01;
k3d/share/shaders/k3d_distant_shadow.sl:12:		solar( to - from, 0.0 ) {
k3d/share/shaders/k3d_distant_shadow.sl:15:			if (shadowname != "") {
k3d/share/shaders/k3d_distantlight.sl:1:/* distantlight.sl - Standard distant light source for RenderMan Interface.
k3d/share/shaders/k3d_distantlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_distantlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_distantlight.sl:9:light k3d_distantlight(float intensity = 1;
k3d/share/shaders/k3d_distantlight.sl:11:		       point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_distantlight.sl:14:  solar(to - from, 0) Cl = intensity * lightcolor;
k3d/share/shaders/k3d_droop.sl:6: * droop(): a displacement shader for making a surface "sag" along t.
k3d/share/shaders/k3d_droop.sl:8:#define M_E 2.7182818284590452354	/* e */
k3d/share/shaders/k3d_droop.sl:12:	float	Km = 0.05 )
k3d/share/shaders/k3d_droop.sl:14:	float droop, yDel;
k3d/share/shaders/k3d_dturb.sl:8:displacement k3d_dturb(float Km = 0.1, freq = 10, flatness = 1)
k3d/share/shaders/k3d_dturb.sl:10:  float magnitude, layer_mag;
k3d/share/shaders/k3d_dturb.sl:12:  float width, cutoff, fade, f, turb, maxfreq = 16;
k3d/share/shaders/k3d_dturb.sl:16:  PP = transform("shader", P) * freq;
k3d/share/shaders/k3d_dturb.sl:18:  width = filterwidth_point(PP);
k3d/share/shaders/k3d_dturb.sl:19:  cutoff = clamp(0.5 / width, 0, maxfreq);
k3d/share/shaders/k3d_dturb.sl:22:  for (f = 1; f < 0.5 * cutoff; f *= 2) 
k3d/share/shaders/k3d_dturb.sl:23:    turb += abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_dturb.sl:24:  fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_dturb.sl:25:  turb += fade * abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_dturb.sl:27:  /* raise to power to create flat areas */
k3d/share/shaders/k3d_dturb.sl:29:  magnitude = pow(turb, flatness);
k3d/share/shaders/k3d_easysurface.sl:3:/* Listing 16.22  Surface shader for use without a light source*/
k3d/share/shaders/k3d_easysurface.sl:6: * easysurface(): orientation-sensitive surface shading without a light source
k3d/share/shaders/k3d_easysurface.sl:8:surface
k3d/share/shaders/k3d_easysurface.sl:9:k3d_easysurface(
k3d/share/shaders/k3d_easysurface.sl:10:	float	Kd	= .8, 
k3d/share/shaders/k3d_easysurface.sl:12:		falloff	= 2.0 )
k3d/share/shaders/k3d_easysurface.sl:14:	float diffuse ;
k3d/share/shaders/k3d_easysurface.sl:18:	diffuse = II.NN / (II.II * NN.NN);
k3d/share/shaders/k3d_easysurface.sl:19:	diffuse = pow(diffuse, falloff);
k3d/share/shaders/k3d_easysurface.sl:21:	Ci = Cs * (Ka + Kd * diffuse ) ;
k3d/share/shaders/k3d_ember.sl:5: * It is designed for use with particle systems where the particle is scaled
k3d/share/shaders/k3d_ember.sl:6: * to represent it's life. The desired effect is that of glowing particles that
k3d/share/shaders/k3d_ember.sl:7: * dim and fade as they die.
k3d/share/shaders/k3d_ember.sl:9: * baseSize = the basic diameter of the particle sphere before scaling
k3d/share/shaders/k3d_ember.sl:14:surface
k3d/share/shaders/k3d_ember.sl:15:k3d_ember (	float baseSize = 2;
k3d/share/shaders/k3d_ember.sl:16:		float attenuation = 4;
k3d/share/shaders/k3d_ember.sl:17:		float roughness = 0.99;
k3d/share/shaders/k3d_ember.sl:20:	point PP = transform ("world", P);
k3d/share/shaders/k3d_ember.sl:21:	point QQ = transform ("world", point "object" (0, 0, 0));
k3d/share/shaders/k3d_ember.sl:23:	float size = distance (PP, QQ) / baseSize;
k3d/share/shaders/k3d_ember.sl:25:	//size now represents the size of the sphere particle normalised into 0,1.
k3d/share/shaders/k3d_ember.sl:27:	normal Nf;
k3d/share/shaders/k3d_ember.sl:33:	Nf = faceforward(NN,I);
k3d/share/shaders/k3d_ember.sl:36:	float angle = NN . NI;
k3d/share/shaders/k3d_ember.sl:37:	// angle for edge opacity falloff
k3d/share/shaders/k3d_ember.sl:39:	float spcol = pow (max (0, Nf.NI * -1), 1/roughness);
k3d/share/shaders/k3d_ember.sl:40:	// basically, the standard specular function, but so that the highlight is
k3d/share/shaders/k3d_ember.sl:41:	// always in the centre of the particle sphere.
k3d/share/shaders/k3d_ember.sl:61:	// the colours for the fire effect from F. Kenton Musgrave's KMFlame.sl
k3d/share/shaders/k3d_ember.sl:63:	//only back face shade...
k3d/share/shaders/k3d_ember.sl:64:	if (angle < 0) {
k3d/share/shaders/k3d_emboss.sl:3:/* Listing 16.36  Displacement shader embossing a surface using a texture */
k3d/share/shaders/k3d_emboss.sl:7: * 	map as sdixon() to define the lettering.
k3d/share/shaders/k3d_emboss.sl:11:	float	Km		= .05;
k3d/share/shaders/k3d_emboss.sl:14:	if( texturename != "") {
k3d/share/shaders/k3d_envsurf.sl:1:surface k3d_envsurf (string envname = "", envspace = "world")
k3d/share/shaders/k3d_envsurf.sl:3:    if (envname != "")
k3d/share/shaders/k3d_envsurf.sl:4:	Ci = environment (envname, normalize(vtransform(envspace, I)));
k3d/share/shaders/k3d_eroded.sl:3:/* Listing 16.17  Surface shader eroding the surface of an object */
k3d/share/shaders/k3d_eroded.sl:6: * eroded(): Simulate a metallic surface eaten away with acid
k3d/share/shaders/k3d_eroded.sl:8:surface
k3d/share/shaders/k3d_eroded.sl:10:	float Ks = 0.4,
k3d/share/shaders/k3d_eroded.sl:15:	float size = 4.0,
k3d/share/shaders/k3d_eroded.sl:18:	point Nf,
k3d/share/shaders/k3d_eroded.sl:19:	      W = transform ("object", P);
k3d/share/shaders/k3d_eroded.sl:23:	for (i = 0; i < 6.0; i += 1.0) {
k3d/share/shaders/k3d_eroded.sl:24:		/* Calculate a simple fractal 1/f noise function */
k3d/share/shaders/k3d_eroded.sl:34:	Nf = faceforward (normalize (N), I);
k3d/share/shaders/k3d_eroded.sl:36:	Ci = Oi * Cs * (Ka * ambient() + Ks * specular (Nf, V, roughness) );
k3d/share/shaders/k3d_eyeball.sl:2: * eyeball.sl -- RenderMan compatible shader for an eyeball.
k3d/share/shaders/k3d_eyeball.sl:5: *   Makes a plastic-like surface which looks like an eyeball.  It's meant
k3d/share/shaders/k3d_eyeball.sl:6: *   for use on a sphere.  The center of the pupil is at the "north pole",
k3d/share/shaders/k3d_eyeball.sl:7: *   i.e. where the t parameter is 1.  The colors of the pupil, iris, white
k3d/share/shaders/k3d_eyeball.sl:9: *   functions are used for the veining and the iris mottling.
k3d/share/shaders/k3d_eyeball.sl:13: *   iriscolor - color of the iris
k3d/share/shaders/k3d_eyeball.sl:14: *   eyeballcolor - color of the white part of the eyeball
k3d/share/shaders/k3d_eyeball.sl:15: *   bloodcolor - color of the blood vessels
k3d/share/shaders/k3d_eyeball.sl:16: *   pupilcolor - color of the pupil (opening)
k3d/share/shaders/k3d_eyeball.sl:17: *   pupilsize - size of pupil (in "t" space)
k3d/share/shaders/k3d_eyeball.sl:18: *   irissize - size of iris (in "t" space), must be larger than pupilsize
k3d/share/shaders/k3d_eyeball.sl:20: *   veinfreq, veinlevel - control the formation of the blood vessels
k3d/share/shaders/k3d_eyeball.sl:24: * ANTIALIASING: basic antialiasing of the boundaries between tissue types
k3d/share/shaders/k3d_eyeball.sl:25: *               is performed.
k3d/share/shaders/k3d_eyeball.sl:30: *      Nov 1991 - crude written of "eye" by lg for Herman's eyes for
k3d/share/shaders/k3d_eyeball.sl:32: *      Dec 1993 - "eye" modified by lg to clean up a bit.
k3d/share/shaders/k3d_eyeball.sl:36: *       7 Jan 95 (wave) - changed name to LGEyeBall for namespace reasons...
k3d/share/shaders/k3d_eyeball.sl:37: *       8 Jan 95 (wave) - changed Ciris line to fix bug Larry figured out and changed defaults
k3d/share/shaders/k3d_eyeball.sl:38: *       27 Feb 95 (wave) - changed PO line to fix bug Larry figured out to actually *use* index
k3d/share/shaders/k3d_eyeball.sl:40: * last modified  8 Jan 95 by Michael B. Johnson (wave)
k3d/share/shaders/k3d_eyeball.sl:45:surface
k3d/share/shaders/k3d_eyeball.sl:46:k3d_eyeball (float Ka = .75, Kd = 0.75, Ks = 0.4, roughness = 0.1;
k3d/share/shaders/k3d_eyeball.sl:54:	 float pupilsize = 0.05, irissize = 0.12;
k3d/share/shaders/k3d_eyeball.sl:55:	 float bloodshot = 1.0;
k3d/share/shaders/k3d_eyeball.sl:56:	 float veinfreq = 8, veinlevel = 4;
k3d/share/shaders/k3d_eyeball.sl:57:	 float index = 0;
k3d/share/shaders/k3d_eyeball.sl:60:#define snoise(P) (2*noise(P)-1)
k3d/share/shaders/k3d_eyeball.sl:61:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_eyeball.sl:63:  point Nf;
k3d/share/shaders/k3d_eyeball.sl:65:  float i, turb, newturb, freq, f2;
k3d/share/shaders/k3d_eyeball.sl:66:  float displayed, newdisp;
k3d/share/shaders/k3d_eyeball.sl:68:  float irisstat, pupilstat;
k3d/share/shaders/k3d_eyeball.sl:69:  float bloody, tt;
k3d/share/shaders/k3d_eyeball.sl:70:  float ks, rough;
k3d/share/shaders/k3d_eyeball.sl:71:  float twidth, cutoff;
k3d/share/shaders/k3d_eyeball.sl:73:  /* Calculate an appropriate filter width for antialiasing */
k3d/share/shaders/k3d_eyeball.sl:75:  PO = transform ("object", P) + index;
k3d/share/shaders/k3d_eyeball.sl:77:  /* Figure out where we are in the eyeball.  Use the following variables:
k3d/share/shaders/k3d_eyeball.sl:80:   * bloody: how potentially bloody it is (fade as we get away from iris)
k3d/share/shaders/k3d_eyeball.sl:87:  /* If we're somewhere in the white part and it's potentially bloody,
k3d/share/shaders/k3d_eyeball.sl:89:   * of the whites.  The veining pattern is essentially summed zero sets
k3d/share/shaders/k3d_eyeball.sl:90:   * of turbulence functions.  Some stretching is done to get it to look
k3d/share/shaders/k3d_eyeball.sl:93:  if (irisstat * bloody > 0.001) {
k3d/share/shaders/k3d_eyeball.sl:94:      turb = bloody;  freq = veinfreq;
k3d/share/shaders/k3d_eyeball.sl:96:      for (i = 1;  (i <= veinlevel) && (turb > 0.1);  i += 1) {
k3d/share/shaders/k3d_eyeball.sl:97:	  newturb = 1 - abs (snoise(PO*freq + point(0,0,20*freq)));
k3d/share/shaders/k3d_eyeball.sl:101:	  freq *= 2;
k3d/share/shaders/k3d_eyeball.sl:108:  /* If we're somewhere in the iris, calculate the iris pattern, which is
k3d/share/shaders/k3d_eyeball.sl:109:   * just a stretched turbulence function.
k3d/share/shaders/k3d_eyeball.sl:111:  if (irisstat < 0.9999 && pupilstat > 0.0001) {
k3d/share/shaders/k3d_eyeball.sl:112:      turb = 0;  freq = 1;  f2 = 30;
k3d/share/shaders/k3d_eyeball.sl:113:      for (i = 1;  i <= 4;  i += 1) {
k3d/share/shaders/k3d_eyeball.sl:114:	  turb += snoise (PO*f2 + point(0,0,20*f2)) / freq;
k3d/share/shaders/k3d_eyeball.sl:115:	  freq *= 2;  f2 *= 2;
k3d/share/shaders/k3d_eyeball.sl:120:  /* OK, now calculate a surface texture color (Ct) based on where we are
k3d/share/shaders/k3d_eyeball.sl:130:  /* Now shade like plastic, but using our calculated surface color and
k3d/share/shaders/k3d_eyeball.sl:131:   * our modified values for roughness and Ks.
k3d/share/shaders/k3d_eyeball.sl:134:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_eyeball.sl:135:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_eyeball.sl:136:	      specularcolor * ks*specular(Nf,-normalize(I),rough));
k3d/share/shaders/k3d_ez.sl:1:surface
k3d/share/shaders/k3d_fakesky.sl:2: * fakesky.sl

k3d/share/shaders/k3d_fakesky.sl:4: * Shader a la const that slaps a fixed blue color up on the top half of a

k3d/share/shaders/k3d_fakesky.sl:9:surface k3d_fakesky(vector up = (0,0,1); color skycolor = (.5, .6, 1.)) {

k3d/share/shaders/k3d_filament.sl:3:/* Listing 16.25  Surface shader to make a cylinder look like a filament */
k3d/share/shaders/k3d_filament.sl:6: * filament(): map a filament-like spiral onto the surface of a cylinder.
k3d/share/shaders/k3d_filament.sl:8:surface 
k3d/share/shaders/k3d_filament.sl:9:k3d_filament ( 
k3d/share/shaders/k3d_filament.sl:10:	float	frequency	= 5.0,
k3d/share/shaders/k3d_filament.sl:14:	/* Calculate the distance of (s,t) from a spiral as a fraction [0,1] */
k3d/share/shaders/k3d_filament.sl:15:	float offset = mod((t*frequency + s + phase), 1.0);
k3d/share/shaders/k3d_filament.sl:17:	/* Threshold the fraction against the fractional filament width */
k3d/share/shaders/k3d_filament.sl:18:	if (offset < width) {
k3d/share/shaders/k3d_fill.sl:1:/*IDfill written by Ivan DeWolf
k3d/share/shaders/k3d_fill.sl:2: *simple toon fill shader with shadows
k3d/share/shaders/k3d_fill.sl:5:surface 
k3d/share/shaders/k3d_fill.sl:6:k3d_fill( 
k3d/share/shaders/k3d_fill.sl:7:	float	Kd			=   1, 
k3d/share/shaders/k3d_fill.sl:12:	normal Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_fill.sl:13:	Ci = Cs * (Ka*ambient() + Kd*(smoothstep(min,max,comp(diffuse(Nf),0))));
k3d/share/shaders/k3d_fire.sl:1:/* fire.sl
k3d/share/shaders/k3d_fire.sl:3: * animated fire -- adpated from shader by Flip Phillips
k3d/share/shaders/k3d_fire.sl:9:surface k3d_fire(float frame = 1)
k3d/share/shaders/k3d_fire.sl:11:  color layer_color, surface_color;
k3d/share/shaders/k3d_fire.sl:12:  color surface_opac, layer_opac;
k3d/share/shaders/k3d_fire.sl:13:  float width, cutoff, fade, f, turb, maxfreq = 16;
k3d/share/shaders/k3d_fire.sl:14:  float flame;
k3d/share/shaders/k3d_fire.sl:15:  float ss, tt;
k3d/share/shaders/k3d_fire.sl:21:  surface_color = 0;
k3d/share/shaders/k3d_fire.sl:22:  surface_opac = 0;
k3d/share/shaders/k3d_fire.sl:24:  /* compress ss & offset both by factor of current frame */
k3d/share/shaders/k3d_fire.sl:26:  ss = s * 5 + frame * 0.01;
k3d/share/shaders/k3d_fire.sl:27:  tt = t + frame * 0.1;
k3d/share/shaders/k3d_fire.sl:31:  width = max(filterwidth(ss), filterwidth(tt));
k3d/share/shaders/k3d_fire.sl:32:  cutoff = clamp(0.5 / width, 0, maxfreq);
k3d/share/shaders/k3d_fire.sl:35:  for (f = 1; f < 0.5 * cutoff; f *= 2) 
k3d/share/shaders/k3d_fire.sl:36:    turb += abs(snoise2(ss * f, tt * f)) / f;
k3d/share/shaders/k3d_fire.sl:37:  fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_fire.sl:38:  turb += fade * abs(snoise2(ss * f, tt * f)) / f;
k3d/share/shaders/k3d_fire.sl:43:  flame = clamp(t - turb, 0, 1);
k3d/share/shaders/k3d_fire.sl:44:  layer_opac = flame;
k3d/share/shaders/k3d_fire.sl:45:  layer_color = spline(flame, red, red, red, red, orange, yellow, hot, hot);
k3d/share/shaders/k3d_fire.sl:46:  surface_color = blend(surface_color, layer_color, layer_opac);
k3d/share/shaders/k3d_fire.sl:47:  surface_opac = union(surface_opac, layer_opac);
k3d/share/shaders/k3d_fire.sl:51:  Oi = surface_opac;
k3d/share/shaders/k3d_fire.sl:52:  Ci = surface_color;
k3d/share/shaders/k3d_flame.sl:2: * flame.sl -- RenderMan compatible surface shader for a flame-like texture.
k3d/share/shaders/k3d_flame.sl:5: *    Makes something that looks like fire.
k3d/share/shaders/k3d_flame.sl:9: *    chaosscale, chaosoffset, octaves - control the fBm
k3d/share/shaders/k3d_flame.sl:10: *    flameheight, flameamplitude - scaling factors
k3d/share/shaders/k3d_flame.sl:14: *    setting the "octaves" parameter based on distance from eye point.
k3d/share/shaders/k3d_flame.sl:29: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_flame.sl:32:#define snoise(p) (2 * float noise(p) - 1)
k3d/share/shaders/k3d_flame.sl:33:#define DNoise(p) (2 * (point noise(p)) - point(1, 1, 1))
k3d/share/shaders/k3d_flame.sl:34:#define VLNoise(p, scale) (snoise(p + scale * DNoise(p)))
k3d/share/shaders/k3d_flame.sl:36:surface k3d_flame(float distortion = 0;
k3d/share/shaders/k3d_flame.sl:37:		  float chaosscale = 1; float chaosoffset = 0;
k3d/share/shaders/k3d_flame.sl:38:		  float octaves = 7; float flameoffset = 0.0;
k3d/share/shaders/k3d_flame.sl:39:		  float flameamplitude = 2.0; float phase = 0.0)
k3d/share/shaders/k3d_flame.sl:42:  float freq;
k3d/share/shaders/k3d_flame.sl:43:  float chaos, i, cmap;
k3d/share/shaders/k3d_flame.sl:48:  freq = 1;
k3d/share/shaders/k3d_flame.sl:50:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_flame.sl:52:      chaos += VLNoise(freq * PQ, distortion) / freq;
k3d/share/shaders/k3d_flame.sl:53:      freq *= 2;
k3d/share/shaders/k3d_flame.sl:56:  chaos = abs(chaosscale * chaos + chaosoffset);
k3d/share/shaders/k3d_flame.sl:57:  cmap = 0.85 * chaos + flameoffset + (flameamplitude * ycomp(PP));
k3d/share/shaders/k3d_fog.sl:1:/* fog.sl - Standard fog volume shader for RenderMan Interface.
k3d/share/shaders/k3d_fog.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_fog.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_fog.sl:9:volume k3d_fog(float distance = 1; color background = 0;)
k3d/share/shaders/k3d_fog.sl:11:  float d = 1 - exp(-length(I) / distance);
k3d/share/shaders/k3d_fractal.sl:3: *    Conversion to Shading Language and minor modifications by Fredrik Brnnbacka.

k3d/share/shaders/k3d_fractal.sl:12:#define snoise(x) (2.5*(noise(x)-0.5))

k3d/share/shaders/k3d_fractal.sl:15:k3d_fractal(float H = 0.8, lacunarity = 2.5, octaves = 7, offset = 0.9, sharpness = 4, threshold = 12, Kt = 0.1)

k3d/share/shaders/k3d_fractal.sl:17:	float result, signal, weight, i, exponent;

k3d/share/shaders/k3d_fractal.sl:18:	point PP =transform("shader",P);

k3d/share/shaders/k3d_fractal.sl:20:	for( i=0; i<octaves; i += 1 ) {

k3d/share/shaders/k3d_fractal.sl:23:       		if ( i == 0) {

k3d/share/shaders/k3d_fractal.sl:25:          		if ( signal < 0.0 ) signal = -signal;

k3d/share/shaders/k3d_fractal.sl:26:          		signal = offset - signal;

k3d/share/shaders/k3d_fractal.sl:28:                             /*This should give you a power function to control

k3d/share/shaders/k3d_fractal.sl:29:                             sharpness of the ridges. Or you can just use the

k3d/share/shaders/k3d_fractal.sl:47:          		/* get absolute value of signal*/

k3d/share/shaders/k3d_fractal.sl:51:          		signal = offset - signal;

k3d/share/shaders/k3d_fresnelplastic.sl:2: * TLFresnelPlastic.sl -- simple shader illustrating fresnel().
k3d/share/shaders/k3d_fresnelplastic.sl:16:#include "k3d_reflections.h"
k3d/share/shaders/k3d_fresnelplastic.sl:18:#ifdef PRMAN  /* as of prman10 */
k3d/share/shaders/k3d_fresnelplastic.sl:19:#define CHKTX(tx) ((tx != "" && textureinfo (tx, "exists", 0) != 0)? 1: 0)
k3d/share/shaders/k3d_fresnelplastic.sl:21:#define CHKTX(tx) \
k3d/share/shaders/k3d_fresnelplastic.sl:23:#endif
k3d/share/shaders/k3d_fresnelplastic.sl:25:surface k3d_fresnelplastic (
k3d/share/shaders/k3d_fresnelplastic.sl:26:   color Csurf = 0.5; /* cat Color 
k3d/share/shaders/k3d_fresnelplastic.sl:27:			 desc {Base color for surface if 
k3d/share/shaders/k3d_fresnelplastic.sl:30:			    desc {Optional color map.  Replaces 'Csurf'.} */
k3d/share/shaders/k3d_fresnelplastic.sl:32:   float ior = 0;
k3d/share/shaders/k3d_fresnelplastic.sl:33:   /* desc { Index of Refraction.  Used to get Fresnel falloff.
k3d/share/shaders/k3d_fresnelplastic.sl:34:      0: turns off fresnel and gives plastic look. Typical values
k3d/share/shaders/k3d_fresnelplastic.sl:36:   float Ka= 1;       /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:37:   float Kd= 0.5;     /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:38:   float Ks= 0.5;     /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:39:   float roughness= 0.1;  /* desc {Specular roughness} */
k3d/share/shaders/k3d_fresnelplastic.sl:41:   float Kr = 0;  /* cat Reflection desc {Strength of reflection } */
k3d/share/shaders/k3d_fresnelplastic.sl:42:   string reflectMap = ""; 
k3d/share/shaders/k3d_fresnelplastic.sl:43:   /* cat Reflection desc {Name of reflection map. } type texture */
k3d/share/shaders/k3d_fresnelplastic.sl:44:   float reflectBlur = 0; 
k3d/share/shaders/k3d_fresnelplastic.sl:45:   /* cat Reflection desc {Percentage amount to blur map} */
k3d/share/shaders/k3d_fresnelplastic.sl:46:   string reflectSpace = "world";  /* cat Reflection 
k3d/share/shaders/k3d_fresnelplastic.sl:47:   desc {Space the reflection calculations are performed in. } */
k3d/share/shaders/k3d_fresnelplastic.sl:48:   float reflectDist = 1e10;
k3d/share/shaders/k3d_fresnelplastic.sl:49:   /* cat Reflection desc {The size of the room to base the reflection
k3d/share/shaders/k3d_fresnelplastic.sl:50:      lookup off of.} */
k3d/share/shaders/k3d_fresnelplastic.sl:52:   float flipS = 0; /* cat ST type switch desc {Flip S on texture lookups.} */
k3d/share/shaders/k3d_fresnelplastic.sl:53:   float flipT = 0; /* cat ST type switch desc {Flip S on texture lookups.} */
k3d/share/shaders/k3d_fresnelplastic.sl:54:   float MtorFlip = 0; /* cat ST type switch def 1
k3d/share/shaders/k3d_fresnelplastic.sl:56:			  NURBs differences.} */
k3d/share/shaders/k3d_fresnelplastic.sl:59:    float ss, tt;
k3d/share/shaders/k3d_fresnelplastic.sl:60:    float fKt, fKr;
k3d/share/shaders/k3d_fresnelplastic.sl:63:    normal Nf = normalize (faceforward( normalize(N), I ));
k3d/share/shaders/k3d_fresnelplastic.sl:65:    vector R = normalize (reflect (I, Nf));
k3d/share/shaders/k3d_fresnelplastic.sl:68:    if (MtorFlip == 1) {
k3d/share/shaders/k3d_fresnelplastic.sl:76:    if (flipS == 1)
k3d/share/shaders/k3d_fresnelplastic.sl:78:    if (flipT == 1)
k3d/share/shaders/k3d_fresnelplastic.sl:81:    /* Calculate fresnel index of refraction */
k3d/share/shaders/k3d_fresnelplastic.sl:82:    if (ior != 0) {
k3d/share/shaders/k3d_fresnelplastic.sl:83:      fresnel (normalize (I), Nf, (I.Nf > 0)? ior: 1/ior,
k3d/share/shaders/k3d_fresnelplastic.sl:84:	       fKr, fKt);
k3d/share/shaders/k3d_fresnelplastic.sl:86:      fKt = 1 - fKr;
k3d/share/shaders/k3d_fresnelplastic.sl:89:      /* fresnel turned off */
k3d/share/shaders/k3d_fresnelplastic.sl:90:      fKr = fKt = 1;
k3d/share/shaders/k3d_fresnelplastic.sl:94:    /*Ct = (CHKTX (colorMap))? texture (colorMap, ss, tt): Csurf; */
k3d/share/shaders/k3d_fresnelplastic.sl:95:    if (CHKTX (colorMap) == 1)
k3d/share/shaders/k3d_fresnelplastic.sl:98:      Ct = Csurf;
k3d/share/shaders/k3d_fresnelplastic.sl:102:    float reflOpacity = 1;
k3d/share/shaders/k3d_fresnelplastic.sl:103:    if (reflectMap != "")
k3d/share/shaders/k3d_fresnelplastic.sl:104:      Cr = Environment (reflectMap, reflectSpace, reflectDist, 
k3d/share/shaders/k3d_fresnelplastic.sl:105:			P, R, reflectBlur, reflOpacity);
k3d/share/shaders/k3d_fresnelplastic.sl:109:    Ci = Os * ( fKt * Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_fresnelplastic.sl:110:                fKr * Cspec * Ks * specular(Nf,V,roughness) +
k3d/share/shaders/k3d_fresnelplastic.sl:111:		Kr * Cr * fKr);
k3d/share/shaders/k3d_funkyglass.sl:1:/* funkyglass.sl - randomly colored "glass" (transparent, but no refl/refr).
k3d/share/shaders/k3d_funkyglass.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_funkyglass.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_funkyglass.sl:9:surface k3d_funkyglass(float Ka = .2;
k3d/share/shaders/k3d_funkyglass.sl:10:		       float Kd = .2; float Ks = 1; float roughness = .08;
k3d/share/shaders/k3d_funkyglass.sl:14:  normal Nf;
k3d/share/shaders/k3d_funkyglass.sl:19:  Nf = faceforward(normalize(N), V);
k3d/share/shaders/k3d_funkyglass.sl:20:  PP = transform("shader", P);
k3d/share/shaders/k3d_funkyglass.sl:24:  Oi = Ot * (0.75 - 0.5 * abs(V.Nf));
k3d/share/shaders/k3d_funkyglass.sl:26:    (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_funkyglass.sl:27:     specularcolor * Ks * specular(Nf, -V, roughness));
k3d/share/shaders/k3d_fur1.sl:2: * fur.sl

k3d/share/shaders/k3d_fur1.sl:11:k3d_fur1 ( float height = 1.0,

k3d/share/shaders/k3d_fur1.sl:12:              fac = 1.0;

k3d/share/shaders/k3d_fur1.sl:16:  float smod = mod(u*fac,1),

k3d/share/shaders/k3d_fur1.sl:17:        tmod = mod(v*fac,1);

k3d/share/shaders/k3d_fur1.sl:19:  if (smod < 0.5) {

k3d/share/shaders/k3d_fur1.sl:20:    if (tmod < 0.8) 

k3d/share/shaders/k3d_fur1.sl:25:    if (tmod < 0.2) 

k3d/share/shaders/k3d_fur2.sl:1:/* Renamed to SIG2k_srf_fur to be consistent with the RMR 
k3d/share/shaders/k3d_fur2.sl:5:/* fur surface shader
k3d/share/shaders/k3d_fur2.sl:13:fnc_diffuselgt (color Cin;       /* Light Colour */
k3d/share/shaders/k3d_fur2.sl:15:                point Nin;       /* Surface Normal */
k3d/share/shaders/k3d_fur2.sl:20:    float Atten;
k3d/share/shaders/k3d_fur2.sl:22:    /* normalize the stuff */
k3d/share/shaders/k3d_fur2.sl:26:    /* diffuse calculation */
k3d/share/shaders/k3d_fur2.sl:35:#define luminance(c) comp(c,0)*0.299 + comp(c,1)*0.587 + comp(c,2)*0.114
k3d/share/shaders/k3d_fur2.sl:38:surface 
k3d/share/shaders/k3d_fur2.sl:39:k3d_fur2( /* Hair Shading... */
k3d/share/shaders/k3d_fur2.sl:40:         float Ka   = 0.0287;
k3d/share/shaders/k3d_fur2.sl:41:	 float Kd   = 0.77;
k3d/share/shaders/k3d_fur2.sl:42:	 float Ks   = 1.285;
k3d/share/shaders/k3d_fur2.sl:43:	 float roughness1  = 0.008;
k3d/share/shaders/k3d_fur2.sl:44:	 float SPEC1  = 0.01;
k3d/share/shaders/k3d_fur2.sl:45:	 float roughness2  = 0.016;
k3d/share/shaders/k3d_fur2.sl:46:	 float SPEC2  = 0.003;
k3d/share/shaders/k3d_fur2.sl:47:	 float   start_spec = 0.3;
k3d/share/shaders/k3d_fur2.sl:48:	 float   end_spec = 0.95;
k3d/share/shaders/k3d_fur2.sl:49:	 float spec_size_fade  = 0.1;
k3d/share/shaders/k3d_fur2.sl:50:	 float illum_width  = 180;
k3d/share/shaders/k3d_fur2.sl:51:	 float var_fade_start = 0.005;
k3d/share/shaders/k3d_fur2.sl:52:	 float var_fade_end = 0.001;
k3d/share/shaders/k3d_fur2.sl:53:	 float clump_dark_strength = 0.0;
k3d/share/shaders/k3d_fur2.sl:61:	 /* Variables Passed from the rib... */
k3d/share/shaders/k3d_fur2.sl:62:	 uniform float hair_col_var  = 0.0;
k3d/share/shaders/k3d_fur2.sl:63:	 uniform float hair_length = 0.0;
k3d/share/shaders/k3d_fur2.sl:64:	 uniform normal surface_normal  = normal 1;
k3d/share/shaders/k3d_fur2.sl:66:	 uniform float hair_id   = 0.0; /* Watch Out... Across Patches */
k3d/share/shaders/k3d_fur2.sl:70:    vector T = normalize (dPdv); /* tangent along length of hair */
k3d/share/shaders/k3d_fur2.sl:72:    color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
k3d/share/shaders/k3d_fur2.sl:73:    float Kspec = Ks;
k3d/share/shaders/k3d_fur2.sl:75:    varying normal nSN = normalize( surface_normal );
k3d/share/shaders/k3d_fur2.sl:76:    vector S = nSN^T;     /* Cross product of the tangent along the hair and surface normal */
k3d/share/shaders/k3d_fur2.sl:77:    vector N_hair = (T^S); /* N_hair is a normal for the hair oriented "away" from the surface */
k3d/share/shaders/k3d_fur2.sl:79:    float  l = clamp(nSN.T,0,1);  /* Dot of surface_normal and T, used for blending */
k3d/share/shaders/k3d_fur2.sl:80:    float clump_darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:81:    float T_Dot_nL = 0;
k3d/share/shaders/k3d_fur2.sl:82:    float T_Dot_e = 0;
k3d/share/shaders/k3d_fur2.sl:83:    float Alpha = 0;
k3d/share/shaders/k3d_fur2.sl:84:    float Beta = 0;
k3d/share/shaders/k3d_fur2.sl:85:    float Kajiya = 0;
k3d/share/shaders/k3d_fur2.sl:86:    float darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:87:    varying color final_c;
k3d/share/shaders/k3d_fur2.sl:89:    /* values from light */
k3d/share/shaders/k3d_fur2.sl:90:    uniform float nonspecular = 0;
k3d/share/shaders/k3d_fur2.sl:91:    uniform color SpecularColor = 1;
k3d/share/shaders/k3d_fur2.sl:93:    /* When the hair is exactly perpendicular to the surface, use the
k3d/share/shaders/k3d_fur2.sl:94:       surface normal, when the hair is exactly tangent to the
k3d/share/shaders/k3d_fur2.sl:95:       surface, use the hair normal Otherwise, blend between the two
k3d/share/shaders/k3d_fur2.sl:96:       normals in a linear fashion 
k3d/share/shaders/k3d_fur2.sl:101:    /* Make the specular only hit in certain parts of the hair--v is
k3d/share/shaders/k3d_fur2.sl:102:       along the length of the hair 
k3d/share/shaders/k3d_fur2.sl:104:    Kspec *= min( smoothstep( start_spec, start_spec + spec_size_fade, v),  
k3d/share/shaders/k3d_fur2.sl:105:		  1 - smoothstep( end_spec, end_spec - spec_size_fade, v ) );
k3d/share/shaders/k3d_fur2.sl:108:    /* Loop over lights, catch highlights as if this was a thin cylinder,
k3d/share/shaders/k3d_fur2.sl:110:       Specular illumination model from:
k3d/share/shaders/k3d_fur2.sl:125:	/* calculate diffuse component */
k3d/share/shaders/k3d_fur2.sl:126:	if ( clump_dark_strength > 0.0 ) {
k3d/share/shaders/k3d_fur2.sl:134:	if ( lightsource("__nonspecular",nonspecular) == 0)
k3d/share/shaders/k3d_fur2.sl:136:	if ( lightsource("__SpecularColor",SpecularColor) == 0)
k3d/share/shaders/k3d_fur2.sl:143:	Cdiff += clump_darkening * fnc_diffuselgt(Cl, L, norm_hair);
k3d/share/shaders/k3d_fur2.sl:148:    darkening = (1 - (smoothstep( var_fade_end, var_fade_start, 
k3d/share/shaders/k3d_fur2.sl:149:				  abs(luminance(Kd*Cdiff))) * darkening));
k3d/share/shaders/k3d_fur2.sl:151:    final_c = mix( rootcolor, tipcolor, v ) * darkening;
k3d/share/shaders/k3d_fur2.sl:153:    Ci =  ((Ka*ambient() + Kd*Cdiff + static_ambient) * final_c
k3d/share/shaders/k3d_glass.sl:2: * glass.sl -- Shiny reflective & refractive glass, using ray tracing.
k3d/share/shaders/k3d_glass.sl:6: *   reflections and refractions of the environment.
k3d/share/shaders/k3d_glass.sl:10: *    Kr - coefficient for mirror-like reflections of environment
k3d/share/shaders/k3d_glass.sl:11: *    blur - how blurry are the reflections? (0 = perfectly sharp)
k3d/share/shaders/k3d_glass.sl:12: *    envname, envspace, envrad - controls for using environment maps
k3d/share/shaders/k3d_glass.sl:13: *    rayjitter, raysamples - ray tracing controls for reflection
k3d/share/shaders/k3d_glass.sl:14: *    Kt - coefficient for refracted transmission
k3d/share/shaders/k3d_glass.sl:15: *    transmitcolor - color of the glass
k3d/share/shaders/k3d_glass.sl:16: *    refrblur - how blurry are the refractions? (0 = perfectly sharp)
k3d/share/shaders/k3d_glass.sl:17: *    eta - the coefficient of refraction of the glass
k3d/share/shaders/k3d_glass.sl:18: *    reflrayjitter, refrraysamples - ray tracing controls for refraction
k3d/share/shaders/k3d_glass.sl:24: * Reference:
k3d/share/shaders/k3d_glass.sl:25: *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
k3d/share/shaders/k3d_glass.sl:26: *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
k3d/share/shaders/k3d_glass.sl:35:surface k3d_glass(float Ka = 0.2, Kd = 0, Ks = 0.5, roughness = 0.05;
k3d/share/shaders/k3d_glass.sl:37:		  float Kr = 1, reflblur = 0;
k3d/share/shaders/k3d_glass.sl:39:		  float Kt = 1, refrblur = 0, eta = 1.5;
k3d/share/shaders/k3d_glass.sl:41:		  float refrrayjitter = 0, refrraysamples = 1;)
k3d/share/shaders/k3d_glass.sl:43:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_glass.sl:45:    MaterialGlass(Nf, Cs, Ka, Kd, Ks, roughness, Kr, reflblur, Kt, refrblur,
k3d/share/shaders/k3d_glass.sl:46:		  eta, transmitcolor, refrrayjitter, refrraysamples,
k3d/share/shaders/k3d_gloop.sl:1:/*  IDGloop.sl written 8/99 by Ivan DeWolf
k3d/share/shaders/k3d_gloop.sl:2: *  courtesy of Rhythm & Hues  (thanks!)
k3d/share/shaders/k3d_gloop.sl:5: * an example of nonlinear displacements 
k3d/share/shaders/k3d_gloop.sl:6: * generated from the gradient of a noise function.
k3d/share/shaders/k3d_gloop.sl:8: * the "stupid renderman tricks" section of the 1998
k3d/share/shaders/k3d_gloop.sl:11: * freq - the frequency of the noise. Lower values
k3d/share/shaders/k3d_gloop.sl:13: *        have to change your displacement bounds to fit
k3d/share/shaders/k3d_gloop.sl:14: *        rhymes with freak.
k3d/share/shaders/k3d_gloop.sl:16: * magnitude - how far to displace. probably fine set where it is.
k3d/share/shaders/k3d_gloop.sl:18: * displacement bounds can be computed with the following 
k3d/share/shaders/k3d_gloop.sl:19: * wildly complex formula:
k3d/share/shaders/k3d_gloop.sl:21: * 10*magnitude/freq
k3d/share/shaders/k3d_gloop.sl:26:k3d_gloop(float freq = 5, magnitude = .2){
k3d/share/shaders/k3d_gloop.sl:29:  vector stepsize = magnitude/freq;
k3d/share/shaders/k3d_gloop.sl:30:  float numsteps = 20;
k3d/share/shaders/k3d_gloop.sl:31:  point  Psh = transform("object",P)*freq;
k3d/share/shaders/k3d_gloop.sl:32:  float  i;
k3d/share/shaders/k3d_gloop.sl:34:  vector dPduN = normalize(vtransform("object",dPdu));
k3d/share/shaders/k3d_gloop.sl:35:  vector dPdvN = normalize(vtransform("object",dPdv));
k3d/share/shaders/k3d_gloop.sl:40:  /*noise function at the point, over in u, and over in v*/
k3d/share/shaders/k3d_gloop.sl:41:  float  nz = noise(Psh)-.5;
k3d/share/shaders/k3d_gloop.sl:42:  float  nzou = noise(Pou)-.5;
k3d/share/shaders/k3d_gloop.sl:43:  float  nzov = noise(Pov)-.5;
k3d/share/shaders/k3d_gloop.sl:45:  float  chu = (nz - nzou);/*change in noise value in u*/
k3d/share/shaders/k3d_gloop.sl:46:  float  chv = (nz - nzov); 
k3d/share/shaders/k3d_gloop.sl:48:  /*init deflected derivatives*/
k3d/share/shaders/k3d_gloop.sl:55:  for(i=1;i<numsteps;i=i+1){
k3d/share/shaders/k3d_gloop.sl:56:    P -= vtransform("object","current",step)*nz*stepsize;
k3d/share/shaders/k3d_gloop.sl:62:  /* wash your hands after displacing P*/
k3d/share/shaders/k3d_glow.sl:1:surface k3d_glow(float attenuation = 2.0;
k3d/share/shaders/k3d_glow.sl:5:  float incidence, strength;
k3d/share/shaders/k3d_glow.sl:9:  if(incidence < 0)		// If this point is on the front face of the sphere
k3d/share/shaders/k3d_glow.sl:14:      // Calculate a "strength" function based on incidence
k3d/share/shaders/k3d_glow.sl:19:      // Calculate final color and opacity - we set Oi near zero
k3d/share/shaders/k3d_glow.sl:20:      // and skip pre-multiplication to get an "add" effect ...
k3d/share/shaders/k3d_gmarbtile_polish.sl:6: *   traced reflections) and cut into tiles (divided in xy texture space).
k3d/share/shaders/k3d_gmarbtile_polish.sl:10: *   Kr - reflectivity (shininess) of the surface
k3d/share/shaders/k3d_gmarbtile_polish.sl:11: *   txtscale - overall scaling for the texture
k3d/share/shaders/k3d_gmarbtile_polish.sl:12: *   darkcolor, lightcolor - colors of the underlying substrate
k3d/share/shaders/k3d_gmarbtile_polish.sl:13: *   veincolor - color of the bright veins
k3d/share/shaders/k3d_gmarbtile_polish.sl:14: *   veinfreq - controls the frequency of the veining effects
k3d/share/shaders/k3d_gmarbtile_polish.sl:16: *   groovecolor - the color of the grooves between the tiles.
k3d/share/shaders/k3d_gmarbtile_polish.sl:17: *   groovewidth - the width of the grooves
k3d/share/shaders/k3d_gmarbtile_polish.sl:25:#include "k3d_reflections.h"
k3d/share/shaders/k3d_gmarbtile_polish.sl:28:surface k3d_gmarbtile_polish(float Ka = 0.5, Kd = 0.4, Ks = 0.2;
k3d/share/shaders/k3d_gmarbtile_polish.sl:29:			     float Kr = 0.2, roughness = 0.05;
k3d/share/shaders/k3d_gmarbtile_polish.sl:31:			     float txtscale = 1;
k3d/share/shaders/k3d_gmarbtile_polish.sl:36:			     float veinfreq = 1;
k3d/share/shaders/k3d_gmarbtile_polish.sl:37:			     float sharpness = 25;
k3d/share/shaders/k3d_gmarbtile_polish.sl:38:			     float tilesize = 1;
k3d/share/shaders/k3d_gmarbtile_polish.sl:39:			     float groovewidth = 0.015;
k3d/share/shaders/k3d_gmarbtile_polish.sl:41:			     uniform float envrad = 100, rayjitter =
k3d/share/shaders/k3d_gmarbtile_polish.sl:43:			     float blur = 0;
k3d/share/shaders/k3d_gmarbtile_polish.sl:46:  vector offset;
k3d/share/shaders/k3d_gmarbtile_polish.sl:47:  vector refldir;
k3d/share/shaders/k3d_gmarbtile_polish.sl:49:  float turbsum, turb;
k3d/share/shaders/k3d_gmarbtile_polish.sl:50:  uniform float i, freq;
k3d/share/shaders/k3d_gmarbtile_polish.sl:51:  float whichs, whicht;
k3d/share/shaders/k3d_gmarbtile_polish.sl:53:  point PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_gmarbtile_polish.sl:54:  float dPP = filterwidthp(PP);
k3d/share/shaders/k3d_gmarbtile_polish.sl:56:  float ss = xcomp(PP) / tilesize;
k3d/share/shaders/k3d_gmarbtile_polish.sl:57:  float dss = filterwidth(ss);
k3d/share/shaders/k3d_gmarbtile_polish.sl:58:  float tt = ycomp(PP) / tilesize;
k3d/share/shaders/k3d_gmarbtile_polish.sl:59:  float dtt = filterwidth(tt);
k3d/share/shaders/k3d_gmarbtile_polish.sl:61:  float groovy = tilepattern(ss, tt, dss, dtt, groovewidth, groovewidth,
k3d/share/shaders/k3d_gmarbtile_polish.sl:64:  offset = vector(7 * whichs, 15 * whicht, 0 /*-23*floor(zcomp(PQ))*/ );
k3d/share/shaders/k3d_gmarbtile_polish.sl:65:  PP += offset;
k3d/share/shaders/k3d_gmarbtile_polish.sl:68:   * First calculate the underlying color of the substrate
k3d/share/shaders/k3d_gmarbtile_polish.sl:78:  PP += vector(35.2, -21.9, 6.25) + 0.5 * vfBm(PP, dPP, 6, 2, 0.5);
k3d/share/shaders/k3d_gmarbtile_polish.sl:80:  /* Now calculate the veining function for the lookup area */
k3d/share/shaders/k3d_gmarbtile_polish.sl:82:  freq = 1;
k3d/share/shaders/k3d_gmarbtile_polish.sl:83:  PP *= veinfreq;
k3d/share/shaders/k3d_gmarbtile_polish.sl:84:  dPP *= veinfreq;
k3d/share/shaders/k3d_gmarbtile_polish.sl:85:  for(i = 0; i < 3; i += 1)
k3d/share/shaders/k3d_gmarbtile_polish.sl:87:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
k3d/share/shaders/k3d_gmarbtile_polish.sl:88:      turb = pow(smoothstep(0.8, 1, 1 - turb), sharpness) / freq;
k3d/share/shaders/k3d_gmarbtile_polish.sl:90:      freq *= 2;
k3d/share/shaders/k3d_gmarbtile_polish.sl:94:	       filteredsnoise(2 * (PP + vector(-4.4, 8.34, 27.1)), 2 * dPP));
k3d/share/shaders/k3d_gmarbtile_polish.sl:100:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_gmarbtile_polish.sl:103:  env = Ks * specular(Nf, -V, roughness);
k3d/share/shaders/k3d_gmarbtile_polish.sl:104:  env += SampleEnvironment(P, reflect(V, Nf), Kr, blur, ENVPARAMS);
k3d/share/shaders/k3d_gmarbtile_polish.sl:108:  Ci = Oi * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) + env);
k3d/share/shaders/k3d_gooch.sl:1:/* Renamed to MKgooch.sl for RMR -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_gooch.sl:3:/* s_gooch.sl - a simple implementation of the Gooch
k3d/share/shaders/k3d_gooch.sl:12: *  Ka           : ambient factor
k3d/share/shaders/k3d_gooch.sl:13: *  Kd           : diffuse factor
k3d/share/shaders/k3d_gooch.sl:14: *  Ks           : specular factor
k3d/share/shaders/k3d_gooch.sl:15: *  alpha        : Gooch cool color factor
k3d/share/shaders/k3d_gooch.sl:16: *  beta         : Gooch warm color factor
k3d/share/shaders/k3d_gooch.sl:26:surface
k3d/share/shaders/k3d_gooch.sl:27:k3d_gooch (float Ka = 0;
k3d/share/shaders/k3d_gooch.sl:28:         float Kd = 1;
k3d/share/shaders/k3d_gooch.sl:29:         float Ks = 0;
k3d/share/shaders/k3d_gooch.sl:30:         float alpha = .25;
k3d/share/shaders/k3d_gooch.sl:31:         float beta = .5;
k3d/share/shaders/k3d_gooch.sl:32:         float b = .55;
k3d/share/shaders/k3d_gooch.sl:33:         float y = .3;
k3d/share/shaders/k3d_gooch.sl:34:         float roughness = .1;
k3d/share/shaders/k3d_gooch.sl:37:    normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_gooch.sl:42:    float ldotn, blendval;
k3d/share/shaders/k3d_gooch.sl:47:    illuminance(P,Nf,PI) {
k3d/share/shaders/k3d_gooch.sl:48:        ldotn = (normalize(L)).Nf;
k3d/share/shaders/k3d_gooch.sl:56:                specularcolor*Ks*specular(Nf,-normalize(I),roughness)));
k3d/share/shaders/k3d_gouge.sl:3:/* Listing 16.32  Displacement shader for beating up a surface with a texture  */
k3d/share/shaders/k3d_gouge.sl:6: * gouge(): Use a texture map to displace a surface.
k3d/share/shaders/k3d_gouge.sl:10:	float	Km	= 0.03,
k3d/share/shaders/k3d_gouge.sl:14:	float	y = ycomp(transform("object",P));	/* convert to object space	 */
k3d/share/shaders/k3d_gouge.sl:16:   /* Use the same texture map that the surface shader uses. Spin it a different
k3d/share/shaders/k3d_gouge.sl:17:    *  amount for each pin so that similarity is not detected.  The texture 
k3d/share/shaders/k3d_gouge.sl:18:    *  determines the size of the gouge. Multiply by the Km factor, then 
k3d/share/shaders/k3d_gouge.sl:19:    *  displace the surface point inwards by that amount. 
k3d/share/shaders/k3d_gouge.sl:22:   if( texturename != "") 
k3d/share/shaders/k3d_gradient_t.sl:1:surface k3d_gradient_t(
k3d/share/shaders/k3d_gradient_t.sl:4:	float additive = 0.0;
k3d/share/shaders/k3d_gradient_t.sl:9:	if(additive != 0.0)
k3d/share/shaders/k3d_granite.sl:3:/* Listing 16.18  Surface shader for granite-like surface*/
k3d/share/shaders/k3d_granite.sl:6: * granite(): Provide a diffuse granite-like surface texture. 
k3d/share/shaders/k3d_granite.sl:8:surface 
k3d/share/shaders/k3d_granite.sl:10:	float	Kd	= .8,
k3d/share/shaders/k3d_granite.sl:13:	float sum = 0;
k3d/share/shaders/k3d_granite.sl:14:	float i, freq = 1.0; /* Try other values for example, 7.0 */
k3d/share/shaders/k3d_granite.sl:16:	for (i = 0; i < 6; i = i + 1) {
k3d/share/shaders/k3d_granite.sl:17:		sum = sum + abs(.5 - noise( 4 * freq * I))/freq ;
k3d/share/shaders/k3d_granite.sl:18:		freq *= 2;
k3d/share/shaders/k3d_granite.sl:20:	Ci = Cs * sum * (Ka + Kd * diffuse(faceforward( normalize(N), I )) ) ;
k3d/share/shaders/k3d_graphic_lines.sl:1:surface k3d_graphic_lines (
k3d/share/shaders/k3d_graphic_lines.sl:3:        float Ka=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:4:        float Kd=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:5:        float Ks=0.6;
k3d/share/shaders/k3d_graphic_lines.sl:6:        float roughness=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:7:        float paint_spec=0.6;
k3d/share/shaders/k3d_graphic_lines.sl:8:        float paint_trans=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:9:        float paint_fuzz=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:10:        float ink_thresh=0.10;
k3d/share/shaders/k3d_graphic_lines.sl:11:        float ink_fuzz=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:12:				float line_scale_master=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:15:        float line_scale_highlight=16.0;
k3d/share/shaders/k3d_graphic_lines.sl:16:        float contrast_highlight=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:17:        float brightness_highlight=0.5;
k3d/share/shaders/k3d_graphic_lines.sl:18:        float randomness_highlight=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:19:        float noise_size_highlight=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:26:        float surface_opac_highlight=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:27:        float surface_trans_highlight=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:28:        float fuzz_highlight=0.3;
k3d/share/shaders/k3d_graphic_lines.sl:29:				float tfreq_highlight=50;
k3d/share/shaders/k3d_graphic_lines.sl:31:				float illumination_highlight=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:32:				float Ka_highlight=0.10;
k3d/share/shaders/k3d_graphic_lines.sl:33:				float Kd_highlight=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:34:				float Ks_highlight=0.20;
k3d/share/shaders/k3d_graphic_lines.sl:35:				float roughness_highlight=0.2;
k3d/share/shaders/k3d_graphic_lines.sl:38:        float line_scale_paint=16.0;
k3d/share/shaders/k3d_graphic_lines.sl:39:        float contrast_paint=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:40:        float brightness_paint=0.3;
k3d/share/shaders/k3d_graphic_lines.sl:41:        float randomness_paint=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:42:        float noise_size_paint=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:49:        float surface_opac_paint=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:50:        float surface_trans_paint=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:51:				float fuzz_paint=0.3;
k3d/share/shaders/k3d_graphic_lines.sl:52:				float tfreq_paint=50;
k3d/share/shaders/k3d_graphic_lines.sl:54:				float illumination_paint=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:55:				float Ka_paint=0.10;
k3d/share/shaders/k3d_graphic_lines.sl:56:				float Kd_paint=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:57:				float Ks_paint=0.20;
k3d/share/shaders/k3d_graphic_lines.sl:58:				float roughness_paint=0.2;
k3d/share/shaders/k3d_graphic_lines.sl:61:        float line_scale_ink=16.0;
k3d/share/shaders/k3d_graphic_lines.sl:62:        float contrast_ink=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:63:        float brightness_ink=0.5;
k3d/share/shaders/k3d_graphic_lines.sl:64:        float randomness_ink=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:65:        float noise_size_ink=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:72:        float surface_opac_ink=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:73:        float surface_trans_ink=1.0; 
k3d/share/shaders/k3d_graphic_lines.sl:74:				float fuzz_ink=0.3;
k3d/share/shaders/k3d_graphic_lines.sl:75:				float tfreq_ink=50;
k3d/share/shaders/k3d_graphic_lines.sl:77:				float illumination_ink=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:78:				float Ka_ink=0.10;
k3d/share/shaders/k3d_graphic_lines.sl:79:				float Kd_ink=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:80:				float Ks_ink=0.20;
k3d/share/shaders/k3d_graphic_lines.sl:81:				float roughness_ink=0.2;
k3d/share/shaders/k3d_graphic_lines.sl:84:	/** Surface main-code start **/
k3d/share/shaders/k3d_graphic_lines.sl:93:	color surface_color_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:97:	float stripemin_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:98:	float stripemax_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:99:	float tt_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:100:	float x_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:101:	float y_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:102:	float z_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:103:	float i_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:104:	float n_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:105:	float ns_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:106:	vector Nf_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:109:	Psh_highlight=transform("shader",P_highlight);
k3d/share/shaders/k3d_graphic_lines.sl:110:	Nf_highlight=faceforward(normalize(N_highlight),I);
k3d/share/shaders/k3d_graphic_lines.sl:114:	if (up_highlight == "z")
k3d/share/shaders/k3d_graphic_lines.sl:119:	else if (up_highlight == "y")
k3d/share/shaders/k3d_graphic_lines.sl:128:	illumcolor_highlight=(Ka_highlight*ambient()+Kd_highlight*diffuse(Nf_highlight)+Ks_highlight*specular(Nf_highlight,V_highlight,roughness_highlight));
k3d/share/shaders/k3d_graphic_lines.sl:133:	for (i_highlight=0; i_highlight<6.0 ;i_highlight+=1.0){
k3d/share/shaders/k3d_graphic_lines.sl:138:	if (illumination_highlight<0.01)
k3d/share/shaders/k3d_graphic_lines.sl:139:	{surface_color_highlight=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:142:	else if (illumination_highlight>0.99)
k3d/share/shaders/k3d_graphic_lines.sl:143:	{surface_color_highlight=color(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:146:	else {surface_color_highlight=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:151:	float val_highlight=(smoothstep((stripemin_highlight)-(fuzz_highlight),(stripemin_highlight),(tt_highlight))-smoothstep((stripemax_highlight)-(fuzz_highlight),(stripemax_highlight),(tt_highlight)));
k3d/share/shaders/k3d_graphic_lines.sl:153:	surface_color_highlight=((surface_color_highlight)*(1-(layer_opac_highlight))+(layer_color_highlight)*(layer_opac_highlight));
k3d/share/shaders/k3d_graphic_lines.sl:154:	float color_val_highlight=mix(0.0,1.0,val_highlight);
k3d/share/shaders/k3d_graphic_lines.sl:156:	float spacescale_highlight=length(vtransform("shader",normalize(N_highlight)));
k3d/share/shaders/k3d_graphic_lines.sl:161:	Ci_highlight=surface_opac_highlight*color_curve_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:162:	Oi_highlight=surface_trans_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:171:	color surface_color_paint;
k3d/share/shaders/k3d_graphic_lines.sl:175:	float stripemin_paint;
k3d/share/shaders/k3d_graphic_lines.sl:176:	float stripemax_paint;
k3d/share/shaders/k3d_graphic_lines.sl:177:	float tt_paint;
k3d/share/shaders/k3d_graphic_lines.sl:178:	float x_paint;
k3d/share/shaders/k3d_graphic_lines.sl:179:	float y_paint;
k3d/share/shaders/k3d_graphic_lines.sl:180:	float z_paint;
k3d/share/shaders/k3d_graphic_lines.sl:181:	float i_paint;
k3d/share/shaders/k3d_graphic_lines.sl:182:	float n_paint;
k3d/share/shaders/k3d_graphic_lines.sl:183:	float ns_paint;
k3d/share/shaders/k3d_graphic_lines.sl:184:	vector Nf_paint;
k3d/share/shaders/k3d_graphic_lines.sl:187:	Psh_paint=transform("shader",P_paint);
k3d/share/shaders/k3d_graphic_lines.sl:188:	Nf_paint=faceforward(normalize(N_paint),I);
k3d/share/shaders/k3d_graphic_lines.sl:190:	if (up_paint == "z")
k3d/share/shaders/k3d_graphic_lines.sl:195:	else if (up_paint == "y")
k3d/share/shaders/k3d_graphic_lines.sl:203:	}illumcolor_paint=(Ka_paint*ambient()+Kd_paint*diffuse(Nf_paint)+Ks_paint*specular(Nf_paint,V_paint,roughness_paint));
k3d/share/shaders/k3d_graphic_lines.sl:207:	for ( i_paint=0; i_paint<6.0 ; i_paint+=1.0 ){
k3d/share/shaders/k3d_graphic_lines.sl:212:	if (illumination_paint<0.01)
k3d/share/shaders/k3d_graphic_lines.sl:213:	{surface_color_paint=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:216:	else if (illumination_paint>0.99)
k3d/share/shaders/k3d_graphic_lines.sl:217:	{surface_color_paint=color(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:220:	else {surface_color_paint=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:224:	float val1=(smoothstep((stripemin_paint)-(fuzz_paint),(stripemin_paint),(tt_paint))-smoothstep((stripemax_paint)-(fuzz_paint),(stripemax_paint),(tt_paint)));
k3d/share/shaders/k3d_graphic_lines.sl:226:	surface_color_paint=((surface_color_paint)*(1-(layer_opac_paint))+(layer_color_paint)*(layer_opac_paint));
k3d/share/shaders/k3d_graphic_lines.sl:227:	float color_val1=mix(0.0,1.0,val1);
k3d/share/shaders/k3d_graphic_lines.sl:229:	float spacescale1=length(vtransform("shader",normalize(N_paint)));
k3d/share/shaders/k3d_graphic_lines.sl:233:	Ci_paint=surface_opac_paint*color_curve_paint;
k3d/share/shaders/k3d_graphic_lines.sl:234:	Oi_paint=surface_trans_paint;
k3d/share/shaders/k3d_graphic_lines.sl:243:	color surface_color_ink;
k3d/share/shaders/k3d_graphic_lines.sl:247:	float stripemin_ink;
k3d/share/shaders/k3d_graphic_lines.sl:248:	float stripemax_ink;
k3d/share/shaders/k3d_graphic_lines.sl:249:	float tt_ink;
k3d/share/shaders/k3d_graphic_lines.sl:250:	float x_ink;
k3d/share/shaders/k3d_graphic_lines.sl:251:	float y_ink;
k3d/share/shaders/k3d_graphic_lines.sl:252:	float z_ink;
k3d/share/shaders/k3d_graphic_lines.sl:253:	float i_ink;
k3d/share/shaders/k3d_graphic_lines.sl:254:	float n_ink;
k3d/share/shaders/k3d_graphic_lines.sl:255:	float ns_ink;
k3d/share/shaders/k3d_graphic_lines.sl:256:	vector Nf_ink;
k3d/share/shaders/k3d_graphic_lines.sl:259:	Psh_ink=transform("shader",P_ink);
k3d/share/shaders/k3d_graphic_lines.sl:260:	Nf_ink=faceforward(normalize(N_ink),I);
k3d/share/shaders/k3d_graphic_lines.sl:262:	if (up_ink == "z")
k3d/share/shaders/k3d_graphic_lines.sl:267:	else if (up_ink == "y")
k3d/share/shaders/k3d_graphic_lines.sl:275:	}illumcolor_ink=(Ka_ink*ambient()+Kd_ink*diffuse(Nf_ink)+Ks_ink*specular(Nf_ink,V_ink,roughness_ink));
k3d/share/shaders/k3d_graphic_lines.sl:279:	for ( i_ink=0; i_ink<6.0; i_ink+=1.0 ){
k3d/share/shaders/k3d_graphic_lines.sl:284:	if (illumination_ink<0.01)
k3d/share/shaders/k3d_graphic_lines.sl:285:	{surface_color_ink=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:288:	else if (illumination_ink>0.99)
k3d/share/shaders/k3d_graphic_lines.sl:289:	{surface_color_ink=color(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:292:	else {surface_color_ink=color(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:296:	float val2=(smoothstep((stripemin_ink)-(fuzz_ink),(stripemin_ink),(tt_ink))-smoothstep((stripemax_ink)-(fuzz_ink),(stripemax_ink),(tt_ink)));
k3d/share/shaders/k3d_graphic_lines.sl:298:	surface_color_ink=((surface_color_ink)*(1-(layer_opac_ink))+(layer_color_ink)*(layer_opac_ink));
k3d/share/shaders/k3d_graphic_lines.sl:299:	float color_val2=mix(0.0,1.0,val2);
k3d/share/shaders/k3d_graphic_lines.sl:301:	float spacescale2=length(vtransform("shader",normalize(N_ink)));
k3d/share/shaders/k3d_graphic_lines.sl:305:	Ci_ink=surface_opac_ink*color_curve_ink;
k3d/share/shaders/k3d_graphic_lines.sl:306:	Oi_ink=surface_trans_ink;
k3d/share/shaders/k3d_graphic_lines.sl:310:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_graphic_lines.sl:311:#define union(a,b) ((a) + (b) - (a) * (b))
k3d/share/shaders/k3d_graphic_lines.sl:313:	float
k3d/share/shaders/k3d_graphic_lines.sl:314:	glinespec(vector N, V; float roughness)
k3d/share/shaders/k3d_graphic_lines.sl:316:		float C = 0;
k3d/share/shaders/k3d_graphic_lines.sl:326:	float cos_here;
k3d/share/shaders/k3d_graphic_lines.sl:327:	float diff, spec;
k3d/share/shaders/k3d_graphic_lines.sl:328:	normal Nf;
k3d/share/shaders/k3d_graphic_lines.sl:329:	vector normI, half;
k3d/share/shaders/k3d_graphic_lines.sl:334:	Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_graphic_lines.sl:344:	diff = 0;
k3d/share/shaders/k3d_graphic_lines.sl:345:	illuminance(P, Nf, PI/2)
k3d/share/shaders/k3d_graphic_lines.sl:346:	diff += normalize(L).Nf;
k3d/share/shaders/k3d_graphic_lines.sl:349:	diff = smoothstep(paint_trans - paint_fuzz/2, paint_trans + paint_fuzz/2, diff);
k3d/share/shaders/k3d_graphic_lines.sl:352:	spec = glinespec(Nf, -normalize(I), roughness);
k3d/share/shaders/k3d_graphic_lines.sl:353:	spec = smoothstep(paint_spec - paint_fuzz/2, paint_spec + paint_fuzz/2, spec);
k3d/share/shaders/k3d_graphic_lines.sl:355:	layer_color = Cs*(Kd*diff*Ci_paint + Ka*ambient()) + Ci_highlight*Ks*spec;
k3d/share/shaders/k3d_graphic_lines.sl:363:	cos_here = normalize(Nf).normI;
k3d/share/shaders/k3d_graphic_lines.sl:366:	layer_opac = 1 - smoothstep(ink_thresh - ink_fuzz/2, ink_thresh + ink_fuzz/2, abs(cos_here));
k3d/share/shaders/k3d_graphic_lines.sl:368:	if (abs(cos_here) < ink_thresh)
k3d/share/shaders/k3d_graphic_lines.sl:379:	/** Surface main-code end **/
k3d/share/shaders/k3d_grass_displace.sl:4: * I took used some of RManNotes function to assist in

k3d/share/shaders/k3d_grass_displace.sl:7: * This is simply uses the noise function and a checkerboard

k3d/share/shaders/k3d_grass_displace.sl:16:k3d_grass_displace ( float height = 1.0,

k3d/share/shaders/k3d_grass_displace.sl:17:              fac = 1.0,

k3d/share/shaders/k3d_grass_displace.sl:22:  float noifreq = 5;

k3d/share/shaders/k3d_grass_displace.sl:23:  float noiscale = 0.4;

k3d/share/shaders/k3d_grass_displace.sl:24:  float ss, tt;

k3d/share/shaders/k3d_grass_displace.sl:26:  float noi = noise(s * noifreq, t * noifreq);

k3d/share/shaders/k3d_grass_displace.sl:30:  float smod = mod(ss*fac,1),

k3d/share/shaders/k3d_grass_displace.sl:31:        tmod = mod(tt*fac,1),

k3d/share/shaders/k3d_grass_displace.sl:34:  if (smod < 0.5) {

k3d/share/shaders/k3d_grass_displace.sl:35:    if (tmod < 0.5) 

k3d/share/shaders/k3d_grass_displace.sl:43:      if (z <= size2 )

k3d/share/shaders/k3d_grass_displace.sl:49:    if (tmod < 0.5) {

k3d/share/shaders/k3d_grass_displace.sl:55:      if (z <= size )

k3d/share/shaders/k3d_grass_surface.sl:2: * Again, similar structure of grass.sl

k3d/share/shaders/k3d_grass_surface.sl:9:surface

k3d/share/shaders/k3d_grass_surface.sl:10:k3d_grass_surface ( float height = 1.0, Ka=0.5, Kd=0.1, Ks= 1, roughness = 0.25,

k3d/share/shaders/k3d_grass_surface.sl:11:              fac = 1.0,

k3d/share/shaders/k3d_grass_surface.sl:17:  point Nf = faceforward(normalize(N),I);

k3d/share/shaders/k3d_grass_surface.sl:19:  float noifreq = 5;

k3d/share/shaders/k3d_grass_surface.sl:20:  float noiscale = 0.4;

k3d/share/shaders/k3d_grass_surface.sl:21:  float ss, tt;

k3d/share/shaders/k3d_grass_surface.sl:23:  float noi = noise(s * noifreq, t * noifreq);

k3d/share/shaders/k3d_grass_surface.sl:27:  float smod = mod(ss*fac,1),

k3d/share/shaders/k3d_grass_surface.sl:28:        tmod = mod(tt*fac,1);

k3d/share/shaders/k3d_grass_surface.sl:30:  if (smod > tmod) {

k3d/share/shaders/k3d_grass_surface.sl:31:    if (smod < 0.5) {

k3d/share/shaders/k3d_grass_surface.sl:32:      float d, fuzz = 0.025;

k3d/share/shaders/k3d_grass_surface.sl:33:      point center = (0.5, 0.5, 0);  /* location of center of disk */

k3d/share/shaders/k3d_grass_surface.sl:34:      float radius = 0.35;           /* radius of disk */

k3d/share/shaders/k3d_grass_surface.sl:36:      color layer_opac = 1 - smoothstep(radius - fuzz, radius, d);

k3d/share/shaders/k3d_grass_surface.sl:46:  Ci = Ci * (Ka *ambient() + Kd * diffuse(Nf) + Ks* specular(Nf,-I,roughness));

k3d/share/shaders/k3d_greenmarble.sl:2: * greenmarble.sl -- RenderMan compatible shader for green veined marble.
k3d/share/shaders/k3d_greenmarble.sl:5: *   Makes a marble-like surface using a turbulence function.
k3d/share/shaders/k3d_greenmarble.sl:9: *   txtscale - overall scaling for the texture
k3d/share/shaders/k3d_greenmarble.sl:10: *   darkcolor, lightcolor - colors of the underlying substrate
k3d/share/shaders/k3d_greenmarble.sl:11: *   veincolor - color of the bright veins
k3d/share/shaders/k3d_greenmarble.sl:12: *   veinfreq - controls the frequency of the veining effects
k3d/share/shaders/k3d_greenmarble.sl:25:surface k3d_greenmarble(float Ka = 0.1, Kd = 0.6, Ks = 0.4, roughness = 0.1;
k3d/share/shaders/k3d_greenmarble.sl:30:			float veinfreq = 1;
k3d/share/shaders/k3d_greenmarble.sl:31:			float sharpness = 25; float txtscale = 1;
k3d/share/shaders/k3d_greenmarble.sl:35:  float freq;
k3d/share/shaders/k3d_greenmarble.sl:36:  float turbsum, turb, i;
k3d/share/shaders/k3d_greenmarble.sl:38:  point PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_greenmarble.sl:39:  float dPP = filterwidthp(PP);
k3d/share/shaders/k3d_greenmarble.sl:42:   * First calculate the underlying color of the substrate
k3d/share/shaders/k3d_greenmarble.sl:43:   *    Use turbulence - use frequency clamping
k3d/share/shaders/k3d_greenmarble.sl:53:  PP += vector(35.2, -21.9, 6.25) + 0.5 * vfBm(PP, dPP, 6, 2, 0.5);
k3d/share/shaders/k3d_greenmarble.sl:55:  /* Now calculate the veining function for the lookup area */
k3d/share/shaders/k3d_greenmarble.sl:57:  freq = 1;
k3d/share/shaders/k3d_greenmarble.sl:58:  PP *= veinfreq;
k3d/share/shaders/k3d_greenmarble.sl:59:  for(i = 0; i < 3; i += 1)
k3d/share/shaders/k3d_greenmarble.sl:61:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
k3d/share/shaders/k3d_greenmarble.sl:62:      turb = pow(smoothstep(0.8, 1, 1 - turb), sharpness) / freq;
k3d/share/shaders/k3d_greenmarble.sl:64:      freq *= 2;
k3d/share/shaders/k3d_greenmarble.sl:74:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_greenmarble.sl:75:  Ci = MaterialPlastic(Nf, Ct, Ka, Kd, Ks, roughness);
k3d/share/shaders/k3d_grids.sl:3:surface k3d_grids (
k3d/share/shaders/k3d_grids.sl:5:float K_ambient=0.993; 
k3d/share/shaders/k3d_grids.sl:6:float K_diffuse=0.381; 
k3d/share/shaders/k3d_grids.sl:7:float K_specular=0.269; 
k3d/share/shaders/k3d_grids.sl:8:float roughness=0.0373; 
k3d/share/shaders/k3d_grids.sl:12:float G1L1_freq=33.2; 
k3d/share/shaders/k3d_grids.sl:13:float G1L1_rotation=46.3; 
k3d/share/shaders/k3d_grids.sl:14:float G1L1_fuzz=0.453; 
k3d/share/shaders/k3d_grids.sl:15:float G1L1_linewidth=0.579; 
k3d/share/shaders/k3d_grids.sl:16:float G1L1_Randomness=0;
k3d/share/shaders/k3d_grids.sl:17:color G1L1_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:20:float G1L2_freq=6.87; 
k3d/share/shaders/k3d_grids.sl:21:float G1L2_rotation=42.4; 
k3d/share/shaders/k3d_grids.sl:22:float G1L2_fuzz=0.363; 
k3d/share/shaders/k3d_grids.sl:23:float G1L2_linewidth=0.209; 
k3d/share/shaders/k3d_grids.sl:24:float G1L2_Randomness=0;
k3d/share/shaders/k3d_grids.sl:25:color G1L2_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:28:float G2L1_freq=10.4; 
k3d/share/shaders/k3d_grids.sl:29:float G2L1_rotation=0.162; 
k3d/share/shaders/k3d_grids.sl:30:float G2L1_fuzz=0.0655; 
k3d/share/shaders/k3d_grids.sl:31:float G2L1_linewidth=0.281; 
k3d/share/shaders/k3d_grids.sl:32:float G2L1_Randomness=0;
k3d/share/shaders/k3d_grids.sl:33:color G2L1_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:36:float G2L2_freq=16.7; 
k3d/share/shaders/k3d_grids.sl:37:float G2L2_rotation=44.2; 
k3d/share/shaders/k3d_grids.sl:38:float G2L2_fuzz=0.306; 
k3d/share/shaders/k3d_grids.sl:39:float G2L2_linewidth=0.149; 
k3d/share/shaders/k3d_grids.sl:40:float G2L2_Randomness=0;
k3d/share/shaders/k3d_grids.sl:41:color G2L2_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:45:/** Surface main-code start **/
k3d/share/shaders/k3d_grids.sl:47:#define repeat(x,freq) (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_grids.sl:48:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids.sl:49:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids.sl:50:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids.sl:51:#define snoise(x) (2*noise(x)-1) 
k3d/share/shaders/k3d_grids.sl:53:float G1L1_ss, G1L1_tt;
k3d/share/shaders/k3d_grids.sl:54:float G1L2_ss, G1L2_tt;
k3d/share/shaders/k3d_grids.sl:55:float G2L1_ss, G2L1_tt;
k3d/share/shaders/k3d_grids.sl:56:float G2L2_ss, G2L2_tt;
k3d/share/shaders/k3d_grids.sl:57:float blend_val=0.5; 
k3d/share/shaders/k3d_grids.sl:62:G1L1_ss = repeat(G1L1_ss, G1L1_freq);
k3d/share/shaders/k3d_grids.sl:63:G1L1_tt = repeat(G1L1_tt, G1L1_freq);
k3d/share/shaders/k3d_grids.sl:65:color G1L1_layer_opac = pulse(G1L1_linewidth, 1-G1L1_linewidth, G1L1_fuzz, G1L1_tt);
k3d/share/shaders/k3d_grids.sl:66:color G1L1_Ct = blend(G1L1_SurfaceColor, G1L1_GridColor, G1L1_layer_opac);
k3d/share/shaders/k3d_grids.sl:70:G1L2_ss = repeat(G1L2_ss, G1L2_freq);
k3d/share/shaders/k3d_grids.sl:71:G1L2_tt = repeat(G1L2_tt, G1L2_freq);
k3d/share/shaders/k3d_grids.sl:73:color G1L2_layer_opac = pulse(G1L2_linewidth, 1-G1L2_linewidth, G1L2_fuzz, G1L2_tt);
k3d/share/shaders/k3d_grids.sl:74:color G1L2_Ct = blend(G1L2_SurfaceColor, G1L2_GridColor, G1L2_layer_opac);
k3d/share/shaders/k3d_grids.sl:75:normal G1_Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_grids.sl:81:G2L1_ss = repeat(G2L1_ss, G2L1_freq);
k3d/share/shaders/k3d_grids.sl:82:G2L1_tt = repeat(G2L1_tt, G2L1_freq);
k3d/share/shaders/k3d_grids.sl:84:color G2L1_layer_opac = pulse(G2L1_linewidth, 1-G2L1_linewidth, G2L1_fuzz, G2L1_tt);
k3d/share/shaders/k3d_grids.sl:85:color G2L1_Ct = blend(G2L1_SurfaceColor, G2L1_GridColor, G2L1_layer_opac);
k3d/share/shaders/k3d_grids.sl:89:G2L2_ss = repeat(G2L2_ss, G2L2_freq);
k3d/share/shaders/k3d_grids.sl:90:G2L2_tt = repeat(G2L2_tt, G2L2_freq);
k3d/share/shaders/k3d_grids.sl:92:color G2L2_layer_opac = pulse(G2L2_linewidth, 1-G2L2_linewidth, G2L2_fuzz, G2L2_tt);
k3d/share/shaders/k3d_grids.sl:93:color G2L2_Ct = blend(G2L2_SurfaceColor, G2L2_GridColor, G2L2_layer_opac);
k3d/share/shaders/k3d_grids.sl:95:/** Surface main-code end **/
k3d/share/shaders/k3d_grids.sl:97:Ci = (blend_val*G1L1_Ct+(1-blend_val)*G1L2_Ct) * (ambientcolor * K_ambient * ambient() + K_diffuse * diffuse(G1_Nf)) + 
k3d/share/shaders/k3d_grids.sl:98:specularcolor * K_specular * phong(G1_Nf, G1_V, 1/roughness);
k3d/share/shaders/k3d_grids_disp.sl:4: Displace (normal dir; float amp; float truedisp;)
k3d/share/shaders/k3d_grids_disp.sl:7: float spacescale = length(vtransform("shader", dir));
k3d/share/shaders/k3d_grids_disp.sl:14:float freq0=22.2; 
k3d/share/shaders/k3d_grids_disp.sl:15:float rotation0=26.5; 
k3d/share/shaders/k3d_grids_disp.sl:16:float fuzz0=0.136; 
k3d/share/shaders/k3d_grids_disp.sl:17:float linewidth0=0.368; 
k3d/share/shaders/k3d_grids_disp.sl:18:color SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids_disp.sl:20:float freq1=44.9; 
k3d/share/shaders/k3d_grids_disp.sl:21:float rotation1=61.8; 
k3d/share/shaders/k3d_grids_disp.sl:22:float fuzz1=0.269; 
k3d/share/shaders/k3d_grids_disp.sl:23:float linewidth1=0.122; )
k3d/share/shaders/k3d_grids_disp.sl:26:#define repeat(x,freq) (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_grids_disp.sl:27:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids_disp.sl:28:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids_disp.sl:29:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids_disp.sl:31:float ss0, tt0;
k3d/share/shaders/k3d_grids_disp.sl:34:ss0 = repeat(ss0, freq0);
k3d/share/shaders/k3d_grids_disp.sl:35:tt0 = repeat(tt0, freq0);
k3d/share/shaders/k3d_grids_disp.sl:37:color layer_opac0 = pulse(linewidth0, 1-linewidth0, fuzz0, tt0);
k3d/share/shaders/k3d_grids_disp.sl:38:color Ct0 = blend(SurfaceColor, GridColor, layer_opac0);
k3d/share/shaders/k3d_grids_disp.sl:39:#define repeat(x,freq) (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_grids_disp.sl:40:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids_disp.sl:41:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids_disp.sl:42:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids_disp.sl:44:float ss1, tt1;
k3d/share/shaders/k3d_grids_disp.sl:47:ss1 = repeat(ss1, freq1);
k3d/share/shaders/k3d_grids_disp.sl:48:tt1 = repeat(tt1, freq1);
k3d/share/shaders/k3d_grids_disp.sl:50:color layer_opac1 = pulse(linewidth1, 1-linewidth1, fuzz1, tt1);
k3d/share/shaders/k3d_grids_disp.sl:51:color Ct1 = blend(SurfaceColor, GridColor, layer_opac1);
k3d/share/shaders/k3d_grids_disp.sl:52:float x=0.5; 
k3d/share/shaders/k3d_grids_disp.sl:54:float temp_f_2=(comp((x*Ct0+(1-x)*Ct1),0)+comp((x*Ct0+(1-x)*Ct1),1)+comp((x*Ct0+(1-x)*Ct1),2))/3;
k3d/share/shaders/k3d_grids_disp.sl:55: N = Displace(normalize(N),0.05*temp_f_2,0);
k3d/share/shaders/k3d_hair.sl:3:surface k3d_hair(
k3d/share/shaders/k3d_hair.sl:4:	float Ka = 1;
k3d/share/shaders/k3d_hair.sl:5:	float Kd = .6;
k3d/share/shaders/k3d_hair.sl:6:	float Ks = .35;
k3d/share/shaders/k3d_hair.sl:7:	float roughness = .15;
k3d/share/shaders/k3d_hair.sl:13:	vector T = normalize (dPdv); /* tangent along length of hair */
k3d/share/shaders/k3d_hair.sl:15:	color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
k3d/share/shaders/k3d_hair.sl:16:	float cosang;
k3d/share/shaders/k3d_hair.sl:18:	/* Loop over lights, catch highlights as if this was a thin cylinder */
k3d/share/shaders/k3d_hair.sl:23:			Cdiff += Cl * v;
k3d/share/shaders/k3d_hair.sl:29:	Ci = Oi * (mix(rootcolor, tipcolor, v) * (Ka*ambient() + Kd * Cdiff) + (Ks * Cspec * specularcolor));
k3d/share/shaders/k3d_hdr_light.sl:2:* to work with 32 bit floating point TIFF environment maps to give a higher

k3d/share/shaders/k3d_hdr_light.sl:8:*This shader is made freely available under the proviso that this copyright

k3d/share/shaders/k3d_hdr_light.sl:10:*post links back to the above address*or get in contact if you have any queries

k3d/share/shaders/k3d_hdr_light.sl:16:color hdrenv(string envname;vector R;float blur)

k3d/share/shaders/k3d_hdr_light.sl:20:	vector D = normalize(vtransform("world",R));

k3d/share/shaders/k3d_hdr_light.sl:22:	float Dx = xcomp(D);

k3d/share/shaders/k3d_hdr_light.sl:23:	float Dy = ycomp(D);

k3d/share/shaders/k3d_hdr_light.sl:24:	float Dz = zcomp(D);

k3d/share/shaders/k3d_hdr_light.sl:26:	float r = 0.159154943 * acos(Dz) / sqrt((Dx * Dx) + (Dy * Dy));

k3d/share/shaders/k3d_hdr_light.sl:28:	float ss = 0.5 + (Dx * r);

k3d/share/shaders/k3d_hdr_light.sl:29:	float tt = 0.5 + (Dy * r);

k3d/share/shaders/k3d_hdr_light.sl:32:	if(envname !="") {

k3d/share/shaders/k3d_hdr_light.sl:41:	float intensity =1.0;

k3d/share/shaders/k3d_hdr_light.sl:42:	float exposure_compensation_stops = 0.0;

k3d/share/shaders/k3d_hdr_light.sl:47:	float blur = 0.0;

k3d/share/shaders/k3d_hdr_light.sl:48:	float shadowmapping = 0.0;

k3d/share/shaders/k3d_hdr_light.sl:50:	float shadowsamples = 16.0;

k3d/share/shaders/k3d_hdr_light.sl:51:	float shadowblur = 0.0;

k3d/share/shaders/k3d_hdr_light.sl:52:	float shadowbias = 0.0;

k3d/share/shaders/k3d_hdr_light.sl:56:/* Code based off of Larry Gritz's Uberlight Shader */

k3d/share/shaders/k3d_hdr_light.sl:57:#ifdef BMRT

k3d/share/shaders/k3d_hdr_light.sl:61:#endif

k3d/share/shaders/k3d_hdr_light.sl:66:		/*Use light ray direction as map lookup NB L points from surface to lightsource*/

k3d/share/shaders/k3d_hdr_light.sl:67:		vector R = normalize(vtransform(envspace,L));

k3d/share/shaders/k3d_hdr_light.sl:69:		/*Else bright red colour warns if light is not picking up texture*/

k3d/share/shaders/k3d_hdr_light.sl:70:		if (mappingtype == ""){

k3d/share/shaders/k3d_hdr_light.sl:72:			printf("Please select mapping type probe,environment or planar");

k3d/share/shaders/k3d_hdr_light.sl:75:		if (mappingtype == "probe"){

k3d/share/shaders/k3d_hdr_light.sl:76:			if(envname != ""){

k3d/share/shaders/k3d_hdr_light.sl:80:		else if (mappingtype == "environment"){

k3d/share/shaders/k3d_hdr_light.sl:81:			if(envname != ""){

k3d/share/shaders/k3d_hdr_light.sl:85:		else if (mappingtype == "planar"){

k3d/share/shaders/k3d_hdr_light.sl:86:			if(envname != ""){

k3d/share/shaders/k3d_hdr_light.sl:91:		float exposure = pow(2,exposure_compensation_stops);

k3d/share/shaders/k3d_hdr_light.sl:93:		if (shadowmapping == 1){

k3d/share/shaders/k3d_hdr_light.sl:94:		        if (shadowname != "") {

k3d/share/shaders/k3d_hdr_surface.sl:2:* to work with 32 bit floating point TIFF environment maps to give a higher 

k3d/share/shaders/k3d_hdr_surface.sl:8:*This shader is made freely available under the proviso that this copyright

k3d/share/shaders/k3d_hdr_surface.sl:10:*post links back to the above address*or get in contact if you have any queries

k3d/share/shaders/k3d_hdr_surface.sl:15:color hdrenv(string envname;vector R;float blur)

k3d/share/shaders/k3d_hdr_surface.sl:19:	vector D = normalize(vtransform("world",R));

k3d/share/shaders/k3d_hdr_surface.sl:21:	float Dx = xcomp(D);

k3d/share/shaders/k3d_hdr_surface.sl:22:	float Dy = ycomp(D);

k3d/share/shaders/k3d_hdr_surface.sl:23:	float Dz = zcomp(D);

k3d/share/shaders/k3d_hdr_surface.sl:25:	float r = 0.159154943 * acos(Dz) / sqrt((Dx * Dx) + (Dy * Dy));

k3d/share/shaders/k3d_hdr_surface.sl:27:	float ss = 0.5 + (Dx * r);

k3d/share/shaders/k3d_hdr_surface.sl:28:	float tt = 0.5 + (Dy * r);

k3d/share/shaders/k3d_hdr_surface.sl:31:	if(envname !=""){

k3d/share/shaders/k3d_hdr_surface.sl:39:surface k3d_hdr_surface (

k3d/share/shaders/k3d_hdr_surface.sl:40:	float intensity =1.0;

k3d/share/shaders/k3d_hdr_surface.sl:41:	float exposure_compensation_stops = 0.0;

k3d/share/shaders/k3d_hdr_surface.sl:46:	float blur = 0.0;

k3d/share/shaders/k3d_hdr_surface.sl:52:	vector R = normalize(vtransform(envspace,(origin - P)));

k3d/share/shaders/k3d_hdr_surface.sl:54:	if (mappingtype == "probe"){

k3d/share/shaders/k3d_hdr_surface.sl:55:		if(envname != ""){

k3d/share/shaders/k3d_hdr_surface.sl:59:	else if (mappingtype == "environment"){

k3d/share/shaders/k3d_hdr_surface.sl:60:		if(envname != ""){

k3d/share/shaders/k3d_hdr_surface.sl:64:	else if (mappingtype == "planar"){

k3d/share/shaders/k3d_hdr_surface.sl:65:		if(envname != ""){

k3d/share/shaders/k3d_hdr_surface.sl:70:	float exposure = pow(2,exposure_compensation_stops);

k3d/share/shaders/k3d_hdri1.sl:4:	if (envname != "")
k3d/share/shaders/k3d_hdri2.sl:2:k3d_hdri2 (float intensity = 1;
k3d/share/shaders/k3d_hdri2.sl:6:       float envblur = 0.5;
k3d/share/shaders/k3d_hdri2.sl:8:       float shadowblur = 0.001;
k3d/share/shaders/k3d_hdri2.sl:9:       float shadowbias = 0.01;
k3d/share/shaders/k3d_hdri2.sl:10:       float shadowsamples = 1;)
k3d/share/shaders/k3d_hdri2.sl:12:    vector Lenv = vtransform (envspace, P-Ps);
k3d/share/shaders/k3d_hdri2.sl:14:	if (envname != "")
k3d/share/shaders/k3d_hdri2.sl:17:        if (shadowname != "")
k3d/share/shaders/k3d_hexatile_bump.sl:9:* 	string Name 	= "FGHexaTile_bump"	---	Name of the shader "do nothing".
k3d/share/shaders/k3d_hexatile_bump.sl:10:*	float Edge1	=.2 			---	Minvalue of Edge.
k3d/share/shaders/k3d_hexatile_bump.sl:11:*	float Edge2	=.5 			---	Maxvalue of Edge.
k3d/share/shaders/k3d_hexatile_bump.sl:12:*	float ScaleSS	= 3 			---	Scale the "s" direction.
k3d/share/shaders/k3d_hexatile_bump.sl:13:*	float ScaleTT	= 3 			---	Scale the "t" direction.
k3d/share/shaders/k3d_hexatile_bump.sl:14:*	float Rotate	= 180 			---	Rotate the tile default "Z-direction"
k3d/share/shaders/k3d_hexatile_bump.sl:15:*	point P1	= point(0,0,0) 		---	Center point for Rotation.
k3d/share/shaders/k3d_hexatile_bump.sl:16:*	point P2	= point(0,0,1) 		---	The x,y,z direction for Rotate.
k3d/share/shaders/k3d_hexatile_bump.sl:18:*	string Space	  = "shader" 		---	Space for projection.
k3d/share/shaders/k3d_hexatile_bump.sl:19:*	float mx[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}  --- 16 float for scale,rotate,translate.
k3d/share/shaders/k3d_hexatile_bump.sl:20:*	float C1	= 1 			---	Multiply of f1 the closes future point.
k3d/share/shaders/k3d_hexatile_bump.sl:21:*	float C2	= 2 			---	Multiply of f2 the second closes future point.
k3d/share/shaders/k3d_hexatile_bump.sl:22:*	float Km	= -.015 		---	Diplacement amplitude.
k3d/share/shaders/k3d_hexatile_bump.sl:23:*	float Truedisp	= 1 			---	True Displacement 0 = off, 1 = on.
k3d/share/shaders/k3d_hexatile_bump.sl:28:* Author: Fredrik Gustafsson, gusten@SpamSucks_algonet.se
k3d/share/shaders/k3d_hexatile_bump.sl:30:* Reference:
k3d/share/shaders/k3d_hexatile_bump.sl:32:* Arman "Advanced Renderman-"Creating CGI for Motion Picture.
k3d/share/shaders/k3d_hexatile_bump.sl:42:Worley2D_f1f2 (float ss, tt; float jitter, seed, c1, c2, hexagon, scale_ss, scale_tt; 
k3d/share/shaders/k3d_hexatile_bump.sl:43:		output float f1; output float spos1, tpos1; output float f2; output float spos2, tpos2;)
k3d/share/shaders/k3d_hexatile_bump.sl:46:float sthiscell = floor(ss)+0.5, tthiscell = floor(tt)+0.5;
k3d/share/shaders/k3d_hexatile_bump.sl:48:f1 = f2 = 1000;
k3d/share/shaders/k3d_hexatile_bump.sl:50:uniform float i, j;
k3d/share/shaders/k3d_hexatile_bump.sl:51:	for (i = -1; i <= 1; i += 1) {
k3d/share/shaders/k3d_hexatile_bump.sl:52:		float stestcell = sthiscell + i;
k3d/share/shaders/k3d_hexatile_bump.sl:53:			for (j = -1; j <= 1; j += 1) {
k3d/share/shaders/k3d_hexatile_bump.sl:54:				float ttestcell = tthiscell + j;
k3d/share/shaders/k3d_hexatile_bump.sl:57:if ((hexagon != 0) && abs(mod(stestcell, 2)) < 1)
k3d/share/shaders/k3d_hexatile_bump.sl:60:	float spos = stestcell + jitter * (float cellnoise(stestcell,seed+ttestcell) - 0.5);
k3d/share/shaders/k3d_hexatile_bump.sl:61:	float tpos = ttestcell + jitter * (float cellnoise(stestcell+23,seed+ttestcell-87) - 0.5);
k3d/share/shaders/k3d_hexatile_bump.sl:62:	float soffset = (spos - ss) * scale_ss;
k3d/share/shaders/k3d_hexatile_bump.sl:63:	float toffset = (tpos - tt) * scale_tt;
k3d/share/shaders/k3d_hexatile_bump.sl:64:	float dist = soffset*soffset + toffset*toffset;
k3d/share/shaders/k3d_hexatile_bump.sl:66:if (dist < f1) {
k3d/share/shaders/k3d_hexatile_bump.sl:67:	f2 = f1; spos2 = spos1; tpos2 = tpos1;
k3d/share/shaders/k3d_hexatile_bump.sl:68:	f1 = dist; spos1 = spos; tpos1 = tpos;
k3d/share/shaders/k3d_hexatile_bump.sl:69:} else if (dist < f2) {
k3d/share/shaders/k3d_hexatile_bump.sl:70:	f2 = dist;
k3d/share/shaders/k3d_hexatile_bump.sl:75:f1 = f1 * c1; f2 = f2 * c2;
k3d/share/shaders/k3d_hexatile_bump.sl:80:	float Edge1	=.2; 
k3d/share/shaders/k3d_hexatile_bump.sl:81:	float Edge2	=.5; 
k3d/share/shaders/k3d_hexatile_bump.sl:82:	float ScaleSS	= 3; 
k3d/share/shaders/k3d_hexatile_bump.sl:83:	float ScaleTT	= 3; 
k3d/share/shaders/k3d_hexatile_bump.sl:84:	float Rotate	= 180; 
k3d/share/shaders/k3d_hexatile_bump.sl:89:	float mx[16] = {1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1}; 
k3d/share/shaders/k3d_hexatile_bump.sl:90:	float C1	= 1; 
k3d/share/shaders/k3d_hexatile_bump.sl:91:	float C2	= 2; 
k3d/share/shaders/k3d_hexatile_bump.sl:92:	float Km	= -.015; 
k3d/share/shaders/k3d_hexatile_bump.sl:93:	float Truedisp	= 1; ) 
k3d/share/shaders/k3d_hexatile_bump.sl:96:float SS,TT,Ds,Dt;
k3d/share/shaders/k3d_hexatile_bump.sl:99:float f1_out_15 = 0,f2_out_15 = 0,spos1_out_15 = 0,tpos1_out_15 = 0,spos2_out_15 = 0,tpos2_out_15 = 0;
k3d/share/shaders/k3d_hexatile_bump.sl:101:float scale1 = ScaleSS * SS;
k3d/share/shaders/k3d_hexatile_bump.sl:102:float scale2 = ScaleTT * TT;
k3d/share/shaders/k3d_hexatile_bump.sl:104:Worley2D_f1f2 (scale1,scale2,/* Jitter */ 0,/* Seed */ 0,C1,C2,/* Hexagon */ 1,/* TileScaleSS */ 1,
k3d/share/shaders/k3d_hexatile_bump.sl:105:			/* TileScaleTT */ 1,/* f1_result */ f1_out_15,spos1_out_15, tpos1_out_15,
k3d/share/shaders/k3d_hexatile_bump.sl:106:				/* f2_result */ f2_out_15,spos2_out_15,tpos2_out_15);
k3d/share/shaders/k3d_hexatile_bump.sl:108:/*** ----- Exponential "sqrt(float X)" ----- ***/
k3d/share/shaders/k3d_hexatile_bump.sl:109:float SQRT_f2 = sqrt(f2_out_15);
k3d/share/shaders/k3d_hexatile_bump.sl:112:float smoothp_20 = smoothpulse (0,Edge1,Edge2,1,SQRT_f2);
k3d/share/shaders/k3d_hexatile_bump.sl:114:/*** ----- Exponential "sqrt(float X)" ----- ***/
k3d/share/shaders/k3d_hexatile_bump.sl:115:float SQRT_f1 = sqrt(f1_out_15);
k3d/share/shaders/k3d_hexatile_bump.sl:118:float smoothp_22 = smoothpulse (0,Edge1,Edge2,1,SQRT_f1);
k3d/share/shaders/k3d_hexatile_bump.sl:122:Displace (normal dir; vector space; float amp; float truedisp;)
k3d/share/shaders/k3d_hexatile_bump.sl:125:	float spacescale = length(space);
k3d/share/shaders/k3d_hexatile_bump.sl:131:vector VShd = vtransform("shader", vector(normalize(N)));
k3d/share/shaders/k3d_hexatile_bump.sl:133:float disp = clamp(smoothp_20*smoothp_22,0,0.95);
k3d/share/shaders/k3d_hextile.sl:2: * hextile.sl -- surface shader for hexagonal tiles in st space
k3d/share/shaders/k3d_hextile.sl:5: *       This surface shader operates in s-t space and gives a pattern of
k3d/share/shaders/k3d_hextile.sl:6: *    hexagonal tiles, similar to that found as floor patterns in public
k3d/share/shaders/k3d_hextile.sl:8: *       The basic pattern is a hexagonal tiling, with a little bit of
k3d/share/shaders/k3d_hextile.sl:9: *    color variation from tile to tile.  On top of that is some staining
k3d/share/shaders/k3d_hextile.sl:11: *    mortar underneath it.  Finally, there is scuffing due to people's
k3d/share/shaders/k3d_hextile.sl:12: *    shoes, which really only affects the tile part not the mortar part.
k3d/share/shaders/k3d_hextile.sl:17: *    tilecolor - the color of the tiles
k3d/share/shaders/k3d_hextile.sl:18: *    mortarcolor - the color of the mortar (space between the tiles)
k3d/share/shaders/k3d_hextile.sl:19: *    tileradius - the "radius" (in s-t units) of a single tile
k3d/share/shaders/k3d_hextile.sl:20: *    mortarwidth - the width of the mortar (in s-t units)
k3d/share/shaders/k3d_hextile.sl:21: *    tilevary - the color variance from tile to tile
k3d/share/shaders/k3d_hextile.sl:24: *    Some rudimentary antialiasing is performed on the borders between
k3d/share/shaders/k3d_hextile.sl:28: *    If all of the default parameters are used, the tiles look just like
k3d/share/shaders/k3d_hextile.sl:29: *    the floors in the public areas of the Washington DC subway system.
k3d/share/shaders/k3d_hextile.sl:36: * last modified 15 Feb 94 by Larry Gritz
k3d/share/shaders/k3d_hextile.sl:40:#define snoise(x) (2*noise(x)-1)
k3d/share/shaders/k3d_hextile.sl:41:#define snoise2(x,y) (2*noise((x),(y))-1)
k3d/share/shaders/k3d_hextile.sl:44:surface
k3d/share/shaders/k3d_hextile.sl:45:k3d_hextile (float Ka = .5;
k3d/share/shaders/k3d_hextile.sl:46:         float Kd = .5;
k3d/share/shaders/k3d_hextile.sl:47:         float Ks = .2;
k3d/share/shaders/k3d_hextile.sl:48:         float roughness = .1;
k3d/share/shaders/k3d_hextile.sl:52:	 float tileradius = 0.2;
k3d/share/shaders/k3d_hextile.sl:53:	 float mortarwidth = 0.02;
k3d/share/shaders/k3d_hextile.sl:54:	 float tilevary = 0.15;
k3d/share/shaders/k3d_hextile.sl:55:	 float scuffing = 0.5;
k3d/share/shaders/k3d_hextile.sl:56:	 float stains = 0.4;
k3d/share/shaders/k3d_hextile.sl:57:         float stainfrequency = 2;
k3d/share/shaders/k3d_hextile.sl:58:         float scufffrequency = 4;
k3d/share/shaders/k3d_hextile.sl:59:	 color scuffcolor = color (.05,.05,.05))
k3d/share/shaders/k3d_hextile.sl:61:  point Nf;
k3d/share/shaders/k3d_hextile.sl:63:  float tilewidth;
k3d/share/shaders/k3d_hextile.sl:64:  float ss, tt;
k3d/share/shaders/k3d_hextile.sl:65:  float ttile, stile;
k3d/share/shaders/k3d_hextile.sl:66:  float x, y;
k3d/share/shaders/k3d_hextile.sl:67:  float mortar;
k3d/share/shaders/k3d_hextile.sl:68:  float swidth, twidth, sfuzz, tfuzz, fuzzmax;
k3d/share/shaders/k3d_hextile.sl:69:  float mw2;
k3d/share/shaders/k3d_hextile.sl:70:  float tileindex;
k3d/share/shaders/k3d_hextile.sl:71:  float stain, scuff;
k3d/share/shaders/k3d_hextile.sl:72:  float ks;
k3d/share/shaders/k3d_hextile.sl:77:  sfuzz = 0.5 * swidth;
k3d/share/shaders/k3d_hextile.sl:78:  tfuzz = 0.5 * twidth;
k3d/share/shaders/k3d_hextile.sl:79:  fuzzmax = max (sfuzz, tfuzz);
k3d/share/shaders/k3d_hextile.sl:83:  ttile = floor (t/(1.5*tileradius));
k3d/share/shaders/k3d_hextile.sl:84:  if (mod (ttile/2, 1) == 0.5)
k3d/share/shaders/k3d_hextile.sl:87:  stile = floor (ss / tilewidth);
k3d/share/shaders/k3d_hextile.sl:91:  if (tt < tileradius) {
k3d/share/shaders/k3d_hextile.sl:92:      mortar =  1 - (smoothstep(mw2,mw2+sfuzz,ss) *
k3d/share/shaders/k3d_hextile.sl:93:		     (1 - smoothstep(tilewidth-mw2-sfuzz,tilewidth-mw2,ss)));
k3d/share/shaders/k3d_hextile.sl:98:      if (y > x) {
k3d/share/shaders/k3d_hextile.sl:99:	  if (mod (ttile/2, 1) == 0.5)
k3d/share/shaders/k3d_hextile.sl:102:	  if (ss > tilewidth/2)
k3d/share/shaders/k3d_hextile.sl:105:      mortar = (smoothstep (x-1.73*mw2-tfuzz, x-1.73*mw2, y) *
k3d/share/shaders/k3d_hextile.sl:106:		(1 - smoothstep (x+1.73*mw2, x+1.73*mw2+tfuzz, y)));
k3d/share/shaders/k3d_hextile.sl:112:  stain = stains * smoothstep (.5,1, noise(s*stainfrequency,t*stainfrequency));
k3d/share/shaders/k3d_hextile.sl:114:  scuff = scuffing * smoothstep (.6,1, noise(t*scufffrequency-90.26,
k3d/share/shaders/k3d_hextile.sl:115:					     s*scufffrequency+123.82));
k3d/share/shaders/k3d_hextile.sl:117:  ks = Ks * (1-scuff/2);
k3d/share/shaders/k3d_hextile.sl:118:  Ct = (1-stain) * mix (mix (Ctile, scuffcolor, scuff), mortarcolor, mortar);
k3d/share/shaders/k3d_hextile.sl:120:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_hextile.sl:121:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_hextile.sl:122:	      specularcolor * ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_imagelayerclouds.sl:2:#define snoise(x) ((2 * noise(x)) - 1)
k3d/share/shaders/k3d_imagelayerclouds.sl:5:surface k3d_imagelayerclouds(float txtscale = 1;
k3d/share/shaders/k3d_imagelayerclouds.sl:8:			     float octaves = 8, omega = 0.5, lambda = 2;
k3d/share/shaders/k3d_imagelayerclouds.sl:9:			     float threshold = 0.5;)
k3d/share/shaders/k3d_imagelayerclouds.sl:11:  float value;
k3d/share/shaders/k3d_imagelayerclouds.sl:12:  color Ct;			/* Color of the surface */
k3d/share/shaders/k3d_imagelayerclouds.sl:13:  point PP;			/* Surface point in shader space */
k3d/share/shaders/k3d_imagelayerclouds.sl:14:  float i, a, l, o;
k3d/share/shaders/k3d_imagelayerclouds.sl:16://  PP = txtscale * transform ("shader", P);
k3d/share/shaders/k3d_imagelayerclouds.sl:19:  /* Use fractional Brownian motion to compute a value for this point */
k3d/share/shaders/k3d_imagelayerclouds.sl:20:/*  value = fBm (PP, omega, lambda, octaves); */
k3d/share/shaders/k3d_imagelayerclouds.sl:25:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_imagelayergradient.sl:1:surface k3d_imagelayergradient(color zenith = color(0, 0, 1);
k3d/share/shaders/k3d_imagelayergradient.sl:8:  if(v < 0.5)
k3d/share/shaders/k3d_incandplastic.sl:2: * Felipe Esquivel <felipe@siggraph.org.mx>

k3d/share/shaders/k3d_incandplastic.sl:10:surface 

k3d/share/shaders/k3d_incandplastic.sl:11:k3d_incandplastic(color SurfaceColor = color(0, 0.25, 1);

k3d/share/shaders/k3d_incandplastic.sl:12:	      color SurfaceOpacity = 1;

k3d/share/shaders/k3d_incandplastic.sl:13:	      float Ka = 0;

k3d/share/shaders/k3d_incandplastic.sl:14:	      float Kd = 0.9;

k3d/share/shaders/k3d_incandplastic.sl:15:	      float Ks = 0.5;

k3d/share/shaders/k3d_incandplastic.sl:16:	      float Roughness = 0.05;

k3d/share/shaders/k3d_incandplastic.sl:20:  normal Nf;

k3d/share/shaders/k3d_incandplastic.sl:23:  Nf = faceforward(normalize(N), I, normalize(N));

k3d/share/shaders/k3d_incandplastic.sl:25:  Ci = SurfaceOpacity * (SurfaceColor * (Ka * ambient() + Kd * diffuse(Nf)) +

k3d/share/shaders/k3d_incandplastic.sl:26:			 SpecularColor * Ks * specular(Nf, NI, Roughness) +

k3d/share/shaders/k3d_incandplastic.sl:28:  Oi = SurfaceOpacity;

k3d/share/shaders/k3d_indirect.sl:1:/* indirect.sl - retrieve radiosity data from the "ray server"
k3d/share/shaders/k3d_indirect.sl:3: * This shader is never called from BMRT -- the "indirect" light source
k3d/share/shaders/k3d_indirect.sl:6: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_indirect.sl:8: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_indirect.sl:14:light k3d_indirect(output float __nonspecular = 1;)
k3d/share/shaders/k3d_indirect.sl:16:#ifdef BMRT
k3d/share/shaders/k3d_indirect.sl:17:  /* Just in case this is ever compiled for BMRT, make it do nothing. */
k3d/share/shaders/k3d_indirect.sl:20:#else /* PRMan - make a light that looks up from the ray server */
k3d/share/shaders/k3d_indirect.sl:22:  /* Exploit the fact that PRMan (incorrectly) leaves the surface normal
k3d/share/shaders/k3d_indirect.sl:30:#endif
k3d/share/shaders/k3d_leather.sl:4: * I have done this shader from JMredapple.sl for RMR

k3d/share/shaders/k3d_leather.sl:8: *and offer you this shader, it was done (JMredapple.sl) by Jonathan Merritt

k3d/share/shaders/k3d_leather.sl:9: *without hes shader i wouldnt be able to do mine so send him flowers :)

k3d/share/shaders/k3d_leather.sl:11: *	re-autor istarion@3dvf.net    web site http://istarion.3dvf.net

k3d/share/shaders/k3d_leather.sl:17:surface

k3d/share/shaders/k3d_leather.sl:19:	float Ks = .2;           /* Specular reflection coeff.    */

k3d/share/shaders/k3d_leather.sl:20:	float Kd = 1;            /* Diffuse reflection coeff.     */

k3d/share/shaders/k3d_leather.sl:21:	float Ka = 1;             /* Ambient light coeff.          */

k3d/share/shaders/k3d_leather.sl:22:	float Kr = .2;             /* Mirror-like reflection coeff. */

k3d/share/shaders/k3d_leather.sl:23:	float roughness = .1;     /* Specular roughness param.     */          

k3d/share/shaders/k3d_leather.sl:32:	float BLOTCH_TCF = 5;		/*zebrure sur la peau*/

k3d/share/shaders/k3d_leather.sl:33:	float BLOTCH_SF = 5;		/*definis le s */

k3d/share/shaders/k3d_leather.sl:34:	float BLOTCH_TF = 5;		/*definis le s */

k3d/share/shaders/k3d_leather.sl:35:    float paramdisp = 1;

k3d/share/shaders/k3d_leather.sl:36:	float txtscale = .05;     	/* Ugly kludge (see above...)    */

k3d/share/shaders/k3d_leather.sl:37:	color specularcolor = 1;  	/* Specular reflection color     */

k3d/share/shaders/k3d_leather.sl:45:	vector Nf, V, Rdir;

k3d/share/shaders/k3d_leather.sl:47:	float base_turb, blotch_turb, disp_turb;

k3d/share/shaders/k3d_leather.sl:48:	float small_noise, blotch, speck, disp = 0, blackness;

k3d/share/shaders/k3d_leather.sl:49:	color cs, small_speckle, base_color, reflect;

k3d/share/shaders/k3d_leather.sl:58:	PP = transform("shader", P);

k3d/share/shaders/k3d_leather.sl:63:	 * Pick the base color for the apple.

k3d/share/shaders/k3d_leather.sl:65:	 * The base color consists of patches of pure green,

k3d/share/shaders/k3d_leather.sl:66:	 * and patches of finely speckled red and green. These

k3d/share/shaders/k3d_leather.sl:67:	 * are set up so that the poles of the apple (as "t"

k3d/share/shaders/k3d_leather.sl:70:	 * The apple geometry is such that lines of constant

k3d/share/shaders/k3d_leather.sl:71:	 * "t" are lines of longditude (from pole to pole).

k3d/share/shaders/k3d_leather.sl:72:	 * The constants T1 - T4 specify locations of the

k3d/share/shaders/k3d_leather.sl:73:	 * start of 'greenness' toward the poles.

k3d/share/shaders/k3d_leather.sl:75:	#define BASE_SF          1      /* s-factor for big noise          */

k3d/share/shaders/k3d_leather.sl:76:	#define BASE_TF          1      /* t-factor for big noise          */

k3d/share/shaders/k3d_leather.sl:77:	#define BASE_NF          100    /* scaling factor for small noise  */

k3d/share/shaders/k3d_leather.sl:78:	#define BASE_NOISE_AMP   0.2    /* small noise color mix amplitude */

k3d/share/shaders/k3d_leather.sl:79:	#define BASE_GRC         0.4    /* shift factor for more red       */

k3d/share/shaders/k3d_leather.sl:80:	#define T1               0.0    /* t < T1 is pure green            */

k3d/share/shaders/k3d_leather.sl:81:	#define T2               0.18   /* lerp s.t. T1->T2 => green->red  */

k3d/share/shaders/k3d_leather.sl:82:	#define T3               0.8    /* T2->T3 => red can exist here    */

k3d/share/shaders/k3d_leather.sl:83:	#define T4               1.0    /* lerp s.t. T3->T4 => red->green  */

k3d/share/shaders/k3d_leather.sl:91:	if (t < T1)

k3d/share/shaders/k3d_leather.sl:93:	else if (t >= T1 && t < T2)

k3d/share/shaders/k3d_leather.sl:95:	else if (t >= T3 && t < T4)

k3d/share/shaders/k3d_leather.sl:97:	else if (t >= T4)

k3d/share/shaders/k3d_leather.sl:107:	 * The blotch color is finally determined by mixing,

k3d/share/shaders/k3d_leather.sl:108:	 * using the blotching coefficient "blotch". This

k3d/share/shaders/k3d_leather.sl:109:	 * section sets that coefficient, using a funky yet

k3d/share/shaders/k3d_leather.sl:112:	/*#define BLOTCH_SF          20   s-factor for blotches  */

k3d/share/shaders/k3d_leather.sl:113:	/*#define BLOTCH_TF          15   t-factor for blotches  */

k3d/share/shaders/k3d_leather.sl:114:	/*#define BLOTCH_TCF         0     zebrure                */

k3d/share/shaders/k3d_leather.sl:115:	#define BLOTCH_DELTA       0.1  /* 'nother scaling kludge */

k3d/share/shaders/k3d_leather.sl:116:	#define BLOTCH_SPECK_COEFF 0.3  /* blotch specking coeff  */

k3d/share/shaders/k3d_leather.sl:123:	if (blotch > 1) blotch = 1;

k3d/share/shaders/k3d_leather.sl:130:	 * using the speckling coefficient "speck". These

k3d/share/shaders/k3d_leather.sl:132:	 * dottiness technique is stolen from LG's starfield 

k3d/share/shaders/k3d_leather.sl:135:	#define SPECK_NF        0     /* un dented dessus que je met a zero*/    

k3d/share/shaders/k3d_leather.sl:136:	#define SPECK_CUTOFF    .45   /*Cutoff for 'tops' of specks*/ 

k3d/share/shaders/k3d_leather.sl:146:	#define BEDGE  .0

k3d/share/shaders/k3d_leather.sl:147:	#define BWIDTH .0

k3d/share/shaders/k3d_leather.sl:153:	 * Combine what we have so far to set the surface

k3d/share/shaders/k3d_leather.sl:162:	 * Set the shading surface normal.

k3d/share/shaders/k3d_leather.sl:164:	 * Here we set the surface normal to fix up the specular

k3d/share/shaders/k3d_leather.sl:166:	 * noise, affected a little by the brown specks, and

k3d/share/shaders/k3d_leather.sl:167:	 * also dented a bit (alas, no real apples are perfectly

k3d/share/shaders/k3d_leather.sl:170:	#define DISP_SF     10             /* s-factor for dent noise */

k3d/share/shaders/k3d_leather.sl:171:	#define DISP_TF     30             /* t-factor for dent noise */

k3d/share/shaders/k3d_leather.sl:172:	#define DISP_DENT_AMP     (1/15)   /* dent amplitude          */

k3d/share/shaders/k3d_leather.sl:173:	#define DISP_SMNOISE_AMP  (1/1000) /* small noise amplitude   */

k3d/share/shaders/k3d_leather.sl:174:	#define DISP_SPECK_AMP    (1/40)   /* speckle disp. amplitude */

k3d/share/shaders/k3d_leather.sl:181:	Nf = faceforward(normalize(newP), I);

k3d/share/shaders/k3d_leather.sl:185:	 * 'Mirror' reflections

k3d/share/shaders/k3d_leather.sl:187:	 * Here, we raytrace for the slight mirrored reflections

k3d/share/shaders/k3d_leather.sl:188:	 * in the surface of an apple. They don't add much, but

k3d/share/shaders/k3d_leather.sl:189:	 * may be needed for the 'perfect' apple :-).

k3d/share/shaders/k3d_leather.sl:191:	 * Note: You'll need Larry Gritz's raytrace helper files

k3d/share/shaders/k3d_leather.sl:192:	 * for this bit!

k3d/share/shaders/k3d_leather.sl:194:#ifdef USE_LG_RAYTRACE

k3d/share/shaders/k3d_leather.sl:195:	if (Kr > .01) {

k3d/share/shaders/k3d_leather.sl:196:		Rdir = normalize(reflect(normalize(I), Nf));

k3d/share/shaders/k3d_leather.sl:197:		reflect = RayTrace(P, Rdir, 0, 1, 1);

k3d/share/shaders/k3d_leather.sl:199:		reflect = 0;

k3d/share/shaders/k3d_leather.sl:202:	reflect = 0;

k3d/share/shaders/k3d_leather.sl:203:#endif

k3d/share/shaders/k3d_leather.sl:207:	 * Combine everything to get Ci, in the standard form.

k3d/share/shaders/k3d_leather.sl:210:	Ci = Os * (cs * (Ka*ambient() + Kd*diffuse(Nf)) +

k3d/share/shaders/k3d_leather.sl:211:	           specularcolor * (Kr * reflect +

k3d/share/shaders/k3d_leather.sl:212:	                            Ks * specular(Nf, V, roughness)));

k3d/share/shaders/k3d_lensflare.sl:2: * lensflare.sl
k3d/share/shaders/k3d_lensflare.sl:4: * Description: This shader, when placed on a piece of geometry 
k3d/share/shaders/k3d_lensflare.sl:5: *   immediately in front of the camera, simulates lens flare.
k3d/share/shaders/k3d_lensflare.sl:6: *   These effects happen in real cameras when the camera points toward
k3d/share/shaders/k3d_lensflare.sl:7: *   a bright light source, resulting in interreflections within the
k3d/share/shaders/k3d_lensflare.sl:8: *   optical elements of the lens system itself.  Real lens flare is
k3d/share/shaders/k3d_lensflare.sl:13: *   intensity - overall scale of intensity of all lens flare effects
k3d/share/shaders/k3d_lensflare.sl:14: *   bloomintensity - overall intensity of the "bloom" effect.  Setting
k3d/share/shaders/k3d_lensflare.sl:15: *          this to 0 removes the bloom effect altogether.
k3d/share/shaders/k3d_lensflare.sl:16: *   bloomradius, bloomfalloff - control the size & shape of the bloom
k3d/share/shaders/k3d_lensflare.sl:17: *   bloomstarry, bloomnpoints - control the "starry" appearance of the 
k3d/share/shaders/k3d_lensflare.sl:18: *          bloom effect (bloomstarry=0 means perfectly round bloom)
k3d/share/shaders/k3d_lensflare.sl:19: *   starburstintensity - overall intensity of starburst effect (0=none)
k3d/share/shaders/k3d_lensflare.sl:20: *   starburstradius, starburstnpoints, starburstfalloff - control the
k3d/share/shaders/k3d_lensflare.sl:21: *          size and shape of the starburst effect
k3d/share/shaders/k3d_lensflare.sl:22: *   rainbowintensity - intensity of rainbow effect (0=none)
k3d/share/shaders/k3d_lensflare.sl:23: *   rainbowradius, rainbowwidth - size of the rainbow
k3d/share/shaders/k3d_lensflare.sl:24: *   nspots - number of "spots" splayed out on the axis joining the
k3d/share/shaders/k3d_lensflare.sl:26: *   disky, ringy, blotty, bloony - give the relative proportions of
k3d/share/shaders/k3d_lensflare.sl:27: *          the 4 different kinds of spots.
k3d/share/shaders/k3d_lensflare.sl:28: *   spotintensity - overall intensity scale for the spots
k3d/share/shaders/k3d_lensflare.sl:29: *   spotvarycolor - scale the color variation of the spots
k3d/share/shaders/k3d_lensflare.sl:30: *   seed - random number seed for many of the computations
k3d/share/shaders/k3d_lensflare.sl:32: * WARNING: lens flare is notorious as a sign of cheesy, cheap computer
k3d/share/shaders/k3d_lensflare.sl:33: *   graphics.  Use this effect with extreme care!  
k3d/share/shaders/k3d_lensflare.sl:48:/* Helper function: compute the aspect ratio of the frame */
k3d/share/shaders/k3d_lensflare.sl:49:float
k3d/share/shaders/k3d_lensflare.sl:52:  uniform point Pcorner0 = transform("NDC", "screen", point(0, 0, 0));
k3d/share/shaders/k3d_lensflare.sl:53:  uniform point Pcorner1 = transform("NDC", "screen", point(1, 1, 0));
k3d/share/shaders/k3d_lensflare.sl:59:/* Helper function: compute the camera's diagonal field of view */
k3d/share/shaders/k3d_lensflare.sl:60:float
k3d/share/shaders/k3d_lensflare.sl:61:cameradiagfov()
k3d/share/shaders/k3d_lensflare.sl:63:  uniform vector corner = vector(transform("NDC", "camera", point(1, 1, 0)));
k3d/share/shaders/k3d_lensflare.sl:64:  uniform float halfangle = acos(normalize(corner).vector(0, 0, 1));
k3d/share/shaders/k3d_lensflare.sl:65:  return 2 * halfangle;
k3d/share/shaders/k3d_lensflare.sl:70:rainbow(float x, dx)
k3d/share/shaders/k3d_lensflare.sl:72:#define R	color(1,0,0)
k3d/share/shaders/k3d_lensflare.sl:73:#define O	color(1,.5,0)
k3d/share/shaders/k3d_lensflare.sl:74:#define Y	color(1,1,0)
k3d/share/shaders/k3d_lensflare.sl:75:#define G	color(0,1,0)
k3d/share/shaders/k3d_lensflare.sl:76:#define B	color(0,0,1)
k3d/share/shaders/k3d_lensflare.sl:77:#define Ii	color(.375,0,0.75)
k3d/share/shaders/k3d_lensflare.sl:78:#define V	color(0.5,0,0.5)
k3d/share/shaders/k3d_lensflare.sl:79:  return filteredpulse(0, 1, x, dx) * spline(x, V, V, Ii, B, G, Y, O, R, R);
k3d/share/shaders/k3d_lensflare.sl:84:surface k3d_lensflare(float intensity = 1.0;
k3d/share/shaders/k3d_lensflare.sl:85:		      float bloomintensity = 1;
k3d/share/shaders/k3d_lensflare.sl:86:		      float bloomradius = 0.5;
k3d/share/shaders/k3d_lensflare.sl:87:		      float bloomstarry = 0.75;
k3d/share/shaders/k3d_lensflare.sl:88:		      float bloomnpoints = 25;
k3d/share/shaders/k3d_lensflare.sl:89:		      float bloomfalloff = 8;
k3d/share/shaders/k3d_lensflare.sl:90:		      float starburstintensity = 0.075;
k3d/share/shaders/k3d_lensflare.sl:91:		      float starburstradius = 0.5;
k3d/share/shaders/k3d_lensflare.sl:92:		      float starburstnpoints = 100;
k3d/share/shaders/k3d_lensflare.sl:93:		      float starburstfalloff = 3;
k3d/share/shaders/k3d_lensflare.sl:94:		      float rainbowintensity = 0.03;
k3d/share/shaders/k3d_lensflare.sl:95:		      float rainbowradius = 0.5; float rainbowwidth = 0.2;
k3d/share/shaders/k3d_lensflare.sl:96:		      float nspots = 50; float disky = 3; float ringy = 1;
k3d/share/shaders/k3d_lensflare.sl:97:		      float blotty = 1;
k3d/share/shaders/k3d_lensflare.sl:98:		      float bloony = 1; float spotintensity = 0.08;
k3d/share/shaders/k3d_lensflare.sl:99:		      float spotvarycolor = 0.5; float seed = 143;
k3d/share/shaders/k3d_lensflare.sl:102:  uniform float nrand = 0;
k3d/share/shaders/k3d_lensflare.sl:103:  uniform float urand()
k3d/share/shaders/k3d_lensflare.sl:105:    extern uniform float nrand, seed;
k3d/share/shaders/k3d_lensflare.sl:114:  uniform float aspect = abs(aspectratio());
k3d/share/shaders/k3d_lensflare.sl:115:  uniform float lensfov = cameradiagfov();
k3d/share/shaders/k3d_lensflare.sl:117:  point Pndc = (transform("NDC", P) - vector(.5, .5, 0)) * 2;
k3d/share/shaders/k3d_lensflare.sl:119:  float dPndc = filterwidthp(Pndc);
k3d/share/shaders/k3d_lensflare.sl:123:    float atten = acos(zcomp(normalize(vector transform("camera", P + L))));
k3d/share/shaders/k3d_lensflare.sl:124:    atten = 1 - smoothstep(1, 2, abs(atten) / (lensfov / 2));
k3d/share/shaders/k3d_lensflare.sl:126:    float brightness =
k3d/share/shaders/k3d_lensflare.sl:129:    color Cflare = 0;
k3d/share/shaders/k3d_lensflare.sl:132:    point Plight = (transform("NDC", P + L) - vector(.5, .5, 0)) * 2;
k3d/share/shaders/k3d_lensflare.sl:136:    float angle = atan(ycomp(Lvec), xcomp(Lvec)) + PI;
k3d/share/shaders/k3d_lensflare.sl:139:     * Handle the image of the lamp.  There are 3 effects:
k3d/share/shaders/k3d_lensflare.sl:140:     * the bloom, a small red ring flare, and the triple starburst.
k3d/share/shaders/k3d_lensflare.sl:142:    float dist = length(Lvec);
k3d/share/shaders/k3d_lensflare.sl:144:    if(bloomintensity > 0)
k3d/share/shaders/k3d_lensflare.sl:146:	float radius = sqrt(brightness) * 5 * mix(.2, bloomradius, urand());
k3d/share/shaders/k3d_lensflare.sl:147:	float bloom = pnoise(bloomnpoints * angle / (2 * PI), bloomnpoints);
k3d/share/shaders/k3d_lensflare.sl:150:	bloom = pow(1 - smoothstep(0.0, radius * bloom, dist), bloomfalloff);
k3d/share/shaders/k3d_lensflare.sl:151:	Cflare += bloom * (bloomintensity / intensity) / brightness;
k3d/share/shaders/k3d_lensflare.sl:155:    if(starburstintensity > 0)
k3d/share/shaders/k3d_lensflare.sl:157:	float radius =
k3d/share/shaders/k3d_lensflare.sl:159:	float star = float pnoise(starburstnpoints * angle / (2 * PI),
k3d/share/shaders/k3d_lensflare.sl:162:	  pow(1 - smoothstep(0.0, radius * star, dist), starburstfalloff);
k3d/share/shaders/k3d_lensflare.sl:163:	Cflare += star * (starburstintensity / intensity) / brightness;
k3d/share/shaders/k3d_lensflare.sl:167:    if(rainbowintensity > 0)
k3d/share/shaders/k3d_lensflare.sl:169:	Cflare +=
k3d/share/shaders/k3d_lensflare.sl:179:    uniform float i;
k3d/share/shaders/k3d_lensflare.sl:181:    for(i = 0; i < nspots; i += 1)
k3d/share/shaders/k3d_lensflare.sl:183:	uniform float alongaxis = urand();
k3d/share/shaders/k3d_lensflare.sl:185:	float axisdist = distance(cntr, Pndc);
k3d/share/shaders/k3d_lensflare.sl:186:	float radius = mix(0.04, .1,
k3d/share/shaders/k3d_lensflare.sl:190:	float bright = 1 - (2 * radius);
k3d/share/shaders/k3d_lensflare.sl:193:	uniform float alltypes = (disky + ringy + blotty + bloony);
k3d/share/shaders/k3d_lensflare.sl:194:	uniform float type = urand() * alltypes;
k3d/share/shaders/k3d_lensflare.sl:197:	float int = 0;
k3d/share/shaders/k3d_lensflare.sl:198:	if(type < disky)
k3d/share/shaders/k3d_lensflare.sl:200:	    int = 1 - filterstep(radius, axisdist - dPndc / 2,
k3d/share/shaders/k3d_lensflare.sl:203:	else if(type < (disky + ringy))
k3d/share/shaders/k3d_lensflare.sl:205:	    int = filteredpulse(radius, radius + 0.05 * axisdist,
k3d/share/shaders/k3d_lensflare.sl:208:	else if(type < (disky + ringy + blotty))
k3d/share/shaders/k3d_lensflare.sl:209:	  {			/* Soft spot */
k3d/share/shaders/k3d_lensflare.sl:213:	  {			/* Spot with soft hole in middle */
k3d/share/shaders/k3d_lensflare.sl:214:	    int = smoothstep(0, radius, axisdist) - filterstep(radius,
k3d/share/shaders/k3d_lensflare.sl:220:	Cflare += spotintensity * bright * clr * Cs * int;
k3d/share/shaders/k3d_lensflare.sl:223:    Ci += Cflare * Cl * atten;
k3d/share/shaders/k3d_luna.sl:2: * luna.sl -- surface shader for the moon
k3d/share/shaders/k3d_luna.sl:5: *    Makes a surface that looks sort of like Earth's moon.  It doesn't really
k3d/share/shaders/k3d_luna.sl:6: *    have craters, so it isn't good for closeups.  But it's pretty good at about
k3d/share/shaders/k3d_luna.sl:7: *    the scale for human naked-eye viewing from earth.
k3d/share/shaders/k3d_luna.sl:22: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_luna.sl:25:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_luna.sl:28:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_luna.sl:29:#define VLNoise(Pt,scale) (snoise(Pt + scale*DNoise(Pt)))
k3d/share/shaders/k3d_luna.sl:30:#define TWOPI (6.28)
k3d/share/shaders/k3d_luna.sl:33:surface k3d_luna(float Ka = .5, Kd = 1;
k3d/share/shaders/k3d_luna.sl:34:		 float lacunarity = 2;
k3d/share/shaders/k3d_luna.sl:35:		 float octaves = 8;
k3d/share/shaders/k3d_luna.sl:36:		 float H = .3;
k3d/share/shaders/k3d_luna.sl:38:		 float maria_basecolor = .7, maria_color = .1;
k3d/share/shaders/k3d_luna.sl:39:		 float arg22 = 1, arg23 = .3;
k3d/share/shaders/k3d_luna.sl:40:		 float highland_threshold = -0.2;
k3d/share/shaders/k3d_luna.sl:41:		 float highland_altitude = 0.001, maria_altitude = 0.0004;
k3d/share/shaders/k3d_luna.sl:42:		 float peak_rad = .0075, inner_rad = .01, rim_rad =
k3d/share/shaders/k3d_luna.sl:43:		 .02, outer_rad = .05; float peak_ht = 0.005, rim_ht = 0.003;
k3d/share/shaders/k3d_luna.sl:44:		 float numrays = 8;	/* arg10 */
k3d/share/shaders/k3d_luna.sl:45:		 float rayfade = 1;	/* arg11 */
k3d/share/shaders/k3d_luna.sl:48:  float radial_dist;
k3d/share/shaders/k3d_luna.sl:50:  float l, a, o, i, omega;
k3d/share/shaders/k3d_luna.sl:51:  float chaos;
k3d/share/shaders/k3d_luna.sl:53:  float temp1;
k3d/share/shaders/k3d_luna.sl:55:  float uu, ht, freq, scale;
k3d/share/shaders/k3d_luna.sl:56:  float lighten;
k3d/share/shaders/k3d_luna.sl:58:  float pd;			/* pole distance */
k3d/share/shaders/k3d_luna.sl:59:  float raydist;
k3d/share/shaders/k3d_luna.sl:62:  PP = transform("shader", P);
k3d/share/shaders/k3d_luna.sl:67:  /* bumpy = fBm (PP, omega, lacunarity, octaves); */
k3d/share/shaders/k3d_luna.sl:71:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_luna.sl:81:  /* Insure that the crater is in one of the maria */
k3d/share/shaders/k3d_luna.sl:83:  if(temp1 < 1)
k3d/share/shaders/k3d_luna.sl:86:  if(chaos > highland_threshold)
k3d/share/shaders/k3d_luna.sl:104:  if(pd < peak_rad)
k3d/share/shaders/k3d_luna.sl:110:  else if(pd < inner_rad)
k3d/share/shaders/k3d_luna.sl:111:    {				/* crater floor */
k3d/share/shaders/k3d_luna.sl:114:  else if(pd < rim_rad)
k3d/share/shaders/k3d_luna.sl:120:  else if(pd < outer_rad)
k3d/share/shaders/k3d_luna.sl:133:  if(uu > 0)
k3d/share/shaders/k3d_luna.sl:135:      if(pd < peak_rad)
k3d/share/shaders/k3d_luna.sl:136:	{			/* if on central peak */
k3d/share/shaders/k3d_luna.sl:138:	  freq = 1;
k3d/share/shaders/k3d_luna.sl:141:	  for(i = 0; i < 4; i += 1)
k3d/share/shaders/k3d_luna.sl:143:	      ht += scale * snoise(freq * vv);
k3d/share/shaders/k3d_luna.sl:144:	      freq *= 2;
k3d/share/shaders/k3d_luna.sl:153:	  freq = 1;
k3d/share/shaders/k3d_luna.sl:156:	  for(i = 0; i < 4; i += 1)
k3d/share/shaders/k3d_luna.sl:158:	      ht += scale * snoise(freq * vv);
k3d/share/shaders/k3d_luna.sl:159:	      freq *= 2;
k3d/share/shaders/k3d_luna.sl:163:	  if(radial_dist > rim_rad)
k3d/share/shaders/k3d_luna.sl:172:  if(pd >= rim_rad && pd < 0.4)
k3d/share/shaders/k3d_luna.sl:187:  Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_lunette.sl:1:/* renamed JMlinette.sl for RMR.  -- tal */
k3d/share/shaders/k3d_lunette.sl:4: * lunette.sl -- A pretty surface shader ideal for "ground planes".
k3d/share/shaders/k3d_lunette.sl:7: *   A grid pattern overlaid upon an fBm noise.  This shader is good for
k3d/share/shaders/k3d_lunette.sl:8: *   surfaces placed beneath your scene which act as the ground.  The default
k3d/share/shaders/k3d_lunette.sl:10: *   hero objects that you might wish to show off.  The shader is a copy of a
k3d/share/shaders/k3d_lunette.sl:11: *   pattern I saw in the background of another image entitled "Lunettes",
k3d/share/shaders/k3d_lunette.sl:17: *   urepeats, vrepeats - number of repeats of the grid pattern in u and v
k3d/share/shaders/k3d_lunette.sl:18: *   ulinewidth, vlinewidth - proportional width of the grid lines
k3d/share/shaders/k3d_lunette.sl:19: *   colorA, colorB - colors used in the background fBm noise
k3d/share/shaders/k3d_lunette.sl:20: *   baselinecolor - base color of the grid lines
k3d/share/shaders/k3d_lunette.sl:22: *   gridDensity - effective opacity of the grid lines
k3d/share/shaders/k3d_lunette.sl:23: *   noiseScale - scale factor for the fBm noise relative to the grid size
k3d/share/shaders/k3d_lunette.sl:24: *   noiseRandom - randomization factor for the fBm noise
k3d/share/shaders/k3d_lunette.sl:25: *   maxOctaves, lunacrity, gain - work as in the fBm function
k3d/share/shaders/k3d_lunette.sl:28: *   The shader should antialias itself quite well, since it uses antialiased
k3d/share/shaders/k3d_lunette.sl:29: *   noise functions and an box-filter antialiased grid function.
k3d/share/shaders/k3d_lunette.sl:42: * Base color for the "lunette" pattern.  The pattern is calculated in a two-
k3d/share/shaders/k3d_lunette.sl:43: * dimensional fashion using the coordinates ss and tt as texture / pattern
k3d/share/shaders/k3d_lunette.sl:48: *   ssrepeats, ttrepeats - Number of repeats of the grid pattern in both ss
k3d/share/shaders/k3d_lunette.sl:51: *   sslinewidth, ttlinewidth - Width of the grid lines in ss and tt
k3d/share/shaders/k3d_lunette.sl:52: *                              respectively; expressed as a fraction of the
k3d/share/shaders/k3d_lunette.sl:54: *   colorA, colorB - Two colors for the background pattern.
k3d/share/shaders/k3d_lunette.sl:55: *   noiseScale - Scale of the background fBm noise (relative to the size of
k3d/share/shaders/k3d_lunette.sl:56: *                a grid cell).  Increasing this value makes a finer, smaller
k3d/share/shaders/k3d_lunette.sl:58: *   noiseRandom - Randomization value for the noise.
k3d/share/shaders/k3d_lunette.sl:59: *   maxOctaves - Maximum number of octaves for the fBm noise.
k3d/share/shaders/k3d_lunette.sl:60: *   lunacrity - Lunacrity of the fBm noise.
k3d/share/shaders/k3d_lunette.sl:61: *   gain - Gain of the fBm noise.
k3d/share/shaders/k3d_lunette.sl:62: *   colorBenhance - After the noise has been calculated, there exists the
k3d/share/shaders/k3d_lunette.sl:63: *                   possibility to increase the amount of colorB present in
k3d/share/shaders/k3d_lunette.sl:64: *                   the output.  A value of colorBenhance = 1 means that
k3d/share/shaders/k3d_lunette.sl:67: *   gridDensity - Effective opacity of the grid pattern over the underlying
k3d/share/shaders/k3d_lunette.sl:69: *   baselinecolor - Base color of the grid lines.
k3d/share/shaders/k3d_lunette.sl:72:	float ss;		/* ss coordinate for the lunette pattern */
k3d/share/shaders/k3d_lunette.sl:73:	float tt;		/* tt coordinate for the lunette pattern */
k3d/share/shaders/k3d_lunette.sl:74:	float ssrepeats;	/* number of repeats in the ss direction */
k3d/share/shaders/k3d_lunette.sl:75:	float ttrepeats;	/* number of repeats in the tt direction */
k3d/share/shaders/k3d_lunette.sl:76:	float sslinewidth;	/* proportional width of lines in ss */
k3d/share/shaders/k3d_lunette.sl:77:	float ttlinewidth;	/* proportional width of lines in tt */
k3d/share/shaders/k3d_lunette.sl:78:	color colorA;		/* first color in the pattern */
k3d/share/shaders/k3d_lunette.sl:80:	float noiseScale;	/* scale of the noise relative to the grid */
k3d/share/shaders/k3d_lunette.sl:81:	float noiseRandom;	/* randomization for the noise */
k3d/share/shaders/k3d_lunette.sl:82:	uniform float maxOctaves;	/* maximum number of octives for the noise */
k3d/share/shaders/k3d_lunette.sl:83:	uniform float lunacrity;	/* lunacrity of the noise */
k3d/share/shaders/k3d_lunette.sl:84:	uniform float gain;		/* gain for the noise */
k3d/share/shaders/k3d_lunette.sl:85:	float colorBenhance;	/* amount to enhance color B */
k3d/share/shaders/k3d_lunette.sl:86:	float gridDensity;	/* density of the grid pattern */
k3d/share/shaders/k3d_lunette.sl:87:	color baselinecolor;	/* base color for the lines */
k3d/share/shaders/k3d_lunette.sl:91:	 * Calculate pulsegrid, which is a variable indicating the value of
k3d/share/shaders/k3d_lunette.sl:95:	 * antialising at the edges of the grid.
k3d/share/shaders/k3d_lunette.sl:97:	float pulsess = filteredpulsetrain(
k3d/share/shaders/k3d_lunette.sl:98:		1/ssrepeats, sslinewidth, ss, filterwidth(ss)
k3d/share/shaders/k3d_lunette.sl:100:	float pulsett = filteredpulsetrain(
k3d/share/shaders/k3d_lunette.sl:101:		1/ttrepeats, ttlinewidth, tt, filterwidth(tt)
k3d/share/shaders/k3d_lunette.sl:103:	float pulsegrid = 1 - min(pulsess, pulsett); 
k3d/share/shaders/k3d_lunette.sl:106:	 * Find the base color for the pattern.  The base color is a mix
k3d/share/shaders/k3d_lunette.sl:112:	float noisefilterwidth = filterwidthp(noisePt);
k3d/share/shaders/k3d_lunette.sl:113:	float noiseamt = (fBm(
k3d/share/shaders/k3d_lunette.sl:114:		noisePt, noisefilterwidth, maxOctaves, lunacrity, gain
k3d/share/shaders/k3d_lunette.sl:120:	 * find the base line color for the grid pattern
k3d/share/shaders/k3d_lunette.sl:125:	 * return the mix between the base grid and the colorful noise
k3d/share/shaders/k3d_lunette.sl:131:surface k3d_lunette (
k3d/share/shaders/k3d_lunette.sl:133:	float Ka = 1;
k3d/share/shaders/k3d_lunette.sl:134:	float Kd = .5;
k3d/share/shaders/k3d_lunette.sl:135:	float Ks = .5;
k3d/share/shaders/k3d_lunette.sl:136:	float roughness = .1;
k3d/share/shaders/k3d_lunette.sl:139:	float urepeats = 30;		/* Number of repeats in u */
k3d/share/shaders/k3d_lunette.sl:140:	float ulinewidth = 0.125;	/* Relative width of grid lines in u */
k3d/share/shaders/k3d_lunette.sl:141:	float vrepeats = 30;		/* Number of repeats in v */
k3d/share/shaders/k3d_lunette.sl:142:	float vlinewidth = 0.12;	/* Relative width of grid lines in v */
k3d/share/shaders/k3d_lunette.sl:147:	float colorBenhance = 1.6;	/* Enhancement of colorB in output */
k3d/share/shaders/k3d_lunette.sl:148:	float gridDensity = .5;		/* Effective opacity of the grid */
k3d/share/shaders/k3d_lunette.sl:149:	/* fBm noise parameters */
k3d/share/shaders/k3d_lunette.sl:150:	float noiseScale = .3;
k3d/share/shaders/k3d_lunette.sl:151:	float noiseRandom = 0;
k3d/share/shaders/k3d_lunette.sl:152:	float maxOctaves = 5;
k3d/share/shaders/k3d_lunette.sl:153:	float lunacrity = 1.3;
k3d/share/shaders/k3d_lunette.sl:154:	float gain = .7;
k3d/share/shaders/k3d_lunette.sl:157:	 * fetch the lunette color
k3d/share/shaders/k3d_lunette.sl:168:	normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_lunette.sl:171:	Ci = Os * ( cc * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_lunette.sl:172:		specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_map_pattern_1.sl:1:surface k3d_map_pattern_1 (
k3d/share/shaders/k3d_map_pattern_1.sl:3:float channel1=4; 
k3d/share/shaders/k3d_map_pattern_1.sl:4:float swidth1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:5:float twidth1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:6:float samples1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:7:float ss1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:8:float tt1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:9:float txtscale=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:12:float grainy=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:13:float Ka = 1;
k3d/share/shaders/k3d_map_pattern_1.sl:14:float Kd = .5; 
k3d/share/shaders/k3d_map_pattern_1.sl:15:float Ks = .5; 
k3d/share/shaders/k3d_map_pattern_1.sl:16:float roughness = .1;
k3d/share/shaders/k3d_map_pattern_1.sl:20:/** Surface main-code start **/
k3d/share/shaders/k3d_map_pattern_1.sl:24:float temp_ss1;
k3d/share/shaders/k3d_map_pattern_1.sl:25:float temp_tt1;
k3d/share/shaders/k3d_map_pattern_1.sl:26:if (ss1 ==1) {temp_ss1=s;} else {temp_ss1=ss1;}
k3d/share/shaders/k3d_map_pattern_1.sl:27:if (tt1 ==1) {temp_tt1=t;} else {temp_tt1=tt1;}
k3d/share/shaders/k3d_map_pattern_1.sl:28:if ( map1=="" ) 
k3d/share/shaders/k3d_map_pattern_1.sl:34:if (channel1 < 0 || channel1 > 3)
k3d/share/shaders/k3d_map_pattern_1.sl:44:float temp_f_3=(comp(temt_c1,0)+comp(temt_c1,1)+comp(temt_c1,2))/3;
k3d/share/shaders/k3d_map_pattern_1.sl:47:float r, r2;
k3d/share/shaders/k3d_map_pattern_1.sl:48:float my_t;
k3d/share/shaders/k3d_map_pattern_1.sl:51:PP = txtscale * transform ("shader", P);
k3d/share/shaders/k3d_map_pattern_1.sl:53:my_t = zcomp(PP) / temp_f_3;
k3d/share/shaders/k3d_map_pattern_1.sl:58:r = temp_f_3 * noise (PQ);
k3d/share/shaders/k3d_map_pattern_1.sl:59:r -= floor (r);
k3d/share/shaders/k3d_map_pattern_1.sl:67:/** Surface main-code end **/
k3d/share/shaders/k3d_map_pattern_1.sl:68:normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_map_pattern_1.sl:69:C_temp1 = Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_matte.sl:1:/* matte.sl - Standard matte surface for RenderMan Interface.
k3d/share/shaders/k3d_matte.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_matte.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_matte.sl:9:surface k3d_matte(float Ka = 1;
k3d/share/shaders/k3d_matte.sl:10:		  float Kd = 1;)
k3d/share/shaders/k3d_matte.sl:12:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_matte.sl:14:  Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_metal.sl:1:/* metal.sl - Standard metal surface for RenderMan Interface.
k3d/share/shaders/k3d_metal.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_metal.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_metal.sl:9:surface k3d_metal(float Ka = 1;
k3d/share/shaders/k3d_metal.sl:10:		  float Ks = 1;
k3d/share/shaders/k3d_metal.sl:11:		  float roughness = .1;)
k3d/share/shaders/k3d_metal.sl:13:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_metal.sl:16:  Ci = Os * Cs * (Ka * ambient() + Ks * specular(Nf, V, roughness));
k3d/share/shaders/k3d_mondometal.sl:2: * felipe@siggraph.org.mx

k3d/share/shaders/k3d_mondometal.sl:4: * Layered shader with mondo as a base and a metal modulated with a matte file.

k3d/share/shaders/k3d_mondometal.sl:7: * las partes blancas producen un efecto metalico y donde lo oscuro 

k3d/share/shaders/k3d_mondometal.sl:11:surface

k3d/share/shaders/k3d_mondometal.sl:14:    float abColorMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:15:    float abUseColorMapAlpha = 0;

k3d/share/shaders/k3d_mondometal.sl:16:    float abDiffuse = .8;

k3d/share/shaders/k3d_mondometal.sl:17:    string abDiffuseMap = "";

k3d/share/shaders/k3d_mondometal.sl:18:    float abDiffuseMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:19:    float abSpecular = .3;

k3d/share/shaders/k3d_mondometal.sl:21:    float abSpecularMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:24:    float abSpecularColorMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:25:    float abRoughness = .3;

k3d/share/shaders/k3d_mondometal.sl:27:    float abRoughnessMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:29:    float abInvertTransparencyMap = 0;

k3d/share/shaders/k3d_mondometal.sl:30:    float abTransparencyMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:33:    float abIncandescenseMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:34:    string abReflectionMap = "";

k3d/share/shaders/k3d_mondometal.sl:35:    float abReflectionUp = 0;

k3d/share/shaders/k3d_mondometal.sl:36:    float abReflectivity = .1;

k3d/share/shaders/k3d_mondometal.sl:37:    float abReflectionMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:39:    float abBumpMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:40:    float abBumpScale = 1.0;

k3d/share/shaders/k3d_mondometal.sl:41:    float abDoDisplacement = 0.0;

k3d/share/shaders/k3d_mondometal.sl:42:    float abUseNormals = 0;

k3d/share/shaders/k3d_mondometal.sl:43:    float Ka = 0.05;

k3d/share/shaders/k3d_mondometal.sl:44:    float Kd = 0.80;

k3d/share/shaders/k3d_mondometal.sl:45:    float Ks = 0.80;

k3d/share/shaders/k3d_mondometal.sl:46:    float roughness = 0.25;

k3d/share/shaders/k3d_mondometal.sl:59:    normal Nf;

k3d/share/shaders/k3d_mondometal.sl:62:    color Csurf, Cspec, Copac, Cincand, Crefl;

k3d/share/shaders/k3d_mondometal.sl:64:    float ss, tt, roughness, diff, spec, bmp;

k3d/share/shaders/k3d_mondometal.sl:67:    ss = vector(s, t, 1) . vector(transform("shader", STMatrix0));

k3d/share/shaders/k3d_mondometal.sl:68:    tt = vector(s, t, 1) . vector(transform("shader", STMatrix1));

k3d/share/shaders/k3d_mondometal.sl:71:    if(abColorMap != "")

k3d/share/shaders/k3d_mondometal.sl:73:        Csurf = Cs * color texture(abColorMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:76:        if(abUseColorMapAlpha != 0)

k3d/share/shaders/k3d_mondometal.sl:78:            Copac = float texture(abColorMap[3], ss, tt, 

k3d/share/shaders/k3d_mondometal.sl:82:            Csurf = Csurf / Copac;

k3d/share/shaders/k3d_mondometal.sl:91:        Csurf = Cs;

k3d/share/shaders/k3d_mondometal.sl:95:    /* determine diffuse **/

k3d/share/shaders/k3d_mondometal.sl:96:    if(abDiffuseMap != "")

k3d/share/shaders/k3d_mondometal.sl:98:        diff = abDiffuse * float texture(abDiffuseMap, ss, tt, 

k3d/share/shaders/k3d_mondometal.sl:99:                            "swidth", abDiffuseMapBlur,

k3d/share/shaders/k3d_mondometal.sl:100:                            "twidth", abDiffuseMapBlur );

k3d/share/shaders/k3d_mondometal.sl:104:        diff = abDiffuse;

k3d/share/shaders/k3d_mondometal.sl:108:    if(abSpecularMap != "")

k3d/share/shaders/k3d_mondometal.sl:110:        spec = abSpecular * float texture(abSpecularMap, ss, tt, 

k3d/share/shaders/k3d_mondometal.sl:121:    if(abSpecularColorMap != "")

k3d/share/shaders/k3d_mondometal.sl:132:    if(abRoughnessMap != "")

k3d/share/shaders/k3d_mondometal.sl:134:        roughness = abRoughness * float texture(abRoughnessMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:144:    if(abTransparencyMap != "")

k3d/share/shaders/k3d_mondometal.sl:146:        if(abInvertTransparencyMap != 0)

k3d/share/shaders/k3d_mondometal.sl:161:    if(abIncandescenseMap != "")

k3d/share/shaders/k3d_mondometal.sl:174:    if( abBumpMap != "" )

k3d/share/shaders/k3d_mondometal.sl:176:        bmp = abBumpScale * float texture( abBumpMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:179:        PP = transform("shader", P);

k3d/share/shaders/k3d_mondometal.sl:180:        Nf = normalize( ntransform("shader", N) );

k3d/share/shaders/k3d_mondometal.sl:181:        PP += bmp * Nf;

k3d/share/shaders/k3d_mondometal.sl:182:        PP = transform("shader", "current", PP);

k3d/share/shaders/k3d_mondometal.sl:183:        Nf = calculatenormal(PP);

k3d/share/shaders/k3d_mondometal.sl:185:	if (abUseNormals == 1) {

k3d/share/shaders/k3d_mondometal.sl:187:	    Nf = normalize(Nf) + deltaN;

k3d/share/shaders/k3d_mondometal.sl:190:        if( abDoDisplacement == 1.0 )

k3d/share/shaders/k3d_mondometal.sl:195:        Nf = N;

k3d/share/shaders/k3d_mondometal.sl:199:    Nf = faceforward(normalize(Nf), I , normalize(Nf));

k3d/share/shaders/k3d_mondometal.sl:202:    /* get reflection from environment map **/

k3d/share/shaders/k3d_mondometal.sl:203:    if( abReflectionMap != "" )

k3d/share/shaders/k3d_mondometal.sl:205:        D = reflect(-V, Nf);

k3d/share/shaders/k3d_mondometal.sl:206:        D = vtransform("worldspace", D);

k3d/share/shaders/k3d_mondometal.sl:207:        if( abReflectionUp != 0 )

k3d/share/shaders/k3d_mondometal.sl:211:        Crefl = abReflectivity * 

k3d/share/shaders/k3d_mondometal.sl:212:                color environment(abReflectionMap, D,

k3d/share/shaders/k3d_mondometal.sl:213:                                    "swidth", abReflectionMapBlur,

k3d/share/shaders/k3d_mondometal.sl:214:                                    "twidth", abReflectionMapBlur );

k3d/share/shaders/k3d_mondometal.sl:217:        Crefl = color(0);

k3d/share/shaders/k3d_mondometal.sl:220:    if(metalMatte != "")

k3d/share/shaders/k3d_mondometal.sl:233:    if(comp(Cmatte, 1) < 0.5){

k3d/share/shaders/k3d_mondometal.sl:234:      Ci = Os * Copac * (Csurf * (Cincand + ambient() + diff * diffuse(Nf)) + 

k3d/share/shaders/k3d_mondometal.sl:235:           (spec * Cspec * (specular(Nf, V, roughness) + Crefl) ));

k3d/share/shaders/k3d_mondometal.sl:239:      Ci = Cmetal * Oi * (Ka * ambient() + Kd * diffuse(Nf) +

k3d/share/shaders/k3d_mondometal.sl:240:            Ks * specular(Nf,-normalize(I),roughness));

k3d/share/shaders/k3d_mysky.sl:1:/* I took wave's lead and renamed starfield to KMPuffyclouds.sl -- tal@cs.caltech.edu */

k3d/share/shaders/k3d_mysky.sl:6: * puffyclouds.sl -- RenderMan compatible surface shader for puffy

k3d/share/shaders/k3d_mysky.sl:11: *    on a bright sunny day.  Works as a basic thresholded fBm.  Since

k3d/share/shaders/k3d_mysky.sl:13: *    lighting into account.  If you wanted a lit surface that looked like

k3d/share/shaders/k3d_mysky.sl:14: *    puffy clouds (like painted clouds on a wall), then it would be pretty

k3d/share/shaders/k3d_mysky.sl:18: *    txtscale - overall scaling factor

k3d/share/shaders/k3d_mysky.sl:20: *    octaves, omega, lambda - control the fractal appearance of the clouds

k3d/share/shaders/k3d_mysky.sl:21: *    threshold - fBm sum below this level is just blue sky

k3d/share/shaders/k3d_mysky.sl:25: *    setting the "octaves" parameter based on distance from eye point.

k3d/share/shaders/k3d_mysky.sl:40: * this file last updated 18 Apr 1994

k3d/share/shaders/k3d_mysky.sl:47:#define snoise(x) ((2*noise(x))-1)

k3d/share/shaders/k3d_mysky.sl:50:surface 

k3d/share/shaders/k3d_mysky.sl:51:k3d_mysky (float Ka = 0, Kd = 0;

k3d/share/shaders/k3d_mysky.sl:52:	     float txtscale = 1;

k3d/share/shaders/k3d_mysky.sl:55:	     float octaves = 8, omega = 0.5, lambda = 2;

k3d/share/shaders/k3d_mysky.sl:56:	     float threshold = 0;

k3d/share/shaders/k3d_mysky.sl:59:  float value;

k3d/share/shaders/k3d_mysky.sl:60:  color Ct;      /* Color of the surface */

k3d/share/shaders/k3d_mysky.sl:61:  point PP;      /* Surface point in shader space */

k3d/share/shaders/k3d_mysky.sl:62:  float i, a, l, o;

k3d/share/shaders/k3d_mysky.sl:64:  PP = txtscale * transform ("shader", P);

k3d/share/shaders/k3d_mysky.sl:66:  /* Use fractional Brownian motion to compute a value for this point */

k3d/share/shaders/k3d_mysky.sl:67:  /*  value = fBm (PP, omega, lambda, octaves); */

k3d/share/shaders/k3d_mysky.sl:70:  for (i = 0;  i < octaves;  i += 1) {

k3d/share/shaders/k3d_noisysmoke.sl:1:#define snoise(p) (2*noise(p)-1)
k3d/share/shaders/k3d_noisysmoke.sl:4:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_noisysmoke.sl:5:#define GADD(PP,PW,li,g)                                                    \
k3d/share/shaders/k3d_noisysmoke.sl:6:         if (use_lighting > 0) {                                            \
k3d/share/shaders/k3d_noisysmoke.sl:10:         if (use_noise != 0) {                                              \
k3d/share/shaders/k3d_noisysmoke.sl:11:             Psmoke = PP*freq;                                              \
k3d/share/shaders/k3d_noisysmoke.sl:13:             /* Optimize: one octave only if not lit */                     \
k3d/share/shaders/k3d_noisysmoke.sl:14:	     if (comp(li,0)+comp(li,1)+comp(li,2) > 0.01) {                 \
k3d/share/shaders/k3d_noisysmoke.sl:15:                 f=1;                                                       \
k3d/share/shaders/k3d_noisysmoke.sl:16:                 for (i=1;  i<octaves;  i+=1) {                             \
k3d/share/shaders/k3d_noisysmoke.sl:17:                      f *= 0.5;  Psmoke *= 2;                               \
k3d/share/shaders/k3d_noisysmoke.sl:18:                      smoke += f*snoise(Psmoke);                            \
k3d/share/shaders/k3d_noisysmoke.sl:30:volume k3d_noisysmoke(float density = 60;
k3d/share/shaders/k3d_noisysmoke.sl:31:		      float integstart = 0, integend = 100;
k3d/share/shaders/k3d_noisysmoke.sl:32:		      float stepsize = 0.1; float debug = 0;
k3d/share/shaders/k3d_noisysmoke.sl:33:		      float use_lighting = 1; float use_noise = 1;
k3d/share/shaders/k3d_noisysmoke.sl:34:		      color scatter = 1;	/* for sky, try (1, 2.25, 21) */
k3d/share/shaders/k3d_noisysmoke.sl:35:		      float octaves = 3, freq = 1, smokevary = 1;
k3d/share/shaders/k3d_noisysmoke.sl:36:		      float lightscale = 15;
k3d/share/shaders/k3d_noisysmoke.sl:39:#if 0
k3d/share/shaders/k3d_noisysmoke.sl:40:  /* PRMan and BMRT used to have I reverse of each other, conflict in spec */
k3d/share/shaders/k3d_noisysmoke.sl:42:  vector incident = vtransform("shader", -I);
k3d/share/shaders/k3d_noisysmoke.sl:46:  vector incident = vtransform("shader", I);
k3d/share/shaders/k3d_noisysmoke.sl:47:#endif
k3d/share/shaders/k3d_noisysmoke.sl:48:  point origin = transform("shader", Worigin);
k3d/share/shaders/k3d_noisysmoke.sl:50:  float d, tau;
k3d/share/shaders/k3d_noisysmoke.sl:51:  color Cv = 0, Ov = 0;		/* net color & opacity of volume */
k3d/share/shaders/k3d_noisysmoke.sl:52:  color dC, dO;			/* differential color & opacity */
k3d/share/shaders/k3d_noisysmoke.sl:53:  float ss, dtau, last_dtau, end;
k3d/share/shaders/k3d_noisysmoke.sl:54:  float nsteps = 0;		/* record number of integration steps */
k3d/share/shaders/k3d_noisysmoke.sl:58:  float f, smoke;
k3d/share/shaders/k3d_noisysmoke.sl:59:  uniform float i;
k3d/share/shaders/k3d_noisysmoke.sl:63:  /* Integrate forwards from the start point */
k3d/share/shaders/k3d_noisysmoke.sl:65:  if(d < end)
k3d/share/shaders/k3d_noisysmoke.sl:68:      WIN = vtransform("shader", "current", IN);
k3d/share/shaders/k3d_noisysmoke.sl:82:	    /* Our goal now is to find dC and dO, the color and opacity
k3d/share/shaders/k3d_noisysmoke.sl:83:	     * of the portion of the volume covered by this step.
k3d/share/shaders/k3d_noisysmoke.sl:94:	  /* Now we adjust Cv/Ov to account for dC and dO */
k3d/share/shaders/k3d_noisysmoke.sl:104:  /* Ci & Oi are the color (premultiplied by opacity) and opacity of 
k3d/share/shaders/k3d_noisysmoke.sl:106:   * Now Cv is the light contributed by the volume itself, and Ov is the
k3d/share/shaders/k3d_noisysmoke.sl:107:   * opacity of the volume, i.e. (1-Ov)*Ci is the light from the background
k3d/share/shaders/k3d_noisysmoke.sl:113:  if(debug > 0)
k3d/share/shaders/k3d_noisysmoke.sl:115:      printf("nsteps = %f, t1 = %f, end = %f\n", nsteps, integstart, end);
k3d/share/shaders/k3d_noisysmoke.sl:116:      printf("   Cv = %c, Ov = %c\n", Cv, Ov);
k3d/share/shaders/k3d_null.sl:2: * Null shader - does nothing to a surface
k3d/share/shaders/k3d_null.sl:8:surface
k3d/share/shaders/k3d_oak.sl:6: *    pattern, one should translate the shadingspace (which defaults to
k3d/share/shaders/k3d_oak.sl:7: *    "shader").  This makes a fairly plain, unfinished wood, that looks
k3d/share/shaders/k3d_oak.sl:10: * Parameters for the coordinate mapping: 
k3d/share/shaders/k3d_oak.sl:12: *   shadingfreq - overall scaling factor for the pattern
k3d/share/shaders/k3d_oak.sl:13: *   Pref - if supplied, gives the reference pose
k3d/share/shaders/k3d_oak.sl:15: * Parameters for the color and pattern: 
k3d/share/shaders/k3d_oak.sl:18: *   ringfreq - mean frequency of ring spacing
k3d/share/shaders/k3d_oak.sl:20: *   grainfreq - frequency of the fine grain
k3d/share/shaders/k3d_oak.sl:21: *   ringnoise, ringnoisefreq - general warping of the domain
k3d/share/shaders/k3d_oak.sl:22: *   trunkwobble, trunkwobblefreq - controls noise which wobbles the
k3d/share/shaders/k3d_oak.sl:23: *       axis of the trunk so that it's not perfectly on the z axis.
k3d/share/shaders/k3d_oak.sl:24: *   angularwobble, angularwobblefreq - warping indexed by angle about
k3d/share/shaders/k3d_oak.sl:27: *       grain are weighted.  0 turns one off, 1 makes full effect.
k3d/share/shaders/k3d_oak.sl:28: *   divotdepth - depth (in shader units) of the displacement due to
k3d/share/shaders/k3d_oak.sl:30: *   truedisp - 1 for true displacement, 0 for bump mapping
k3d/share/shaders/k3d_oak.sl:32: * Parameters for illumination model:
k3d/share/shaders/k3d_oak.sl:54:surface k3d_oak(float Ka = 1, Kd = 1, Ks = .25, roughness = 0.2;
k3d/share/shaders/k3d_oak.sl:56:		float ringfreq = 8, ringunevenness = 0.5;
k3d/share/shaders/k3d_oak.sl:57:		float ringnoise = 0.02, ringnoisefreq = 1;
k3d/share/shaders/k3d_oak.sl:58:		float grainfreq = 25;
k3d/share/shaders/k3d_oak.sl:59:		float trunkwobble = 0.15, trunkwobblefreq = 0.025;
k3d/share/shaders/k3d_oak.sl:60:		float angularwobble = 1, angularwobblefreq = 1.5;
k3d/share/shaders/k3d_oak.sl:61:		float divotdepth = 0.05;
k3d/share/shaders/k3d_oak.sl:64:		float ringy = 1, grainy = 1;
k3d/share/shaders/k3d_oak.sl:65:		float truedisp = 0;
k3d/share/shaders/k3d_oak.sl:69:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_oak.sl:71:  float wood;
k3d/share/shaders/k3d_oak.sl:73:    oaktexture(Pshad, dPshad, ringfreq, ringunevenness, grainfreq, ringnoise,
k3d/share/shaders/k3d_oak.sl:74:	       ringnoisefreq, trunkwobble, trunkwobblefreq, angularwobble,
k3d/share/shaders/k3d_oak.sl:75:	       angularwobblefreq, ringy, grainy);
k3d/share/shaders/k3d_oak.sl:77:  Nf = faceforward(Displace(Nf, "shader", -wood * divotdepth, truedisp), I);
k3d/share/shaders/k3d_oak.sl:80:  Ci = MaterialPlastic(Nf, Cwood, Ka, Kd, Ks * (1 - 0.5 * wood), roughness);
k3d/share/shaders/k3d_oakplank.sl:7: *    a shifted version of the oaktexture function from oak.h.
k3d/share/shaders/k3d_oakplank.sl:9: * Parameters for the coordinate mapping: 
k3d/share/shaders/k3d_oakplank.sl:11: *   shadingfreq - overall scaling factor for the pattern
k3d/share/shaders/k3d_oakplank.sl:12: *   Pref - if supplied, gives the reference pose
k3d/share/shaders/k3d_oakplank.sl:14: * Parameters for the pattern of the plank structure: 
k3d/share/shaders/k3d_oakplank.sl:15: *   plankwidth, planklength - size of the planks
k3d/share/shaders/k3d_oakplank.sl:16: *   groovewidth, grooveheight - width of the grooves between planks
k3d/share/shaders/k3d_oakplank.sl:17: *   Cgroove - color of the grooves between the planks
k3d/share/shaders/k3d_oakplank.sl:18: *   groovedepth - how far down do the grooves displace?
k3d/share/shaders/k3d_oakplank.sl:22: * Parameters for the color and pattern of the wood grain: 
k3d/share/shaders/k3d_oakplank.sl:25: *   ringfreq - mean frequency of ring spacing
k3d/share/shaders/k3d_oakplank.sl:27: *   grainfreq - frequency of the fine grain
k3d/share/shaders/k3d_oakplank.sl:28: *   ringnoise, ringnoisefreq - general warping of the domain
k3d/share/shaders/k3d_oakplank.sl:29: *   trunkwobble, trunkwobblefreq - controls noise which wobbles the
k3d/share/shaders/k3d_oakplank.sl:30: *       axis of the trunk so that it's not perfectly on the z axis.
k3d/share/shaders/k3d_oakplank.sl:31: *   angularwobble, angularwobblefreq - warping indexed by angle about
k3d/share/shaders/k3d_oakplank.sl:34: *       grain are weighted.  0 turns one off, 1 makes full effect.
k3d/share/shaders/k3d_oakplank.sl:35: *   divotdepth - depth (in shader units) of the displacement due to
k3d/share/shaders/k3d_oakplank.sl:37: *   truedisp - 1 for true displacement, 0 for bump mapping
k3d/share/shaders/k3d_oakplank.sl:39: * Parameters for illumination model:
k3d/share/shaders/k3d_oakplank.sl:41: *   Kr, blur, eta - reflection parameters for the tile
k3d/share/shaders/k3d_oakplank.sl:44: *   varnishlump, arnishlumpfreq - amp & freq of lumpiness in the varnish
k3d/share/shaders/k3d_oakplank.sl:56:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_oakplank.sl:71:/* Given 2-D texture coordinates ss,tt, filter widths ds, dt, and the
k3d/share/shaders/k3d_oakplank.sl:72: * width and height of the grooves between tiles, figure out which
k3d/share/shaders/k3d_oakplank.sl:76:float plankpattern(float ss, tt, ds, dt;
k3d/share/shaders/k3d_oakplank.sl:77:		   float plankwidth, planklength;
k3d/share/shaders/k3d_oakplank.sl:78:		   float groovewidth, grooveheight;
k3d/share/shaders/k3d_oakplank.sl:79:		   output float swhichplank, twhichplank;
k3d/share/shaders/k3d_oakplank.sl:80:		   output float splank, tplank;)
k3d/share/shaders/k3d_oakplank.sl:83:  swhichplank = floor(ss / plankwidth);
k3d/share/shaders/k3d_oakplank.sl:85:  /* Shift in t a random amount for each plank column */
k3d/share/shaders/k3d_oakplank.sl:86:  float newt = tt + planklength * cellnoise(swhichplank);
k3d/share/shaders/k3d_oakplank.sl:88:  twhichplank = floor(newt / planklength);
k3d/share/shaders/k3d_oakplank.sl:91:   * filtered pulsetrain functions.
k3d/share/shaders/k3d_oakplank.sl:93:  return filteredpulsetrain(groovewidth, plankwidth, ss + groovewidth / 2,
k3d/share/shaders/k3d_oakplank.sl:94:			    ds) * filteredpulsetrain(grooveheight,
k3d/share/shaders/k3d_oakplank.sl:102:surface k3d_oakplank(float Ka = 1, Kd = 1, Ks = .75, roughness = 0.1;
k3d/share/shaders/k3d_oakplank.sl:103:		     float Kr = 1, blur = 0, eta = 1.5;
k3d/share/shaders/k3d_oakplank.sl:106:		     float ringfreq = 8, ringunevenness = 0.5;
k3d/share/shaders/k3d_oakplank.sl:107:		     float ringnoise = 0.02, ringnoisefreq = 1;
k3d/share/shaders/k3d_oakplank.sl:108:		     float grainfreq = 25;
k3d/share/shaders/k3d_oakplank.sl:109:		     float trunkwobble = 0.15, trunkwobblefreq = 0.025;
k3d/share/shaders/k3d_oakplank.sl:110:		     float angularwobble = 1, angularwobblefreq = 1.5;
k3d/share/shaders/k3d_oakplank.sl:111:		     float divotdepth = 0.012, truedisp = 0;
k3d/share/shaders/k3d_oakplank.sl:115:		     float ringy = 1, grainy = 1;
k3d/share/shaders/k3d_oakplank.sl:116:		     float plankwidth = 2, planklength = 30;
k3d/share/shaders/k3d_oakplank.sl:117:		     float groovewidth = 0.05, grooveheight = 0.05;
k3d/share/shaders/k3d_oakplank.sl:118:		     float varyhue = 0.015, varysat = 0.1, varylum = 0.5;
k3d/share/shaders/k3d_oakplank.sl:119:		     float groovedepth = 0.03, edgewidth = 0.1;
k3d/share/shaders/k3d_oakplank.sl:120:		     float varnishlump = 0.01, varnishlumpfreq = 0.5;
k3d/share/shaders/k3d_oakplank.sl:124:  float ss = xcomp(Pshad), tt = ycomp(Pshad), height = zcomp(Pshad);
k3d/share/shaders/k3d_oakplank.sl:125:  float dss = filterwidth(ss), dtt = filterwidth(tt);
k3d/share/shaders/k3d_oakplank.sl:131:  float swhichplank, twhichplank, splank, tplank;
k3d/share/shaders/k3d_oakplank.sl:132:  float inplank = plankpattern(ss, tt, dss, dtt, plankwidth, planklength,
k3d/share/shaders/k3d_oakplank.sl:135:  float plankindex = swhichplank + 13 * twhichplank;
k3d/share/shaders/k3d_oakplank.sl:141:  float wood = oaktexture(Ppat, dPshad, ringfreq, ringunevenness, grainfreq,
k3d/share/shaders/k3d_oakplank.sl:142:			  ringnoise, ringnoisefreq, trunkwobble,
k3d/share/shaders/k3d_oakplank.sl:143:			  trunkwobblefreq, angularwobble,
k3d/share/shaders/k3d_oakplank.sl:144:			  angularwobblefreq, ringy, grainy);
k3d/share/shaders/k3d_oakplank.sl:150:  /* Displacement: the edges of the planks displace down a bit, as do
k3d/share/shaders/k3d_oakplank.sl:153:  float edgedisp = smoothpulse(0, edgewidth, plankwidth - edgewidth,
k3d/share/shaders/k3d_oakplank.sl:157:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_oakplank.sl:158:  float disp = -wood * divotdepth + groovedepth * (edgedisp - 1);
k3d/share/shaders/k3d_oakplank.sl:160:    varnishlump * filteredsnoise(Pshad * varnishlumpfreq,
k3d/share/shaders/k3d_oakplank.sl:161:				 dPshad * varnishlumpfreq);
k3d/share/shaders/k3d_oakplank.sl:162:  Nf = faceforward(Displace(Nf, "shader", disp, truedisp), I);
k3d/share/shaders/k3d_oakplank.sl:167:  float specadjusted = 1 + .3 * wood - 0.8 * (1 - inplank);
k3d/share/shaders/k3d_oakplank.sl:169:    MaterialShinyPlastic(Nf, Cwood, Ka, Kd, specadjusted * Ks, roughness,
k3d/share/shaders/k3d_orange.sl:2: * Actually it is a condensed version of the mango shader from Sig '92 "Writing RenderMan Shaders"
k3d/share/shaders/k3d_orange.sl:9: *	Creates an stippled orange surface.
k3d/share/shaders/k3d_orange.sl:23:#define BUMP_AMPLITUDE (1/30)
k3d/share/shaders/k3d_orange.sl:24:#define BUMP_FREQUENCY (35)
k3d/share/shaders/k3d_orange.sl:26:surface k3d_orange (
k3d/share/shaders/k3d_orange.sl:27:	float Ka = 1;
k3d/share/shaders/k3d_orange.sl:28:	float Kd = .8;
k3d/share/shaders/k3d_orange.sl:29:	float Ks = .8;
k3d/share/shaders/k3d_orange.sl:30:	float roughness = .2;
k3d/share/shaders/k3d_orange.sl:33:	point Nf, V;
k3d/share/shaders/k3d_orange.sl:45:	Nf = faceforward (normalize (newP), I);
k3d/share/shaders/k3d_orange.sl:49:	Ci = Cs * (Ka * ambient() + Kd * diffuse (Nf)) + Ks * specular (Nf, V, roughness);
k3d/share/shaders/k3d_orennayar.sl:4: * orennayar.sl - rough diffuse surface
k3d/share/shaders/k3d_orennayar.sl:8: *   Makes a rough surface using a BRDF which is more accurate than
k3d/share/shaders/k3d_orennayar.sl:12: *   an especially accurate one for rough surfaces.  Truly rough surfacs
k3d/share/shaders/k3d_orennayar.sl:13: *   tend to act more like retroreflectors than like isotropic scatterers.
k3d/share/shaders/k3d_orennayar.sl:22: *   Oren, Michael and Shree K. Nayar.  "Generalization of Lambert's
k3d/share/shaders/k3d_orennayar.sl:23: *         Reflectance Model," Computer Graphics Annual Conference
k3d/share/shaders/k3d_orennayar.sl:24: *         Series 1994 (Proceedings of SIGGRAPH '94), pp. 239-246.
k3d/share/shaders/k3d_orennayar.sl:28: *      light from the sources and applies Oren & Nayar's local reflectance
k3d/share/shaders/k3d_orennayar.sl:30: *      or a function and used in any other shader, in place of diffuse().
k3d/share/shaders/k3d_orennayar.sl:31: *   2. Examination of why rough surfaces are not Lambertian will lead
k3d/share/shaders/k3d_orennayar.sl:32: *      you to the solution to the famous "flat full moon" problem.
k3d/share/shaders/k3d_orennayar.sl:40:surface
k3d/share/shaders/k3d_orennayar.sl:41:k3d_orennayar (float Ka = 1;
k3d/share/shaders/k3d_orennayar.sl:42:	   float Kd = .5;
k3d/share/shaders/k3d_orennayar.sl:43:	   float sigma = 0.0; )
k3d/share/shaders/k3d_orennayar.sl:45:    point Nf, IN, Eye, LN;
k3d/share/shaders/k3d_orennayar.sl:48:    float C1, C2, C3;
k3d/share/shaders/k3d_orennayar.sl:49:    float theta_r, theta_i, cos_theta_i;
k3d/share/shaders/k3d_orennayar.sl:50:    float alpha, beta, sigma2, cos_phi_diff;
k3d/share/shaders/k3d_orennayar.sl:52:    Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_orennayar.sl:55:    theta_r = acos (Eye . Nf);
k3d/share/shaders/k3d_orennayar.sl:58:    illuminance (P, Nf, PI/2) {
k3d/share/shaders/k3d_orennayar.sl:60:	cos_theta_i = LN . Nf;
k3d/share/shaders/k3d_orennayar.sl:61:	cos_phi_diff = normalize(Eye-Nf*(Eye.Nf)) . normalize(LN - Nf*(LN.Nf));
k3d/share/shaders/k3d_orennayar.sl:67:	if (cos_phi_diff >= 0)
k3d/share/shaders/k3d_orennayar.sl:71:	L1 = Cs * (cos_theta_i * (C1 + cos_phi_diff * C2 * tan(beta) +
k3d/share/shaders/k3d_orennayar.sl:72:				  (1 - abs(cos_phi_diff)) * C3 * tan((alpha+beta)/2)));
k3d/share/shaders/k3d_orennayar.sl:74:			  (1 - cos_phi_diff*(4*beta*beta)/(PI*PI)));
k3d/share/shaders/k3d_outlet.sl:2: * outlet.sl -- surface shader for an electrical outlet
k3d/share/shaders/k3d_outlet.sl:5: *   Makes an electrical outlet.  Perfect for slapping on a bilinear
k3d/share/shaders/k3d_outlet.sl:7: *   twice as high as it is wide.  *Totally* cheesy if you see it from
k3d/share/shaders/k3d_outlet.sl:8: *   up close, but from across the room, it's a nice touch of detail.
k3d/share/shaders/k3d_outlet.sl:14: *   screwKs            Ks parameter for the screw
k3d/share/shaders/k3d_outlet.sl:20: *      June 1992 -- first written by lg for the Kitchen image
k3d/share/shaders/k3d_outlet.sl:23: * last modified  17 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_outlet.sl:28:surface
k3d/share/shaders/k3d_outlet.sl:29:k3d_outlet ( float Ka = 1, Kd = 1, Km = 0.1;
k3d/share/shaders/k3d_outlet.sl:30:	 float screwKs = 0.5; )
k3d/share/shaders/k3d_outlet.sl:33:  float x, y;
k3d/share/shaders/k3d_outlet.sl:34:  float ks, kd, roughness;
k3d/share/shaders/k3d_outlet.sl:35:  point Nf;
k3d/share/shaders/k3d_outlet.sl:37:  /* defaults */
k3d/share/shaders/k3d_outlet.sl:46:  if ((x*x + (y-1)*(y-1)) < 0.0025) {
k3d/share/shaders/k3d_outlet.sl:51:  else if (x > 0.08  &&  x < 0.14  &&
k3d/share/shaders/k3d_outlet.sl:56:  else if (x < 0.25  &&  ((y > 0.35 && y < 0.85) || (y > 1.15 && y < 1.65))) {
k3d/share/shaders/k3d_outlet.sl:57:      if (((x*x + (y-0.75)*(y-0.75)) < 0.0025) ||
k3d/share/shaders/k3d_outlet.sl:68:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_outlet.sl:70:  Ci = Os * ( Ct * (Ka*ambient() + kd*diffuse(Nf)) +
k3d/share/shaders/k3d_outlet.sl:71:	      ks * specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_outline.sl:1:/* IDoutline written by Ivan DeWolf
k3d/share/shaders/k3d_outline.sl:5:surface
k3d/share/shaders/k3d_outline.sl:6:k3d_outline(float width = .05)
k3d/share/shaders/k3d_outline.sl:10:  float dot = Nn . normalize(I);
k3d/share/shaders/k3d_painted_constant.sl:1:surface k3d_painted_constant(
k3d/share/shaders/k3d_painted_constant.sl:3:	float s0 = 0.0;
k3d/share/shaders/k3d_painted_constant.sl:4:	float s1 = 1.0;
k3d/share/shaders/k3d_painted_constant.sl:5:	float t0 = 0.0;
k3d/share/shaders/k3d_painted_constant.sl:6:	float t1 = 1.0;
k3d/share/shaders/k3d_painted_constant.sl:10:	float Ot = 1;
k3d/share/shaders/k3d_painted_constant.sl:12:	if(texturename != "")
k3d/share/shaders/k3d_painted_constant.sl:14:			float ss = mix(s0, s1, s);
k3d/share/shaders/k3d_painted_constant.sl:15:			float tt = mix(t0, t1, t);
k3d/share/shaders/k3d_painted_constant.sl:18:			Ot = float texture(texturename[3], ss, tt);
k3d/share/shaders/k3d_paintedplastic.sl:1:/* paintedplastic.sl - Standard texture map surface for RenderMan Interface.
k3d/share/shaders/k3d_paintedplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_paintedplastic.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_paintedplastic.sl:9: *    Apply a texture map to a plastic surface, indexing the texture
k3d/share/shaders/k3d_paintedplastic.sl:10: *    by the s,t parameters of the surface.
k3d/share/shaders/k3d_paintedplastic.sl:14: *    texturename - the name of the texture file.
k3d/share/shaders/k3d_paintedplastic.sl:18:surface k3d_paintedplastic(
k3d/share/shaders/k3d_paintedplastic.sl:19:	float Ka = 1.0;
k3d/share/shaders/k3d_paintedplastic.sl:20:	float Kd = 0.5;
k3d/share/shaders/k3d_paintedplastic.sl:21:	float Ks = 0.5;
k3d/share/shaders/k3d_paintedplastic.sl:22:	float roughness = 0.1;
k3d/share/shaders/k3d_paintedplastic.sl:25:	float s0 = 0.0;
k3d/share/shaders/k3d_paintedplastic.sl:26:	float s1 = 1.0;
k3d/share/shaders/k3d_paintedplastic.sl:27:	float t0 = 0.0;
k3d/share/shaders/k3d_paintedplastic.sl:28:	float t1 = 1.0;
k3d/share/shaders/k3d_paintedplastic.sl:32:	float Ot = 1;
k3d/share/shaders/k3d_paintedplastic.sl:34:	if(texturename != "")
k3d/share/shaders/k3d_paintedplastic.sl:36:			float ss = mix(s0, s1, s);
k3d/share/shaders/k3d_paintedplastic.sl:37:			float tt = mix(t0, t1, t);
k3d/share/shaders/k3d_paintedplastic.sl:40:			Ot = float texture(texturename[3], ss, tt);
k3d/share/shaders/k3d_paintedplastic.sl:43:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_paintedplastic.sl:46:	Ci = Oi * Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_parquet_plank.sl:2: * parquet_plank.sl -- another surface shader for wood.
k3d/share/shaders/k3d_parquet_plank.sl:5: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_parquet_plank.sl:6: *   like oak plank parquet floor tiles.  The actual wood and plank pattern
k3d/share/shaders/k3d_parquet_plank.sl:7: *   is based on my "planks" shader.  This shader works best if "s" and "t"
k3d/share/shaders/k3d_parquet_plank.sl:12: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_parquet_plank.sl:13: *   plankwidth - width of each plank (in terms of s/t)
k3d/share/shaders/k3d_parquet_plank.sl:14: *   plankspertile - number of planks in each parquet tile
k3d/share/shaders/k3d_parquet_plank.sl:15: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_parquet_plank.sl:16: *   grainscale - scaling for the fine grain
k3d/share/shaders/k3d_parquet_plank.sl:17: *   groovewidth - width of the grooves between the planks (in terms of s/t)
k3d/share/shaders/k3d_parquet_plank.sl:18: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_parquet_plank.sl:19: *   groovecolor - the color of the "grooves" between the planks
k3d/share/shaders/k3d_parquet_plank.sl:20: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_parquet_plank.sl:21: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_parquet_plank.sl:22: *   wavy - relative wavyness of the ring pattern
k3d/share/shaders/k3d_parquet_plank.sl:24: * ANTIALIASING: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_parquet_plank.sl:31:surface k3d_parquet_plank(float Ka = 1, Kd = 0.75, Ks = .15, roughness = .025;
k3d/share/shaders/k3d_parquet_plank.sl:33:			  float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_parquet_plank.sl:34:			  float txtscale = 1;
k3d/share/shaders/k3d_parquet_plank.sl:35:			  float plankspertile = 4;
k3d/share/shaders/k3d_parquet_plank.sl:39:			  float plankwidth = .05, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_plank.sl:40:			  float plankvary = 0.8;
k3d/share/shaders/k3d_parquet_plank.sl:41:			  float grainy = 1, wavy = 0.08;)
k3d/share/shaders/k3d_parquet_plank.sl:43:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_plank.sl:44:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_plank.sl:45:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_plank.sl:47:  float r, r2;
k3d/share/shaders/k3d_parquet_plank.sl:48:  normal Nf;
k3d/share/shaders/k3d_parquet_plank.sl:49:  float whichrow, whichplank;
k3d/share/shaders/k3d_parquet_plank.sl:50:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_plank.sl:52:  float groovy;
k3d/share/shaders/k3d_parquet_plank.sl:53:  float PGWIDTH, PGHEIGHT, GWF, GHF;
k3d/share/shaders/k3d_parquet_plank.sl:54:  float tmp, planklength;
k3d/share/shaders/k3d_parquet_plank.sl:69:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_parquet_plank.sl:71:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_parquet_plank.sl:74:  whichrow = floor(ss);
k3d/share/shaders/k3d_parquet_plank.sl:76:  whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_plank.sl:77:  if(mod(whichrow / plankspertile + whichplank, 2) >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:80:      whichrow = floor(ss);
k3d/share/shaders/k3d_parquet_plank.sl:82:      whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_plank.sl:96:  if(swidth >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:103:  if(twidth >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:120:  fade = smoothstep(1 / ringscale, 8 / ringscale, fwidth);
k3d/share/shaders/k3d_parquet_plank.sl:121:  if(fade < 0.999)
k3d/share/shaders/k3d_parquet_plank.sl:125:      r -= floor(r);
k3d/share/shaders/k3d_parquet_plank.sl:128:      r = (1 - fade) * r + 0.65 * fade;
k3d/share/shaders/k3d_parquet_plank.sl:131:       * Multiply the ring pattern by the fine grain
k3d/share/shaders/k3d_parquet_plank.sl:133:      fade = smoothstep(2 / grainscale, 8 / grainscale, fwidth);
k3d/share/shaders/k3d_parquet_plank.sl:134:      if(fade < 0.999)
k3d/share/shaders/k3d_parquet_plank.sl:138:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_parquet_plank.sl:152:    (1 - plankvary / 2 + plankvary * (float noise(whichplank + 0.5)));
k3d/share/shaders/k3d_parquet_plank.sl:159:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_parquet_plank.sl:160:	  specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_parquet_plank2.sl:3: * parquet_plank.sl -- another surface shader for wood.
k3d/share/shaders/k3d_parquet_plank2.sl:6: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_parquet_plank2.sl:7: *   like oak plank parquet floor tiles.  The actual wood and plank pattern
k3d/share/shaders/k3d_parquet_plank2.sl:8: *   is based on my "planks" shader.  This shader works best if "s" and "t"
k3d/share/shaders/k3d_parquet_plank2.sl:13: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_parquet_plank2.sl:14: *   plankwidth - width of each plank (in terms of s/t)
k3d/share/shaders/k3d_parquet_plank2.sl:15: *   plankspertile - number of planks in each parquet tile
k3d/share/shaders/k3d_parquet_plank2.sl:16: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_parquet_plank2.sl:17: *   grainscale - scaling for the fine grain
k3d/share/shaders/k3d_parquet_plank2.sl:18: *   groovewidth - width of the grooves between the planks (in terms of s/t)
k3d/share/shaders/k3d_parquet_plank2.sl:19: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_parquet_plank2.sl:20: *   groovecolor - the color of the "grooves" between the planks
k3d/share/shaders/k3d_parquet_plank2.sl:21: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_parquet_plank2.sl:22: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_parquet_plank2.sl:23: *   wavy - relative wavyness of the ring pattern
k3d/share/shaders/k3d_parquet_plank2.sl:25: * ANTIALIASING: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_parquet_plank2.sl:30: *         snail: Dept. of EE & CS
k3d/share/shaders/k3d_parquet_plank2.sl:36: *    10 Feb 1995 - modified by wave to change the name
k3d/share/shaders/k3d_parquet_plank2.sl:38: * last modified 10 Feb 1995 by wave
k3d/share/shaders/k3d_parquet_plank2.sl:44:surface
k3d/share/shaders/k3d_parquet_plank2.sl:45:k3d_parquet_plank2 (float Ka = 1, Kd = 0.75, Ks = .15, roughness = .025;
k3d/share/shaders/k3d_parquet_plank2.sl:47:	       float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_parquet_plank2.sl:48:	       float txtscale = 1;
k3d/share/shaders/k3d_parquet_plank2.sl:49:	       float plankspertile = 4;
k3d/share/shaders/k3d_parquet_plank2.sl:53:	       float plankwidth = .05, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_plank2.sl:54:	       float plankvary = 0.8;
k3d/share/shaders/k3d_parquet_plank2.sl:55:	       float grainy = 1, wavy = 0.08; )
k3d/share/shaders/k3d_parquet_plank2.sl:57:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_plank2.sl:58:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_plank2.sl:59:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_plank2.sl:61:  float r, r2;
k3d/share/shaders/k3d_parquet_plank2.sl:62:  point Nf;
k3d/share/shaders/k3d_parquet_plank2.sl:63:  float whichrow, whichplank;
k3d/share/shaders/k3d_parquet_plank2.sl:64:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_plank2.sl:66:  float groovy;
k3d/share/shaders/k3d_parquet_plank2.sl:67:  float PGWIDTH, PGHEIGHT, GWF, GHF;
k3d/share/shaders/k3d_parquet_plank2.sl:68:  float tilewidth, whichtile, tmp, planklength;
k3d/share/shaders/k3d_parquet_plank2.sl:79:  fwidth = max(swidth,twidth);
k3d/share/shaders/k3d_parquet_plank2.sl:81:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_parquet_plank2.sl:84:  whichrow = floor (ss);
k3d/share/shaders/k3d_parquet_plank2.sl:86:  whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_plank2.sl:87:  if (mod (whichrow/plankspertile + whichplank, 2) >= 1) {
k3d/share/shaders/k3d_parquet_plank2.sl:89:      whichrow = floor (ss);
k3d/share/shaders/k3d_parquet_plank2.sl:91:      whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_plank2.sl:103:  if (swidth >= 1)
k3d/share/shaders/k3d_parquet_plank2.sl:107:  if (twidth >= 1)
k3d/share/shaders/k3d_parquet_plank2.sl:121:  fade = smoothstep (1/ringscale, 8/ringscale, fwidth);
k3d/share/shaders/k3d_parquet_plank2.sl:122:  if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_plank2.sl:125:      r -= floor (r);
k3d/share/shaders/k3d_parquet_plank2.sl:127:      r = (1-fade)*r + 0.65*fade;
k3d/share/shaders/k3d_parquet_plank2.sl:130:       * Multiply the ring pattern by the fine grain
k3d/share/shaders/k3d_parquet_plank2.sl:132:      fade = smoothstep (2/grainscale, 8/grainscale, fwidth);
k3d/share/shaders/k3d_parquet_plank2.sl:133:      if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_plank2.sl:136:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_plank2.sl:153:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_parquet_plank2.sl:154:	      specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_parquet_tile.sl:2: * DWParquetTile.sl -- yet another surface shader for wood
k3d/share/shaders/k3d_parquet_tile.sl:4: * parquet_plank.sl -- another surface shader for wood.
k3d/share/shaders/k3d_parquet_tile.sl:7: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_parquet_tile.sl:8: *   like oak plank parquet floor tiles.  The actual wood and plank pattern
k3d/share/shaders/k3d_parquet_tile.sl:9: *   is based on my "planks" shader.  This shader works best if "s" and "t"
k3d/share/shaders/k3d_parquet_tile.sl:14: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_parquet_tile.sl:15: *   plankwidth - width of each plank (in terms of s/t)
k3d/share/shaders/k3d_parquet_tile.sl:16: *   plankspertile - number of planks in each parquet tile
k3d/share/shaders/k3d_parquet_tile.sl:17: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_parquet_tile.sl:18: *   grainscale - scaling for the fine grain
k3d/share/shaders/k3d_parquet_tile.sl:19: *   groovewidth - width of the grooves between the planks (in terms of s/t)
k3d/share/shaders/k3d_parquet_tile.sl:20: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_parquet_tile.sl:21: *   groovecolor - the color of the "grooves" between the planks
k3d/share/shaders/k3d_parquet_tile.sl:22: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_parquet_tile.sl:23: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_parquet_tile.sl:24: *   wavy - relative wavyness of the ring pattern
k3d/share/shaders/k3d_parquet_tile.sl:26: * ANTIALIASING: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_parquet_tile.sl:31: *         snail: Dept. of EE & CS
k3d/share/shaders/k3d_parquet_tile.sl:37: *    10 Feb 1995 - modified by wave to change the name
k3d/share/shaders/k3d_parquet_tile.sl:39: * last modified 10 Feb 1995 by wave
k3d/share/shaders/k3d_parquet_tile.sl:42: * modified again by Dan Weeks <dan@SpamSucks_mango.sfasu.edu> on 08 Dec 1996
k3d/share/shaders/k3d_parquet_tile.sl:43: *   - made one plank per tile like the flooring in our lab
k3d/share/shaders/k3d_parquet_tile.sl:45: *   - many thanks to Larry Gritz and wave for creating the original
k3d/share/shaders/k3d_parquet_tile.sl:53: *   - name from LGParquetPlank to DWParquetTile
k3d/share/shaders/k3d_parquet_tile.sl:54: *   - ringscale from 15 to 25
k3d/share/shaders/k3d_parquet_tile.sl:55: *   - grainscale from 60 to 55
k3d/share/shaders/k3d_parquet_tile.sl:56: *   - plankspertile from 4 to 1
k3d/share/shaders/k3d_parquet_tile.sl:57: *   - plankwidth from .05 to .2
k3d/share/shaders/k3d_parquet_tile.sl:59:surface
k3d/share/shaders/k3d_parquet_tile.sl:60:k3d_parquet_tile (float Ka = 1, Kd = 0.75, Ks = .15, roughness = .025;
k3d/share/shaders/k3d_parquet_tile.sl:62:	       float ringscale = 25, grainscale = 55;
k3d/share/shaders/k3d_parquet_tile.sl:63:	       float txtscale = 1;
k3d/share/shaders/k3d_parquet_tile.sl:64:	       float plankspertile = 1;
k3d/share/shaders/k3d_parquet_tile.sl:68:	       float plankwidth = .2, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_tile.sl:69:	       float plankvary = 0.8;
k3d/share/shaders/k3d_parquet_tile.sl:70:	       float grainy = 1, wavy = 0.08; )
k3d/share/shaders/k3d_parquet_tile.sl:72:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_tile.sl:73:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_tile.sl:74:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_tile.sl:76:  float r, r2;
k3d/share/shaders/k3d_parquet_tile.sl:77:  point Nf;
k3d/share/shaders/k3d_parquet_tile.sl:78:  float whichrow, whichplank;
k3d/share/shaders/k3d_parquet_tile.sl:79:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_tile.sl:81:  float groovy;
k3d/share/shaders/k3d_parquet_tile.sl:82:  float PGWIDTH, PGHEIGHT, GWF, GHF;
k3d/share/shaders/k3d_parquet_tile.sl:83:  float tilewidth, whichtile, tmp, planklength;
k3d/share/shaders/k3d_parquet_tile.sl:94:  fwidth = max(swidth,twidth);
k3d/share/shaders/k3d_parquet_tile.sl:96:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_parquet_tile.sl:99:  whichrow = floor (ss);
k3d/share/shaders/k3d_parquet_tile.sl:101:  whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_tile.sl:102:  if (mod (whichrow/plankspertile + whichplank, 2) >= 1) {
k3d/share/shaders/k3d_parquet_tile.sl:104:      whichrow = floor (ss);
k3d/share/shaders/k3d_parquet_tile.sl:106:      whichplank = floor(tt);
k3d/share/shaders/k3d_parquet_tile.sl:118:  if (swidth >= 1)
k3d/share/shaders/k3d_parquet_tile.sl:122:  if (twidth >= 1)
k3d/share/shaders/k3d_parquet_tile.sl:136:  fade = smoothstep (1/ringscale, 8/ringscale, fwidth);
k3d/share/shaders/k3d_parquet_tile.sl:137:  if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_tile.sl:140:      r -= floor (r);
k3d/share/shaders/k3d_parquet_tile.sl:142:      r = (1-fade)*r + 0.65*fade;
k3d/share/shaders/k3d_parquet_tile.sl:145:       * Multiply the ring pattern by the fine grain
k3d/share/shaders/k3d_parquet_tile.sl:147:      fade = smoothstep (2/grainscale, 8/grainscale, fwidth);
k3d/share/shaders/k3d_parquet_tile.sl:148:      if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_tile.sl:151:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_tile.sl:168:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_parquet_tile.sl:169:	      specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_particle.sl:1:/** Copied from RenderMan AppNote #18 */
k3d/share/shaders/k3d_particle.sl:3:surface k3d_particle()
k3d/share/shaders/k3d_planetclouds.sl:2: * planetclouds.sl - surface for a semi-opaque cloud layer to be put on
k3d/share/shaders/k3d_planetclouds.sl:6: *      When put on a sphere, sets the color & opacity of the sphere to
k3d/share/shaders/k3d_planetclouds.sl:8: *      The shader works by creating a fractal turbulence function over
k3d/share/shaders/k3d_planetclouds.sl:9: *   the surface, then modulating the opacity based on this function in
k3d/share/shaders/k3d_planetclouds.sl:15: *    distortionscale - controls the amount of texture distortion
k3d/share/shaders/k3d_planetclouds.sl:16: *    omega,lambda,octaves - the fractal characteristics of the clouds
k3d/share/shaders/k3d_planetclouds.sl:18: *    offset - controls the zero crossings (where the clouds disappear)
k3d/share/shaders/k3d_planetclouds.sl:24: *      surface of a planet (perhaps using the "terran" shader), and the
k3d/share/shaders/k3d_planetclouds.sl:26: *   2. The best effects are achieved when the clouds not only occlude
k3d/share/shaders/k3d_planetclouds.sl:27: *      the view of the planet, but also shadow it.  The way to do this
k3d/share/shaders/k3d_planetclouds.sl:29: *      then declare the cloud sphere as follows:
k3d/share/shaders/k3d_planetclouds.sl:32: *             Surface "planetclouds"
k3d/share/shaders/k3d_planetclouds.sl:35: *   3. The default values for the shader assume that the planet is
k3d/share/shaders/k3d_planetclouds.sl:37: *      to this shader will need to be altered if the size of your planet
k3d/share/shaders/k3d_planetclouds.sl:38: *      is radically different.
k3d/share/shaders/k3d_planetclouds.sl:53: * last modified 1 March 1994 by lg
k3d/share/shaders/k3d_planetclouds.sl:56:#define TWOPI (2*PI)
k3d/share/shaders/k3d_planetclouds.sl:59:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_planetclouds.sl:60:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_planetclouds.sl:61:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_planetclouds.sl:62:#define VERY_SMALL 0.001
k3d/share/shaders/k3d_planetclouds.sl:66:surface k3d_planetclouds(float Ka = 0.5, Kd = 0.75;
k3d/share/shaders/k3d_planetclouds.sl:67:			 float distortionscale = 1; float omega = 0.7;
k3d/share/shaders/k3d_planetclouds.sl:68:			 float lambda = 2; float octaves = 9;
k3d/share/shaders/k3d_planetclouds.sl:69:			 float offset = 0;)
k3d/share/shaders/k3d_planetclouds.sl:72:  point PP;			/* Point after distortion */
k3d/share/shaders/k3d_planetclouds.sl:73:  float l, o, a, i;		/* Loop control for fractal sum */
k3d/share/shaders/k3d_planetclouds.sl:74:  float result;			/* Fractal sum is stored here */
k3d/share/shaders/k3d_planetclouds.sl:76:  /* Transform to texture coordinates */
k3d/share/shaders/k3d_planetclouds.sl:77:  PP = transform("shader", P);
k3d/share/shaders/k3d_planetclouds.sl:81:  /* Second cirrus: replace DNoise with vector fBm */
k3d/share/shaders/k3d_planetclouds.sl:84:  /* Compute VLfBm */
k3d/share/shaders/k3d_planetclouds.sl:88:  for(i = 0; i < octaves && o >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_planetclouds.sl:97:  result += offset;
k3d/share/shaders/k3d_planetclouds.sl:99:  if(result < 0)
k3d/share/shaders/k3d_planetclouds.sl:103:  result /= (1 + offset);
k3d/share/shaders/k3d_planetclouds.sl:105:  /* Modulate surface opacity by the cloud value */
k3d/share/shaders/k3d_planetclouds.sl:109:  Ci = Oi * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_plank.sl:2: * plank.sl -- another surface shader for wood.
k3d/share/shaders/k3d_plank.sl:5: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_plank.sl:10: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_plank.sl:11: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_plank.sl:12: *   grainscale - scaling for the fine grain
k3d/share/shaders/k3d_plank.sl:13: *   plankwidth - width of each plank (in terms of s/t)
k3d/share/shaders/k3d_plank.sl:14: *   planklength - length of each plank (in terms of s/t)
k3d/share/shaders/k3d_plank.sl:15: *   groovewidth - width of the grooves between the planks (in terms of s/t)
k3d/share/shaders/k3d_plank.sl:16: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_plank.sl:17: *   groovecolor - the color of the "grooves" between the planks
k3d/share/shaders/k3d_plank.sl:18: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_plank.sl:19: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_plank.sl:20: *   wavy - relative wavyness of the ring pattern
k3d/share/shaders/k3d_plank.sl:22: * ANTIALIASING: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_plank.sl:29:surface k3d_plank(float Ka = 1, Kd = 0.75, Ks = .15, roughness = .05;
k3d/share/shaders/k3d_plank.sl:31:		  float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_plank.sl:32:		  float txtscale = 1;
k3d/share/shaders/k3d_plank.sl:36:		  float plankwidth = .05, planklength = .75, groovewidth =
k3d/share/shaders/k3d_plank.sl:37:		  0.001; float plankvary = 0.8;
k3d/share/shaders/k3d_plank.sl:38:		  float grainy = 1, wavy = 0.08;)
k3d/share/shaders/k3d_plank.sl:40:#define snoise(x) (2 * (float noise((x))) - 1)
k3d/share/shaders/k3d_plank.sl:41:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_plank.sl:42:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_plank.sl:44:  float r, r2;
k3d/share/shaders/k3d_plank.sl:45:  normal Nf;
k3d/share/shaders/k3d_plank.sl:46:  float whichrow, whichplank;
k3d/share/shaders/k3d_plank.sl:47:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_plank.sl:49:  float groovy;
k3d/share/shaders/k3d_plank.sl:50:  float PGWIDTH, PGHEIGHT, GWF, GHF;
k3d/share/shaders/k3d_plank.sl:64:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_plank.sl:66:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plank.sl:69:  whichrow = floor(ss);
k3d/share/shaders/k3d_plank.sl:73:  whichplank = floor(tt);
k3d/share/shaders/k3d_plank.sl:82:  if(swidth >= 1)
k3d/share/shaders/k3d_plank.sl:89:  if(twidth >= 1)
k3d/share/shaders/k3d_plank.sl:106:  fade = smoothstep(1 / ringscale, 8 / ringscale, fwidth);
k3d/share/shaders/k3d_plank.sl:107:  if(fade < 0.999)
k3d/share/shaders/k3d_plank.sl:111:      r -= floor(r);
k3d/share/shaders/k3d_plank.sl:114:      r = (1 - fade) * r + 0.65 * fade;
k3d/share/shaders/k3d_plank.sl:117:       * Multiply the ring pattern by the fine grain
k3d/share/shaders/k3d_plank.sl:119:      fade = smoothstep(2 / grainscale, 8 / grainscale, fwidth);
k3d/share/shaders/k3d_plank.sl:120:      if(fade < 0.999)
k3d/share/shaders/k3d_plank.sl:124:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_plank.sl:138:    (1 - plankvary / 2 + plankvary * (float noise(whichplank + 0.5)));
k3d/share/shaders/k3d_plank.sl:147:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_plank.sl:148:	  specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_plastic.sl:1:/* plastic.sl - Standard plastic surface for RenderMan Interface.
k3d/share/shaders/k3d_plastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_plastic.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_plastic.sl:9:surface k3d_plastic(float Ka = 1;
k3d/share/shaders/k3d_plastic.sl:10:		    float Kd = .5; float Ks = .5; float roughness = .1;
k3d/share/shaders/k3d_plastic.sl:14:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plastic.sl:16:  Ci = Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_plastic2.sl:14:surface
k3d/share/shaders/k3d_plastic2.sl:15:k3d_plastic2(float Ka = 1, Kd = 0.5, Ks = 0.5;
k3d/share/shaders/k3d_plastic2.sl:16:        float roughness = 0.1;
k3d/share/shaders/k3d_plastic2.sl:19:    point Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plastic2.sl:23:    Ci = Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf))
k3d/share/shaders/k3d_plastic2.sl:24:         + specularcolor * Ks * specular(Nf, V, roughness));
k3d/share/shaders/k3d_pointlight.sl:1:/* pointlight.sl - Standard point light source for RenderMan Interface.
k3d/share/shaders/k3d_pointlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_pointlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_pointlight.sl:9:light k3d_pointlight(float intensity = 3000;
k3d/share/shaders/k3d_pointlight.sl:11:		     point from = point "shader"(0, 0, 0);)
k3d/share/shaders/k3d_pointlight.sl:13:  illuminate(from) Cl = intensity * lightcolor / (L.L);
k3d/share/shaders/k3d_projectionmap_plastic.sl:6:// This program is free software; you can redistribute it and/or
k3d/share/shaders/k3d_projectionmap_plastic.sl:7:// modify it under the terms of the GNU General Public
k3d/share/shaders/k3d_projectionmap_plastic.sl:8:// License as published by the Free Software Foundation; either
k3d/share/shaders/k3d_projectionmap_plastic.sl:9:// version 2 of the License, or (at your option) any later version.
k3d/share/shaders/k3d_projectionmap_plastic.sl:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_projectionmap_plastic.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_projectionmap_plastic.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_projectionmap_plastic.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_projectionmap_plastic.sl:17:// License along with this program; if not, write to the Free Software
k3d/share/shaders/k3d_projectionmap_plastic.sl:20:/** \file
k3d/share/shaders/k3d_projectionmap_plastic.sl:24:surface k3d_projectionmap_plastic(
k3d/share/shaders/k3d_projectionmap_plastic.sl:25:	float Ka = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:26:	float Kd = 0.5;
k3d/share/shaders/k3d_projectionmap_plastic.sl:27:	float Ks = 0.5;
k3d/share/shaders/k3d_projectionmap_plastic.sl:28:	float roughness = 0.1;
k3d/share/shaders/k3d_projectionmap_plastic.sl:31:	float s0 = 0.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:32:	float s1 = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:33:	float t0 = 0.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:34:	float t1 = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:36:	float xfreq = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:37:	float yfreq = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:38:	float xoffset = 0.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:39:	float yoffset = 0.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:43:	float Ot = 1;
k3d/share/shaders/k3d_projectionmap_plastic.sl:45:	if(texturename != "")
k3d/share/shaders/k3d_projectionmap_plastic.sl:47:			point Pshad = transform("shader", P);
k3d/share/shaders/k3d_projectionmap_plastic.sl:49:			float x = xfreq * (xcomp(Pshad) - xoffset + 0.5);
k3d/share/shaders/k3d_projectionmap_plastic.sl:50:			float y = yfreq * (ycomp(Pshad) - yoffset + 0.5);
k3d/share/shaders/k3d_projectionmap_plastic.sl:52:			float ss = mix(s0, s1, x);
k3d/share/shaders/k3d_projectionmap_plastic.sl:53:			float tt = mix(t1, t0, y);
k3d/share/shaders/k3d_projectionmap_plastic.sl:56:			Ot = float texture(texturename[3], ss, tt);
k3d/share/shaders/k3d_projectionmap_plastic.sl:59:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_projectionmap_plastic.sl:62:	Ci = Oi * Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_puffyclouds.sl:1:/* I took wave's lead and renamed starfield to KMPuffyclouds.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_puffyclouds.sl:4: * puffyclouds.sl -- RenderMan compatible surface shader for puffy
k3d/share/shaders/k3d_puffyclouds.sl:9: *    on a bright sunny day.  Works as a basic thresholded fBm.  Since
k3d/share/shaders/k3d_puffyclouds.sl:11: *    lighting into account.  If you wanted a lit surface that looked like
k3d/share/shaders/k3d_puffyclouds.sl:12: *    puffy clouds (like painted clouds on a wall), then it would be pretty
k3d/share/shaders/k3d_puffyclouds.sl:16: *    txtscale - overall scaling factor
k3d/share/shaders/k3d_puffyclouds.sl:18: *    octaves, omega, lambda - control the fractal appearance of the clouds
k3d/share/shaders/k3d_puffyclouds.sl:19: *    threshold - fBm sum below this level is just blue sky
k3d/share/shaders/k3d_puffyclouds.sl:23: *    setting the "octaves" parameter based on distance from eye point.
k3d/share/shaders/k3d_puffyclouds.sl:38: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_puffyclouds.sl:44:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_puffyclouds.sl:47:surface
k3d/share/shaders/k3d_puffyclouds.sl:48:k3d_puffyclouds (float Ka = 0, Kd = 0;
k3d/share/shaders/k3d_puffyclouds.sl:49:	     float txtscale = 1;
k3d/share/shaders/k3d_puffyclouds.sl:52:	     float octaves = 8, omega = 0.5, lambda = 2;
k3d/share/shaders/k3d_puffyclouds.sl:53:	     float threshold = 0;
k3d/share/shaders/k3d_puffyclouds.sl:56:  float value;
k3d/share/shaders/k3d_puffyclouds.sl:57:  color Ct;      /* Color of the surface */
k3d/share/shaders/k3d_puffyclouds.sl:58:  point PP;      /* Surface point in shader space */
k3d/share/shaders/k3d_puffyclouds.sl:59:  float i, a, l, o;
k3d/share/shaders/k3d_puffyclouds.sl:61:  PP = txtscale * transform ("shader", P);
k3d/share/shaders/k3d_puffyclouds.sl:63:  /* Use fractional Brownian motion to compute a value for this point */
k3d/share/shaders/k3d_puffyclouds.sl:64:/*  value = fBm (PP, omega, lambda, octaves); */
k3d/share/shaders/k3d_puffyclouds.sl:67:  for (i = 0;  i < octaves;  i += 1) {
k3d/share/shaders/k3d_puffyclouds.sl:78:  /* Uncomment the next line if you want the surface to actually be lit */
k3d/share/shaders/k3d_puffyclouds.sl:79:/*  Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward(N,I))); */
k3d/share/shaders/k3d_redapple.sl:2: * Renamed to JMredapple.sl for RMR -- talrmr@SpamSucks_pacbell.net  7/18/99
k3d/share/shaders/k3d_redapple.sl:4: * redapple.sl - A nice shader for reddy-green apples.
k3d/share/shaders/k3d_redapple.sl:7: * Feel free to use this shader to create apples anywhere and
k3d/share/shaders/k3d_redapple.sl:10: * This shader creates a nice skin for red-green apples. It _is_ tuned
k3d/share/shaders/k3d_redapple.sl:11: * for specific geometry, but can very easily be adjusted to fit any
k3d/share/shaders/k3d_redapple.sl:14: * lines), and "t" running from pole to pole (like longditude). Apples
k3d/share/shaders/k3d_redapple.sl:15: * look best from the side, but work ok from the top, so long as you
k3d/share/shaders/k3d_redapple.sl:16: * don't mind the simple lerping I used to fade to green at the poles.
k3d/share/shaders/k3d_redapple.sl:18: * Look out for the "txtscale" parameter: some noise calculations are
k3d/share/shaders/k3d_redapple.sl:19: * done using shader space, instead of "s" and "t" parameters (I think
k3d/share/shaders/k3d_redapple.sl:20: * my apple's parameters are stretched a bit?), so if you use
k3d/share/shaders/k3d_redapple.sl:21: * different size apples, make sure to change txtscale appropriately.
k3d/share/shaders/k3d_redapple.sl:23: * I think this shader is really cool. If you think so too, you can
k3d/share/shaders/k3d_redapple.sl:24: * email me your praises, notification of my credits in big motion
k3d/share/shaders/k3d_redapple.sl:25: * pictures, job offers at Pixar, etc... to:  jmerritt@SpamSucks_warpax.com   :-)
k3d/share/shaders/k3d_redapple.sl:31:/*#define USE_LG_RAYTRACE */
k3d/share/shaders/k3d_redapple.sl:33:#ifdef USE_LG_RAYTRACE
k3d/share/shaders/k3d_redapple.sl:36:#endif
k3d/share/shaders/k3d_redapple.sl:38:#ifndef snoise
k3d/share/shaders/k3d_redapple.sl:39:#define snoise(x) (2*noise(x)-1)  /* 1-D signed noise */
k3d/share/shaders/k3d_redapple.sl:40:#endif
k3d/share/shaders/k3d_redapple.sl:42:#define TSCALE .05
k3d/share/shaders/k3d_redapple.sl:44:surface
k3d/share/shaders/k3d_redapple.sl:46:	float Ks = .25;           /* Specular reflection coeff.    */
k3d/share/shaders/k3d_redapple.sl:47:	float Kd = .5;            /* Diffuse reflection coeff.     */
k3d/share/shaders/k3d_redapple.sl:48:	float Ka = 1;             /* Ambient light coeff.          */
k3d/share/shaders/k3d_redapple.sl:49:	float Kr = .05;           /* Mirror-like reflection coeff. */
k3d/share/shaders/k3d_redapple.sl:50:	float roughness = .1;     /* Specular roughness param.     */
k3d/share/shaders/k3d_redapple.sl:51:	float label = 0;          /* Non-uniformity param.         */
k3d/share/shaders/k3d_redapple.sl:52:	float redness = 1;        /* Amount of 'redness' - higher  */
k3d/share/shaders/k3d_redapple.sl:55:	float txtscale = .05;     /* Ugly kludge (see above...)    */
k3d/share/shaders/k3d_redapple.sl:56:	color specularcolor = 1;  /* Specular reflection color     */
k3d/share/shaders/k3d_redapple.sl:62:	vector Nf, V, Rdir;
k3d/share/shaders/k3d_redapple.sl:64:	float base_turb, blotch_turb, disp_turb;
k3d/share/shaders/k3d_redapple.sl:65:	float small_noise, blotch, speck, disp = 0, blackness;
k3d/share/shaders/k3d_redapple.sl:66:	color cs, small_speckle, base_color, reflect;
k3d/share/shaders/k3d_redapple.sl:70:	 * Some nice colors for our red apple
k3d/share/shaders/k3d_redapple.sl:82:	PP = transform("shader", P);
k3d/share/shaders/k3d_redapple.sl:87:	 * Pick the base color for the apple.
k3d/share/shaders/k3d_redapple.sl:89:	 * The base color consists of patches of pure green,
k3d/share/shaders/k3d_redapple.sl:90:	 * and patches of finely speckled red and green. These
k3d/share/shaders/k3d_redapple.sl:91:	 * are set up so that the poles of the apple (as "t"
k3d/share/shaders/k3d_redapple.sl:94:	 * The apple geometry is such that lines of constant
k3d/share/shaders/k3d_redapple.sl:95:	 * "t" are lines of longditude (from pole to pole).
k3d/share/shaders/k3d_redapple.sl:96:	 * The constants T1 - T4 specify locations of the
k3d/share/shaders/k3d_redapple.sl:97:	 * start of 'greenness' toward the poles.
k3d/share/shaders/k3d_redapple.sl:99:	#define BASE_SF          1.2    /* s-factor for big noise          */
k3d/share/shaders/k3d_redapple.sl:100:	#define BASE_TF          3      /* t-factor for big noise          */
k3d/share/shaders/k3d_redapple.sl:101:	#define BASE_NF          100    /* scaling factor for small noise  */
k3d/share/shaders/k3d_redapple.sl:102:	#define BASE_NOISE_AMP   0.2    /* small noise color mix amplitude */
k3d/share/shaders/k3d_redapple.sl:103:	#define BASE_GRC         0.4    /* shift factor for more red       */
k3d/share/shaders/k3d_redapple.sl:104:	#define T1               0.0    /* t < T1 is pure green            */
k3d/share/shaders/k3d_redapple.sl:105:	#define T2               0.18   /* lerp s.t. T1->T2 => green->red  */
k3d/share/shaders/k3d_redapple.sl:106:	#define T3               0.8    /* T2->T3 => red can exist here    */
k3d/share/shaders/k3d_redapple.sl:107:	#define T4               1.0    /* lerp s.t. T3->T4 => red->green  */
k3d/share/shaders/k3d_redapple.sl:115:	if (t < T1)
k3d/share/shaders/k3d_redapple.sl:117:	else if (t >= T1 && t < T2)
k3d/share/shaders/k3d_redapple.sl:119:	else if (t >= T3 && t < T4)
k3d/share/shaders/k3d_redapple.sl:121:	else if (t >= T4)
k3d/share/shaders/k3d_redapple.sl:131:	 * The blotch color is finally determined by mixing,
k3d/share/shaders/k3d_redapple.sl:132:	 * using the blotching coefficient "blotch". This
k3d/share/shaders/k3d_redapple.sl:133:	 * section sets that coefficient, using a funky yet
k3d/share/shaders/k3d_redapple.sl:136:	#define BLOTCH_SF          20   /* s-factor for blotches  */
k3d/share/shaders/k3d_redapple.sl:137:	#define BLOTCH_TF          15   /* t-factor for blotches  */
k3d/share/shaders/k3d_redapple.sl:138:	#define BLOTCH_TCF         2.5  /* scaling kludge         */
k3d/share/shaders/k3d_redapple.sl:139:	#define BLOTCH_DELTA       0.1  /* 'nother scaling kludge */
k3d/share/shaders/k3d_redapple.sl:140:	#define BLOTCH_SPECK_COEFF 0.3  /* blotch specking coeff  */
k3d/share/shaders/k3d_redapple.sl:147:	if (blotch > 1) blotch = 1;
k3d/share/shaders/k3d_redapple.sl:154:	 * using the speckling coefficient "speck". These
k3d/share/shaders/k3d_redapple.sl:156:	 * dottiness technique is stolen from LG's starfield 
k3d/share/shaders/k3d_redapple.sl:159:	#define SPECK_NF        50    /* A noise scaling factor      */
k3d/share/shaders/k3d_redapple.sl:160:	#define SPECK_CUTOFF    .45   /* Cutoff for 'tops' of specks */
k3d/share/shaders/k3d_redapple.sl:170:	#define BEDGE  .01
k3d/share/shaders/k3d_redapple.sl:171:	#define BWIDTH .01
k3d/share/shaders/k3d_redapple.sl:177:	 * Combine what we have so far to set the surface
k3d/share/shaders/k3d_redapple.sl:186:	 * Set the shading surface normal.
k3d/share/shaders/k3d_redapple.sl:188:	 * Here we set the surface normal to fix up the specular
k3d/share/shaders/k3d_redapple.sl:190:	 * noise, affected a little by the brown specks, and
k3d/share/shaders/k3d_redapple.sl:191:	 * also dented a bit (alas, no real apples are perfectly
k3d/share/shaders/k3d_redapple.sl:194:	#define DISP_SF     10             /* s-factor for dent noise */
k3d/share/shaders/k3d_redapple.sl:195:	#define DISP_TF     30             /* t-factor for dent noise */
k3d/share/shaders/k3d_redapple.sl:196:	#define DISP_DENT_AMP     (1/15)   /* dent amplitude          */
k3d/share/shaders/k3d_redapple.sl:197:	#define DISP_SMNOISE_AMP  (1/1000) /* small noise amplitude   */
k3d/share/shaders/k3d_redapple.sl:198:	#define DISP_SPECK_AMP    (1/40)   /* speckle disp. amplitude */
k3d/share/shaders/k3d_redapple.sl:204:	Nf = faceforward(normalize(newP), I);
k3d/share/shaders/k3d_redapple.sl:208:	 * 'Mirror' reflections
k3d/share/shaders/k3d_redapple.sl:210:	 * Here, we raytrace for the slight mirrored reflections
k3d/share/shaders/k3d_redapple.sl:211:	 * in the surface of an apple. They don't add much, but
k3d/share/shaders/k3d_redapple.sl:212:	 * may be needed for the 'perfect' apple :-).
k3d/share/shaders/k3d_redapple.sl:214:	 * Note: You'll need Larry Gritz's raytrace helper files
k3d/share/shaders/k3d_redapple.sl:215:	 * for this bit!
k3d/share/shaders/k3d_redapple.sl:217:#ifdef USE_LG_RAYTRACE
k3d/share/shaders/k3d_redapple.sl:218:	if (Kr > .01) {
k3d/share/shaders/k3d_redapple.sl:219:		Rdir = normalize(reflect(normalize(I), Nf));
k3d/share/shaders/k3d_redapple.sl:220:		reflect = RayTrace(P, Rdir, 0, 1, 1);
k3d/share/shaders/k3d_redapple.sl:222:		reflect = 0;
k3d/share/shaders/k3d_redapple.sl:225:	reflect = 0;
k3d/share/shaders/k3d_redapple.sl:226:#endif
k3d/share/shaders/k3d_redapple.sl:230:	 * Combine everything to get Ci, in the standard form.
k3d/share/shaders/k3d_redapple.sl:233:	Ci = Os * (cs * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_redapple.sl:234:	           specularcolor * (Kr * reflect +
k3d/share/shaders/k3d_redapple.sl:235:	                            Ks * specular(Nf, V, roughness)));
k3d/share/shaders/k3d_ridged_multifractal.sl:3: *    Conversion to Shading Language and minor modifications by Fredrik Brnnbacka.

k3d/share/shaders/k3d_ridged_multifractal.sl:12:#define snoise(x) (2.5*(noise(x)-0.5))

k3d/share/shaders/k3d_ridged_multifractal.sl:15:k3d_ridged_multifractal(float H = 0.8, lacunarity = 2.5, octaves = 7, offset = 0.9, sharpness = 4, threshold = 12, Kt = 0.1)

k3d/share/shaders/k3d_ridged_multifractal.sl:17:	float result, signal, weight, i, exponent;

k3d/share/shaders/k3d_ridged_multifractal.sl:18:	point PP =transform("shader",P);

k3d/share/shaders/k3d_ridged_multifractal.sl:20:	for( i=0; i<octaves; i += 1 ) {

k3d/share/shaders/k3d_ridged_multifractal.sl:23:       		if ( i == 0) {

k3d/share/shaders/k3d_ridged_multifractal.sl:25:          		if ( signal < 0.0 ) signal = -signal;

k3d/share/shaders/k3d_ridged_multifractal.sl:26:          		signal = offset - signal;

k3d/share/shaders/k3d_ridged_multifractal.sl:28:                             /*This should give you a power function to control

k3d/share/shaders/k3d_ridged_multifractal.sl:29:                             sharpness of the ridges. Or you can just use the

k3d/share/shaders/k3d_ridged_multifractal.sl:47:          		/* get absolute value of signal*/

k3d/share/shaders/k3d_ridged_multifractal.sl:51:          		signal = offset - signal;

k3d/share/shaders/k3d_ripple.sl:3: *  Note: I modified a given code from Renderman Interface 3.1

k3d/share/shaders/k3d_ripple.sl:5: *  This produced concave displacements on any surfaces.

k3d/share/shaders/k3d_ripple.sl:13:k3d_ripple ( float amplitude = 1.0,

k3d/share/shaders/k3d_ripple.sl:15:	       fac = 1,

k3d/share/shaders/k3d_ripple.sl:18:  float ss, tt;

k3d/share/shaders/k3d_roughmetal.sl:5: *   Rough metal without coherent reflections
k3d/share/shaders/k3d_roughmetal.sl:8: *   Ka, Kd, Ks - ambient, diffuse, specular weights
k3d/share/shaders/k3d_roughmetal.sl:11: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_roughmetal.sl:13: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_roughmetal.sl:19:surface k3d_roughmetal(float Ka = 1, Kd = 0.1, Ks = .9, roughness = 0.4;)
k3d/share/shaders/k3d_roughmetal.sl:21:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_roughmetal.sl:22:  Ci = MaterialRoughMetal(Nf, Cs, Ka, Kd, Ks, roughness);
k3d/share/shaders/k3d_round.sl:3:/* Listing 16.23  Displacement shader for bevelling perpendicular bilinear patches*/
k3d/share/shaders/k3d_round.sl:6: * round(): displace the edge of a bilinear patch so that, if it is placed 
k3d/share/shaders/k3d_round.sl:10:k3d_round (float radius = .10 )
k3d/share/shaders/k3d_round.sl:12:	float	 uu,	/* distance in u to the nearest "vertical" edge */
k3d/share/shaders/k3d_round.sl:16:	point	 center,/* point toward which the surface is displaced 	*/
k3d/share/shaders/k3d_round.sl:20:	/* Find the distance in parameter space from the nearest edge in
k3d/share/shaders/k3d_round.sl:21:	   u and in v, and the directions away from those edges. */
k3d/share/shaders/k3d_round.sl:22:	if (u < .5) {
k3d/share/shaders/k3d_round.sl:29:	if (v < .5) {
k3d/share/shaders/k3d_round.sl:37:	/* Find the distances from the edges in the current space. */
k3d/share/shaders/k3d_round.sl:41:	if (lu < radius || lv < radius) {	/* only if within radius of 
k3d/share/shaders/k3d_round.sl:44:	 * Find the point towards which the surface  point will be 
k3d/share/shaders/k3d_round.sl:45:	 *  moved. This center is on the center line of a cylinder, if we 
k3d/share/shaders/k3d_round.sl:46:	 *  are not near the corner of the patch, or is the center of a 
k3d/share/shaders/k3d_round.sl:47:	 *  sphere, if we are. We move `center' to the nearest inflection 
k3d/share/shaders/k3d_round.sl:51:		if (lu < radius)
k3d/share/shaders/k3d_round.sl:53:		if (lv < radius)
k3d/share/shaders/k3d_round.sl:55:		/* Move center perpendicular to the surface */
k3d/share/shaders/k3d_round.sl:58:                 * from 'center' to P */
k3d/share/shaders/k3d_rubber.sl:3:/* Listing 16.38  Rubber surface shader*/
k3d/share/shaders/k3d_rubber.sl:6: * rubber(): This shader generates a rubber surface. It is a matte shader that
k3d/share/shaders/k3d_rubber.sl:9:surface
k3d/share/shaders/k3d_rubber.sl:11:	float	Ka		= 1.0, 
k3d/share/shaders/k3d_rubber.sl:15:	point	Nf = faceforward(normalize(N),I), 
k3d/share/shaders/k3d_rubber.sl:16:		Ploc = transform("shader", P);  /* Move to shader space */
k3d/share/shaders/k3d_rubber.sl:20:	cout = mix(Cs, white, .05* (float noise(txtscale*Ploc)));
k3d/share/shaders/k3d_rubber.sl:22:	/* Compute a matte surface. */
k3d/share/shaders/k3d_rubber.sl:24:	Ci = Os * cout * ( Ka*ambient() + Kd*diffuse(Nf) ) ;
k3d/share/shaders/k3d_ruledpaper.sl:2: * EM_paper.sl -- loose leaf paper
k3d/share/shaders/k3d_ruledpaper.sl:5: *   Makes a patch look like a piece of loose-leaf paper with lines,
k3d/share/shaders/k3d_ruledpaper.sl:12: *   texturename - name of image to map onto paper (optional)
k3d/share/shaders/k3d_ruledpaper.sl:14: * ANTIALIASING: no antialiasing. This can be a real problem because of the
k3d/share/shaders/k3d_ruledpaper.sl:21: *    8 Nov 1997 - started writing shader for RDC under MS VC++
k3d/share/shaders/k3d_ruledpaper.sl:22: *    9 Nov 1997 - added binder holes and finished shader
k3d/share/shaders/k3d_ruledpaper.sl:25: * last modified 15 Nov 1997 by Emil Mikulic
k3d/share/shaders/k3d_ruledpaper.sl:30: *   (initcode) instead of being re-calced for every sample.
k3d/share/shaders/k3d_ruledpaper.sl:33: *   but in my day there's 7. I actually got a piece of loose-leaf paper
k3d/share/shaders/k3d_ruledpaper.sl:36: *   The paper shader works for A4 pieces of paper, so remeber to make your
k3d/share/shaders/k3d_ruledpaper.sl:41:surface
k3d/share/shaders/k3d_ruledpaper.sl:42:k3d_ruledpaper(float Ka = 1, Kd = 0.5, Ks = 0.5;
k3d/share/shaders/k3d_ruledpaper.sl:43:	float roughness = 0.1;
k3d/share/shaders/k3d_ruledpaper.sl:45:	float linestr = 1;
k3d/share/shaders/k3d_ruledpaper.sl:50:	float 	pw=21,
k3d/share/shaders/k3d_ruledpaper.sl:53:	// Width of plastic strip
k3d/share/shaders/k3d_ruledpaper.sl:57:	// Thickness of lines
k3d/share/shaders/k3d_ruledpaper.sl:59:	// How far into the page do the lines start
k3d/share/shaders/k3d_ruledpaper.sl:60:		linef = 0.5 / pw,
k3d/share/shaders/k3d_ruledpaper.sl:61:	// Top and bottom margins for lines
k3d/share/shaders/k3d_ruledpaper.sl:67:	// Settings for binder holes (circles)
k3d/share/shaders/k3d_ruledpaper.sl:72:	// Bounding box for circles
k3d/share/shaders/k3d_ruledpaper.sl:77:// Fancy macro checks ss/tt coords against bounding box and [if inside]
k3d/share/shaders/k3d_ruledpaper.sl:78:// calculates if it's inside the circle. If it is, the colour
k3d/share/shaders/k3d_ruledpaper.sl:81:#define circle(sm,tm) { \
k3d/share/shaders/k3d_ruledpaper.sl:82:	if ((tt>(tm-circr)/ph) && (tt>(tm+circr)/ph))	\
k3d/share/shaders/k3d_ruledpaper.sl:84:		if (distance( point(ss,tt,0), point(sm,tm,0) ) <= circr)	\
k3d/share/shaders/k3d_ruledpaper.sl:89:    point Nf, V;
k3d/share/shaders/k3d_ruledpaper.sl:91:    float ss,tt;
k3d/share/shaders/k3d_ruledpaper.sl:93:    // For plastic and diffuse shading
k3d/share/shaders/k3d_ruledpaper.sl:94:    Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ruledpaper.sl:97:	// Check if there's a texture given.
k3d/share/shaders/k3d_ruledpaper.sl:98:	// Use a nice handwrititng font and you can make it look like
k3d/share/shaders/k3d_ruledpaper.sl:100:	if (texturename != "")
k3d/share/shaders/k3d_ruledpaper.sl:103:		tex = Cs; // Colour of paper
k3d/share/shaders/k3d_ruledpaper.sl:105:	// If we're inside the borders/margins
k3d/share/shaders/k3d_ruledpaper.sl:106:	if ( (s>linef) && (t>margt) && (t<margb) )
k3d/share/shaders/k3d_ruledpaper.sl:108:	if ( (mod(t, lines)<=linet) || ((s>=verts) && (s<=verte)) )
k3d/share/shaders/k3d_ruledpaper.sl:113:	// Bounding box for circle calcs
k3d/share/shaders/k3d_ruledpaper.sl:114:	if ((s>boundl) && (s<boundr)) 
k3d/share/shaders/k3d_ruledpaper.sl:121:		// Find bounding boxes first to speed up calcs
k3d/share/shaders/k3d_ruledpaper.sl:132:	// Check if it actually needs shading
k3d/share/shaders/k3d_ruledpaper.sl:133:	if (Oi == color (0, 0, 0)) { Ci = 0; } else {
k3d/share/shaders/k3d_ruledpaper.sl:134:		if (s<=shiny) {
k3d/share/shaders/k3d_ruledpaper.sl:135:			// If inside plasticky reinforcement strip then
k3d/share/shaders/k3d_ruledpaper.sl:137:			Ci = Oi * (tex * (Ka * ambient() + Kd * diffuse(Nf)) + 
k3d/share/shaders/k3d_ruledpaper.sl:138:			specularcolor * Ks * specular(Nf, V, roughness));
k3d/share/shaders/k3d_ruledpaper.sl:140:			// Else shade diffuse paper
k3d/share/shaders/k3d_ruledpaper.sl:141:			Ci = Oi * tex * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_rustymetal.sl:2: * rustymetal.sl -- metal with specks of rust
k3d/share/shaders/k3d_rustymetal.sl:5: *   A rough metal surface with controllable rust spots.  The rust pattern
k3d/share/shaders/k3d_rustymetal.sl:8: *   the corrosion is kind of grainy).  Where there is no rust, shade like
k3d/share/shaders/k3d_rustymetal.sl:12: *   metalKa, metalKs, metalroughness - control the appearance of the metal.
k3d/share/shaders/k3d_rustymetal.sl:13: *   rustKa, rustKd, rustcolor - control the appearance of the rust.
k3d/share/shaders/k3d_rustymetal.sl:14: *   txtscale - overall scaling factor of the rust pattern.
k3d/share/shaders/k3d_rustymetal.sl:15: *   rusty - 0=no rust, larger for more rust, 1=completely rusty
k3d/share/shaders/k3d_rustymetal.sl:16: *   rustbump - controls the "bumpiness" of the rusty areas.
k3d/share/shaders/k3d_rustymetal.sl:19: *   The fractal sum used to determine the rust pattern chooses a number of
k3d/share/shaders/k3d_rustymetal.sl:29: *   last modified 19 Jan 95 
k3d/share/shaders/k3d_rustymetal.sl:34:/* Signed noise varies from -1 to 1 (like Perlin uses) */
k3d/share/shaders/k3d_rustymetal.sl:35:#define snoise(x) (2*noise(x)-1)
k3d/share/shaders/k3d_rustymetal.sl:37:/* Maximum number of octaves */
k3d/share/shaders/k3d_rustymetal.sl:38:#define MAXOCTAVES 8
k3d/share/shaders/k3d_rustymetal.sl:43:surface
k3d/share/shaders/k3d_rustymetal.sl:44:k3d_rustymetal (float metalKa = 1, metalKs = 1, metalroughness = .1;
k3d/share/shaders/k3d_rustymetal.sl:45:	    float rustKa = 1, rustKd = 1;
k3d/share/shaders/k3d_rustymetal.sl:47:	    float txtscale = 1;
k3d/share/shaders/k3d_rustymetal.sl:48:	    float rusty = 0.2;
k3d/share/shaders/k3d_rustymetal.sl:49:	    float rustbump = 0.035;
k3d/share/shaders/k3d_rustymetal.sl:52:  point Nf, V;                 /* normal and view vector used for shading */
k3d/share/shaders/k3d_rustymetal.sl:53:  point Nrust;                 /* perturbed normal for the rusty areas */
k3d/share/shaders/k3d_rustymetal.sl:55:  float i, sum = 0, a = 1;     /* Loop control for fractal sum */
k3d/share/shaders/k3d_rustymetal.sl:56:  float alimit;                /* Limit sum to do simple antialiasing */
k3d/share/shaders/k3d_rustymetal.sl:57:  float rustiness;             /* Result: how rusty is this point? */
k3d/share/shaders/k3d_rustymetal.sl:58:  color Cmetal = 0, Crust = 0; /* Computed colors of metal & rust */
k3d/share/shaders/k3d_rustymetal.sl:60:  /* Sum several octaves of abs(snoise), i.e. turbulence.  Limit the
k3d/share/shaders/k3d_rustymetal.sl:61:   * number of octaves by the estimated change in PP between adjacent
k3d/share/shaders/k3d_rustymetal.sl:64:  PP = txtscale * transform ("shader", P);
k3d/share/shaders/k3d_rustymetal.sl:66:  for (i = 0;  i < MAXOCTAVES  &&  a > alimit;  i += 1) {
k3d/share/shaders/k3d_rustymetal.sl:71:  /* If it's rusty, also add a high frequency bumpiness to the normal */
k3d/share/shaders/k3d_rustymetal.sl:81:  /* If we have any rust, calculate the color of the rust, taking into
k3d/share/shaders/k3d_rustymetal.sl:84:  if (rustiness > 0) {
k3d/share/shaders/k3d_rustymetal.sl:85:      Nf = faceforward (normalize(Nrust),I);
k3d/share/shaders/k3d_rustymetal.sl:86:      Crust = rustcolor * (rustKa*ambient() + rustKd*diffuse(Nf));
k3d/share/shaders/k3d_rustymetal.sl:88:  /* If we have any metal, calculate the color of the metal, using the
k3d/share/shaders/k3d_rustymetal.sl:91:  if (rustiness < 1) {
k3d/share/shaders/k3d_rustymetal.sl:92:      Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_rustymetal.sl:94:      Cmetal = Cs * (metalKa*ambient() + metalKs*specular(Nf,V,metalroughness));
k3d/share/shaders/k3d_rustymetal.sl:98:   * of the rustiness.
k3d/share/shaders/k3d_saturn.sl:1:/* This was terran.sl from Larry Gritz and Ken Musgrave.  But there isn't much of it left.
k3d/share/shaders/k3d_saturn.sl:5: * TLSaturn.sl - surface for an Saturn-like planet.
k3d/share/shaders/k3d_saturn.sl:10: *   Saturn-like.  The shader works by using a variety of fractal 
k3d/share/shaders/k3d_saturn.sl:16: *    dist_scale - scaling for multifractal distortion
k3d/share/shaders/k3d_saturn.sl:17: *    lat_scale,  map_exp - control scaling of 
k3d/share/shaders/k3d_saturn.sl:23: *   than the default arguments.
k3d/share/shaders/k3d_saturn.sl:26: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_saturn.sl:35: *    23 May 1995 - Changed name from terran.sl to TLSaturn.sl and
k3d/share/shaders/k3d_saturn.sl:39: * last modified 23 May 1995 by Tal
k3d/share/shaders/k3d_saturn.sl:42:surface
k3d/share/shaders/k3d_saturn.sl:43:k3d_saturn (float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_saturn.sl:44:	  float dist_scale = .2;
k3d/share/shaders/k3d_saturn.sl:45:	  float offset = 0;
k3d/share/shaders/k3d_saturn.sl:46:	  float lat_scale = 0.95;
k3d/share/shaders/k3d_saturn.sl:47:	  float map_exp = 0;)
k3d/share/shaders/k3d_saturn.sl:51:  float latitude;
k3d/share/shaders/k3d_saturn.sl:56:  Ptexture = transform ("shader", P);
k3d/share/shaders/k3d_saturn.sl:57:  PtN = normalize (Ptexture);      /* Version of Ptexture with radius 1 */
k3d/share/shaders/k3d_saturn.sl:66:  if (map_exp > 0)
k3d/share/shaders/k3d_saturn.sl:70:  	/* Color map for Saturn */
k3d/share/shaders/k3d_saturn.sl:86:  Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N),I)));
k3d/share/shaders/k3d_saturnring.sl:2: * TLRing.sl -- surface for a saturn like ring to be used on a disk
k3d/share/shaders/k3d_saturnring.sl:10: *	cutoff - what point to start rings (radius of transparency)
k3d/share/shaders/k3d_saturnring.sl:11: *	ringrad - radius of ring
k3d/share/shaders/k3d_saturnring.sl:12: *	opacity - the opacity of the rings (may not be used anymore)
k3d/share/shaders/k3d_saturnring.sl:15: *	The default values assume that the disk has a radius of one.  If it is
k3d/share/shaders/k3d_saturnring.sl:25:#define RING1 0.83    /* Relative spacing for outermost ring */
k3d/share/shaders/k3d_saturnring.sl:26:#define RING2 0.77    /* Relative spacing for next outermost ring */    
k3d/share/shaders/k3d_saturnring.sl:27:#define RING3 0.62    /* Relative spacing for   "  outermost ring */
k3d/share/shaders/k3d_saturnring.sl:28:#define RING4 0.58    /* Relative spacing for   "  outermost ring */
k3d/share/shaders/k3d_saturnring.sl:29:#define RING5 0.55    /* Relative spacing for   "  outermost ring */
k3d/share/shaders/k3d_saturnring.sl:31:/* Grabbed from one of Larry Gritz's many shaders */
k3d/share/shaders/k3d_saturnring.sl:32:#ifdef BMRT
k3d/share/shaders/k3d_saturnring.sl:33:#define snoise(x) (2 * noise(x) - 1)	
k3d/share/shaders/k3d_saturnring.sl:36:#define snoise(x) (2.5 * (noise(x) - 1))
k3d/share/shaders/k3d_saturnring.sl:37:#endif /* BMRT */	
k3d/share/shaders/k3d_saturnring.sl:39:surface k3d_saturnring (float Ka = 1.0, Kd = 1.0,
k3d/share/shaders/k3d_saturnring.sl:40:	cutoff = 0.55, ringrad = 1.0, opacity = 0.5;)
k3d/share/shaders/k3d_saturnring.sl:42:	point PP;       /* Transformed point */
k3d/share/shaders/k3d_saturnring.sl:43:	point Nf;       /* Forward facing Normalized vector of incident light */
k3d/share/shaders/k3d_saturnring.sl:44:	float val;      /* length of PP */
k3d/share/shaders/k3d_saturnring.sl:45:	float relpos;   /* relative position of PP on disk 
k3d/share/shaders/k3d_saturnring.sl:47:	float oi = 0.0; /* Opacity holder */
k3d/share/shaders/k3d_saturnring.sl:49:	color dgrey = color (.266, .266, .266);      /* A shade of dark grey */
k3d/share/shaders/k3d_saturnring.sl:50:	color dyellow = color (.73, .664, .398);     /* A shade of dark yellow */
k3d/share/shaders/k3d_saturnring.sl:51:	color dpink = color (.664, .465,  .465);     /* A shade of dark pink */
k3d/share/shaders/k3d_saturnring.sl:52:	color mutedgreen = color (.531, .531, .398); /* A shade of muted green */
k3d/share/shaders/k3d_saturnring.sl:54:	PP = transform ("shader", P);
k3d/share/shaders/k3d_saturnring.sl:57:#define DEBUG 0
k3d/share/shaders/k3d_saturnring.sl:58:#if DEBUG	
k3d/share/shaders/k3d_saturnring.sl:59:	printf ("val %f ringrad %f \n",
k3d/share/shaders/k3d_saturnring.sl:61:#endif
k3d/share/shaders/k3d_saturnring.sl:63:	if (val < cutoff * ringrad) {
k3d/share/shaders/k3d_saturnring.sl:68:		/* Create rings of varing transparency */
k3d/share/shaders/k3d_saturnring.sl:70:		oi =  (relpos + snoise (40* relpos) - floor(relpos) );
k3d/share/shaders/k3d_saturnring.sl:72:#define DEBUG2 0
k3d/share/shaders/k3d_saturnring.sl:73:#if DEBUG2
k3d/share/shaders/k3d_saturnring.sl:74:		printf ("oi = %f\n", oi);
k3d/share/shaders/k3d_saturnring.sl:75:#endif
k3d/share/shaders/k3d_saturnring.sl:77:		/* Create some gaps of completely transparent rings */
k3d/share/shaders/k3d_saturnring.sl:78:		if (oi > 1.0)
k3d/share/shaders/k3d_saturnring.sl:83:	if (oi == 0.0)
k3d/share/shaders/k3d_saturnring.sl:88:		if (relpos >  RING1) 
k3d/share/shaders/k3d_saturnring.sl:90:		else if (relpos >  RING2) {
k3d/share/shaders/k3d_saturnring.sl:95:		else if (relpos > RING3) {
k3d/share/shaders/k3d_saturnring.sl:98:		else if (relpos > RING4)
k3d/share/shaders/k3d_saturnring.sl:103:		if (oi != 0.0) {
k3d/share/shaders/k3d_saturnring.sl:106:			Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_saturnring.sl:107:			Ci = Oi * (cs * (Ka*ambient() + Kd*diffuse(Nf) ));
k3d/share/shaders/k3d_scartissue.sl:1:/*  IDscartissue.sl written by Ivan DeWolf
k3d/share/shaders/k3d_scartissue.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_scartissue.sl:4: *  in any way you see fit, but please leave my name near the top
k3d/share/shaders/k3d_scartissue.sl:6:surface
k3d/share/shaders/k3d_scartissue.sl:8:	float	Ks			=  2, 
k3d/share/shaders/k3d_scartissue.sl:14:	point Psh = transform("object",P);
k3d/share/shaders/k3d_scartissue.sl:15:	uniform float i, freq = 2.0, offset = 0;
k3d/share/shaders/k3d_scartissue.sl:16:	float nz = 0;
k3d/share/shaders/k3d_scartissue.sl:21:	normal Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_scartissue.sl:24:	for (i = 0; i < 10; i = i + 1) {
k3d/share/shaders/k3d_scartissue.sl:25:		nz += abs(.5 - noise( (freq * Psh)+offset)) / freq;
k3d/share/shaders/k3d_scartissue.sl:26:		freq *= 1.2;
k3d/share/shaders/k3d_scartissue.sl:27:		offset += 10;
k3d/share/shaders/k3d_scartissue.sl:32:	Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_scartissue.sl:34:	Ci = ( base * (Ka + Kd*diffuse(Nf)) + 
k3d/share/shaders/k3d_scartissue.sl:35:	 	(1-nz)*Ks * specular(Nf,V,roughness) );
k3d/share/shaders/k3d_screen.sl:1:/* screen.sl - RenderMan compatible shader for a metalic screen.
k3d/share/shaders/k3d_screen.sl:6: *   Makes a surface that looks like a metal screen.  Strips of metal run
k3d/share/shaders/k3d_screen.sl:7: *   parallel to lines of s and t.  You can adjust the Ka, Kd, Ks, etc.
k3d/share/shaders/k3d_screen.sl:12: *   frequency - how many cycles of screen in st space
k3d/share/shaders/k3d_screen.sl:13: *   density - how much of each cycle is opaque?
k3d/share/shaders/k3d_screen.sl:16: *   No antialiasing is performed here.
k3d/share/shaders/k3d_screen.sl:18: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_screen.sl:20: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_screen.sl:24:surface k3d_screen(float Ka = 1, Kd = 0.75, Ks = 0.4, roughness = 0.1;
k3d/share/shaders/k3d_screen.sl:26:		   float density = 0.25, frequency = 20;)
k3d/share/shaders/k3d_screen.sl:28:  normal Nf;
k3d/share/shaders/k3d_screen.sl:30:  if(mod(s * frequency, 1) < density || mod(t * frequency, 1) < density)
k3d/share/shaders/k3d_screen.sl:33:      Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_screen.sl:35:	Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_screen.sl:36:	      specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_screen_aa.sl:2: * screen_aa.sl -- RenderMan compatible shader for a metalic screen.
k3d/share/shaders/k3d_screen_aa.sl:5: *   Makes a surface that looks like a metal screen.  Strips of metal run
k3d/share/shaders/k3d_screen_aa.sl:6: *   parallel to lines of s and t.  You can adjust the Ka, Kd, Ks, etc.
k3d/share/shaders/k3d_screen_aa.sl:12: *   frequency - how many cycles of screen in st space
k3d/share/shaders/k3d_screen_aa.sl:13: *   density - how much of each cycle is opaque?
k3d/share/shaders/k3d_screen_aa.sl:17: * last modified  31 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_screen_aa.sl:20: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_screen_aa.sl:22: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_screen_aa.sl:25:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_screen_aa.sl:26:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_screen_aa.sl:30:surface k3d_screen_aa(float Ka = 1, Kd = 0.75, Ks = 0.4, roughness = 0.1;
k3d/share/shaders/k3d_screen_aa.sl:32:		      float density = 0.25, frequency = 20;)
k3d/share/shaders/k3d_screen_aa.sl:34:  normal Nf;			/* Forward facing Normal vector */
k3d/share/shaders/k3d_screen_aa.sl:36:  float d;			/* Density at the sample point */
k3d/share/shaders/k3d_screen_aa.sl:37:  float ss, tt;			/* s,t, parameters in phase */
k3d/share/shaders/k3d_screen_aa.sl:38:  float swidth, twidth, GWF, w, h;
k3d/share/shaders/k3d_screen_aa.sl:40:  /* Compute a forward facing normal */
k3d/share/shaders/k3d_screen_aa.sl:42:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_screen_aa.sl:45:  swidth = max(abs(Du(s) * du) + abs(Dv(s) * dv), MINFILTERWIDTH) * frequency;
k3d/share/shaders/k3d_screen_aa.sl:46:  twidth = max(abs(Du(t) * du) + abs(Dv(t) * dv), MINFILTERWIDTH) * frequency;
k3d/share/shaders/k3d_screen_aa.sl:49:  ss = mod(frequency * s, 1);
k3d/share/shaders/k3d_screen_aa.sl:50:  tt = mod(frequency * t, 1);
k3d/share/shaders/k3d_screen_aa.sl:54:  if(swidth >= 1)
k3d/share/shaders/k3d_screen_aa.sl:61:  if(twidth >= 1)
k3d/share/shaders/k3d_screen_aa.sl:75:  if(d > 0)
k3d/share/shaders/k3d_screen_aa.sl:78:	Oi * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_screen_aa.sl:79:	      specularcolor * Ks * specular(Nf, -IN, roughness));
k3d/share/shaders/k3d_sdixon.sl:3:/* Listing 16.37  Pencil-labeling surface shader*/
k3d/share/shaders/k3d_sdixon.sl:6: * sdixon(): Paint the body of a pencil.
k3d/share/shaders/k3d_sdixon.sl:8:surface
k3d/share/shaders/k3d_sdixon.sl:10:	float	Ka		= 1.0, 
k3d/share/shaders/k3d_sdixon.sl:18:	point Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_sdixon.sl:20:	float ink;
k3d/share/shaders/k3d_sdixon.sl:26:	/* Get the amount of ink from texture file. */
k3d/share/shaders/k3d_sdixon.sl:32:	/* Compute the output color. Notice that as ink goes from zero to
k3d/share/shaders/k3d_sdixon.sl:33:	   one, the diffuse component goes to zero and the specular 
k3d/share/shaders/k3d_sdixon.sl:34:	   component is increased. This has the effect of transitioning
k3d/share/shaders/k3d_sdixon.sl:35:	   from a matte surface to a metallic one as ink is added. */
k3d/share/shaders/k3d_sdixon.sl:37:	Ci = Os * cout * ( Ka*ambient() + (1-ink)*Kd*diffuse(Nf) +
k3d/share/shaders/k3d_sdixon.sl:38:					ink*Ks*specular(Nf,V,roughness) ) ;
k3d/share/shaders/k3d_shadowdistant_rim.sl:1:/* renamed from MKshadowdistant_rim.sl */
k3d/share/shaders/k3d_shadowdistant_rim.sl:5:    float  intensity=1 ;
k3d/share/shaders/k3d_shadowdistant_rim.sl:7:    point from = point "shader" (0,0,0) ;
k3d/share/shaders/k3d_shadowdistant_rim.sl:10:    float samples=16;
k3d/share/shaders/k3d_shadowdistant_rim.sl:11:    float width=1;
k3d/share/shaders/k3d_shadowdistant_rim.sl:12:    float __rimlight = 0;
k3d/share/shaders/k3d_shadowdistant_rim.sl:13:    float __nonspecular = 1;
k3d/share/shaders/k3d_shadowdistant_rim.sl:14:    float __nondiffuse = 1;
k3d/share/shaders/k3d_shadowdistant_rim.sl:17:    solar( to - from, 0.0 ) {
k3d/share/shaders/k3d_shadowdistant_rim.sl:19:        if (shadowname != "") {
k3d/share/shaders/k3d_shadowspot.sl:9:	float intensity	= 1;
k3d/share/shaders/k3d_shadowspot.sl:11:	point from = point "shader" (0, 0, 0);
k3d/share/shaders/k3d_shadowspot.sl:13:	float coneangle	= radians(30);
k3d/share/shaders/k3d_shadowspot.sl:14:	float conedeltaangle = radians(5);
k3d/share/shaders/k3d_shadowspot.sl:15:	float beamdistribution = 2;
k3d/share/shaders/k3d_shadowspot.sl:16:	string shadowfile = "";
k3d/share/shaders/k3d_shadowspot.sl:17:	float samples = 16;
k3d/share/shaders/k3d_shadowspot.sl:18:	float blur = 0.01;
k3d/share/shaders/k3d_shadowspot.sl:19:	float bias = 0.01; )
k3d/share/shaders/k3d_shadowspot.sl:21:	point A = (to - from) / length(to - from); /* direction */
k3d/share/shaders/k3d_shadowspot.sl:22:	float	cosoutside= cos(coneangle),
k3d/share/shaders/k3d_shadowspot.sl:24:	float	attenuation, 	/* falloff from center of illumination cone */
k3d/share/shaders/k3d_shadowspot.sl:25:		cosangle;	/* cosine of angle wrt center of cone */
k3d/share/shaders/k3d_shadowspot.sl:27:	illuminate( from, A, coneangle ) {
k3d/share/shaders/k3d_shadowspot.sl:31:		if( shadowfile != "" )
k3d/share/shaders/k3d_shadowspot.sl:32:		    attenuation *= (1.0 - shadow( shadowfile, Ps, "samples", samples, "blur", blur, "bias", bias ));
k3d/share/shaders/k3d_shifteddrtile.sl:2: * TLShiftedD_RTile.sl -- generates a surface of alternating disks and rings
k3d/share/shaders/k3d_shifteddrtile.sl:5: *	Will generate alternating and shifted rows of disks and rings
k3d/share/shaders/k3d_shifteddrtile.sl:10: *  roughness -  Contols the specular reflection
k3d/share/shaders/k3d_shifteddrtile.sl:11: *	fuzz -       Amount to blur edge
k3d/share/shaders/k3d_shifteddrtile.sl:14: *	sfreq - # of tiles in s
k3d/share/shaders/k3d_shifteddrtile.sl:15: *	tfreq - # of tiles in t 
k3d/share/shaders/k3d_shifteddrtile.sl:16: *	cstate1 - foreground color
k3d/share/shaders/k3d_shifteddrtile.sl:17: *	specularcolor - color of specular highlight
k3d/share/shaders/k3d_shifteddrtile.sl:22: *  Also, it would be better to set the width of the ring rather than
k3d/share/shaders/k3d_shifteddrtile.sl:23: *      specifing the inner and outer ring.
k3d/share/shaders/k3d_shifteddrtile.sl:24: *  Another thing that might be useful is to add a parameter to 
k3d/share/shaders/k3d_shifteddrtile.sl:25: *      choose which row to do first.
k3d/share/shaders/k3d_shifteddrtile.sl:33:#define smoothPulse(a, b, fuzz, loc) \
k3d/share/shaders/k3d_shifteddrtile.sl:34:	(smoothstep (a-fuzz, a+fuzz, loc) - \
k3d/share/shaders/k3d_shifteddrtile.sl:35:	smoothstep (b-fuzz, b+fuzz, loc) )
k3d/share/shaders/k3d_shifteddrtile.sl:37:#define repeat(pos, freq) \
k3d/share/shaders/k3d_shifteddrtile.sl:38:	(mod (pos * freq, 1) )
k3d/share/shaders/k3d_shifteddrtile.sl:40:#define whichtile(pos, freq) \
k3d/share/shaders/k3d_shifteddrtile.sl:41:	(floor((pos) * freq) )
k3d/share/shaders/k3d_shifteddrtile.sl:43:#define isOdd(x) \
k3d/share/shaders/k3d_shifteddrtile.sl:46:surface
k3d/share/shaders/k3d_shifteddrtile.sl:47:k3d_shifteddrtile (
k3d/share/shaders/k3d_shifteddrtile.sl:48:	uniform float Ka = 1;
k3d/share/shaders/k3d_shifteddrtile.sl:49:	uniform float Kd = .5;
k3d/share/shaders/k3d_shifteddrtile.sl:50:	uniform float Ks = .5;
k3d/share/shaders/k3d_shifteddrtile.sl:51:	uniform float roughness = .1;
k3d/share/shaders/k3d_shifteddrtile.sl:52:	uniform float fuzz = .025;          /* amount to blur edge */
k3d/share/shaders/k3d_shifteddrtile.sl:53:	uniform float innerRadius = 0.3;    /* inner ring */
k3d/share/shaders/k3d_shifteddrtile.sl:54:	uniform float outerRadius = 0.45;   /* outer ring */
k3d/share/shaders/k3d_shifteddrtile.sl:55:	uniform float sfreq = 4.0;          /* # of tiles in s */
k3d/share/shaders/k3d_shifteddrtile.sl:56:	uniform float tfreq = 4.0;          /* # of tiles in t */
k3d/share/shaders/k3d_shifteddrtile.sl:57:	uniform color cstate1 = color(1, 0, 0);  /* foreground color */
k3d/share/shaders/k3d_shifteddrtile.sl:58:	uniform color specularcolor = 1;)
k3d/share/shaders/k3d_shifteddrtile.sl:60:	point Nf;
k3d/share/shaders/k3d_shifteddrtile.sl:61:	uniform point center;      /* Center of disk */
k3d/share/shaders/k3d_shifteddrtile.sl:62:	color surfColor;   /* Color of surface */ 
k3d/share/shaders/k3d_shifteddrtile.sl:63:	float mix_opacity; /* How much to mix between the surfaces */
k3d/share/shaders/k3d_shifteddrtile.sl:64:	float ss, tt;      /* tiled s, t */
k3d/share/shaders/k3d_shifteddrtile.sl:65:	float row, col;    /* used to determine which tile we are in */
k3d/share/shaders/k3d_shifteddrtile.sl:66:	float d;           /* distance from center of current tile */
k3d/share/shaders/k3d_shifteddrtile.sl:67:	float wasOdd;      /* True if test was odd */
k3d/share/shaders/k3d_shifteddrtile.sl:69:	Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_shifteddrtile.sl:71:	surfColor = Cs;
k3d/share/shaders/k3d_shifteddrtile.sl:75: 	row = whichtile (t, tfreq);
k3d/share/shaders/k3d_shifteddrtile.sl:77:	if (isOdd(row) == 0) {
k3d/share/shaders/k3d_shifteddrtile.sl:78:		ss = mod (s * sfreq + 0.5, 1);
k3d/share/shaders/k3d_shifteddrtile.sl:82:		ss = repeat (s, sfreq);
k3d/share/shaders/k3d_shifteddrtile.sl:86:	tt = repeat (t, tfreq);
k3d/share/shaders/k3d_shifteddrtile.sl:89:	if (wasOdd == 1)
k3d/share/shaders/k3d_shifteddrtile.sl:91:		mix_opacity = smoothPulse (innerRadius, outerRadius, fuzz, d);
k3d/share/shaders/k3d_shifteddrtile.sl:94:		mix_opacity = 1 - smoothstep (outerRadius-fuzz, outerRadius+fuzz, d);
k3d/share/shaders/k3d_shifteddrtile.sl:96:	surfColor = mix (surfColor, cstate1, mix_opacity);
k3d/share/shaders/k3d_shifteddrtile.sl:100:	Ci = Os * (surfColor * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_shifteddrtile.sl:101:	      specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_shiftedmoontile.sl:2: * TLShiftedMoonTile.sl -- shifted tile of cresent moons
k3d/share/shaders/k3d_shiftedmoontile.sl:5: *	Tile of shifted  cresent moons (disks)
k3d/share/shaders/k3d_shiftedmoontile.sl:9: *  roughness - Contols the specular reflection
k3d/share/shaders/k3d_shiftedmoontile.sl:10: *	fuzz -      Amount to blur edge
k3d/share/shaders/k3d_shiftedmoontile.sl:11: *	radius -    Radis of disk (moon)
k3d/share/shaders/k3d_shiftedmoontile.sl:12: *	sfreq - # of tiles in s
k3d/share/shaders/k3d_shiftedmoontile.sl:13: *	tfreq - # of tiles in t
k3d/share/shaders/k3d_shiftedmoontile.sl:14: *	eclipseCenter - Center of obscuring disk
k3d/share/shaders/k3d_shiftedmoontile.sl:15: *	cstate1 - Color of disk
k3d/share/shaders/k3d_shiftedmoontile.sl:16: *	specularcolor - color of specular highlight
k3d/share/shaders/k3d_shiftedmoontile.sl:28:#define smoothPulse(a, b, fuzz, loc) \
k3d/share/shaders/k3d_shiftedmoontile.sl:29:	(smoothstep (a-fuzz, a+fuzz, loc) - \
k3d/share/shaders/k3d_shiftedmoontile.sl:30:	smoothstep (b-fuzz, b+fuzz, loc) )
k3d/share/shaders/k3d_shiftedmoontile.sl:32:#define repeat(pos, freq) \
k3d/share/shaders/k3d_shiftedmoontile.sl:33:	(mod (pos * freq, 1) )
k3d/share/shaders/k3d_shiftedmoontile.sl:35:#define whichtile(pos, freq) \
k3d/share/shaders/k3d_shiftedmoontile.sl:36:	(floor((pos) * freq) )
k3d/share/shaders/k3d_shiftedmoontile.sl:38:#define isOdd(x) \
k3d/share/shaders/k3d_shiftedmoontile.sl:41:#define difference(a, b) ((a) - (a) * b)
k3d/share/shaders/k3d_shiftedmoontile.sl:43:surface
k3d/share/shaders/k3d_shiftedmoontile.sl:44:k3d_shiftedmoontile (
k3d/share/shaders/k3d_shiftedmoontile.sl:45:	uniform float Ka = 1;
k3d/share/shaders/k3d_shiftedmoontile.sl:46:	uniform float Kd = .5;
k3d/share/shaders/k3d_shiftedmoontile.sl:47:	uniform float Ks = .5;
k3d/share/shaders/k3d_shiftedmoontile.sl:48:	uniform float roughness = .1;
k3d/share/shaders/k3d_shiftedmoontile.sl:49:	uniform float fuzz = .02;
k3d/share/shaders/k3d_shiftedmoontile.sl:50:	uniform float radius = 0.45;
k3d/share/shaders/k3d_shiftedmoontile.sl:51:	uniform float sfreq = 4.0;
k3d/share/shaders/k3d_shiftedmoontile.sl:52:	uniform float tfreq = 4.0;
k3d/share/shaders/k3d_shiftedmoontile.sl:53:	uniform point eclipseCenter = point "current" (0.6, 0.5, 0);
k3d/share/shaders/k3d_shiftedmoontile.sl:54:	uniform color cstate1 = color(1, 0, 0);
k3d/share/shaders/k3d_shiftedmoontile.sl:55:	uniform color specularcolor = 1;)
k3d/share/shaders/k3d_shiftedmoontile.sl:57:	point Nf;
k3d/share/shaders/k3d_shiftedmoontile.sl:58:	uniform point center;            /* Center of disk */
k3d/share/shaders/k3d_shiftedmoontile.sl:59:	color surfColor;         /* Color of surface */
k3d/share/shaders/k3d_shiftedmoontile.sl:60:	float mix_opacity;       /* How much to mix between the surfaces */
k3d/share/shaders/k3d_shiftedmoontile.sl:61:	float circle1, circle2;  /* True if in circle1, circle2 */
k3d/share/shaders/k3d_shiftedmoontile.sl:62:	float ss, tt;            /* Tile coordinates */
k3d/share/shaders/k3d_shiftedmoontile.sl:63:	float row, col;          /* Location in tiles */
k3d/share/shaders/k3d_shiftedmoontile.sl:64:	float d, d2;             /* Point distance from circle1, circle2 */
k3d/share/shaders/k3d_shiftedmoontile.sl:66:	Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_shiftedmoontile.sl:67:	surfColor = Cs;
k3d/share/shaders/k3d_shiftedmoontile.sl:71: 	row = whichtile (t, tfreq);
k3d/share/shaders/k3d_shiftedmoontile.sl:72:	if (isOdd(row) == 0)
k3d/share/shaders/k3d_shiftedmoontile.sl:73:		ss = mod (s * sfreq + 0.5, 1);
k3d/share/shaders/k3d_shiftedmoontile.sl:75:		ss = repeat (s, sfreq);
k3d/share/shaders/k3d_shiftedmoontile.sl:77:	tt = repeat (t, tfreq);
k3d/share/shaders/k3d_shiftedmoontile.sl:82:	circle1 = 1 - smoothstep (radius - fuzz, radius + fuzz, d);
k3d/share/shaders/k3d_shiftedmoontile.sl:83:	circle2 = 1 - smoothstep (radius - fuzz, radius + fuzz, d2);
k3d/share/shaders/k3d_shiftedmoontile.sl:84:	mix_opacity = difference (circle1, circle2);
k3d/share/shaders/k3d_shiftedmoontile.sl:85:	surfColor = mix (surfColor, cstate1, mix_opacity);
k3d/share/shaders/k3d_shiftedmoontile.sl:88:	Ci = Os * (surfColor * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_shiftedmoontile.sl:89:	      specularcolor * Ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_shiny.sl:2: * shiny.sl -- Shiny metal surface
k3d/share/shaders/k3d_shiny.sl:6: *    Kr - coefficient for mirror-like reflections of environment
k3d/share/shaders/k3d_shiny.sl:7: *    blur - how blurry are the reflections? (0 = perfectly sharp)
k3d/share/shaders/k3d_shiny.sl:8: *    envname, envspace, envrad - controls for using environment maps
k3d/share/shaders/k3d_shiny.sl:9: *    rayjitter, raysamples - ray tracing controls for reflection
k3d/share/shaders/k3d_shiny.sl:10: *    twosided - if nonzero both sides of the surface are shiny, otherwise
k3d/share/shaders/k3d_shiny.sl:11: *        only the "outside" (where the surface normal points) will
k3d/share/shaders/k3d_shiny.sl:19: * Reference:
k3d/share/shaders/k3d_shiny.sl:20: *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
k3d/share/shaders/k3d_shiny.sl:21: *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
k3d/share/shaders/k3d_shiny.sl:27:/* Get rid of rayserver.h if you don't want PRMan and BMRT to work together */
k3d/share/shaders/k3d_shiny.sl:33:surface k3d_shiny(float Ka = 1, Kd = 0.1, Ks = 1, roughness = 0.2;
k3d/share/shaders/k3d_shiny.sl:34:		  float Kr = 0.8, blur = 0; DECLARE_DEFAULTED_ENVPARAMS;
k3d/share/shaders/k3d_shiny.sl:35:		  float twosided = 0;)
k3d/share/shaders/k3d_shiny.sl:37:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_shiny.sl:39:    MaterialShinyMetal(Nf, Cs, Ka, Kd, Ks, roughness, Kr, blur, twosided,
k3d/share/shaders/k3d_shinymetal.sl:1:/* shinymetal.sl - Standard metal with environment mapping for
k3d/share/shaders/k3d_shinymetal.sl:2: * RenderMan Interface.
k3d/share/shaders/k3d_shinymetal.sl:5: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_shinymetal.sl:7: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_shinymetal.sl:10:surface k3d_shinymetal(float Ka = 1;
k3d/share/shaders/k3d_shinymetal.sl:11:		       float Ks = 1; float Kr = 1; float roughness = .1;
k3d/share/shaders/k3d_shinymetal.sl:14:  normal Nf;
k3d/share/shaders/k3d_shinymetal.sl:19:  Nf = faceforward(normalize(N), V);
k3d/share/shaders/k3d_shinymetal.sl:20:  D = reflect(V, Nf);
k3d/share/shaders/k3d_shinymetal.sl:21:  D = vtransform("world", D);
k3d/share/shaders/k3d_shinymetal.sl:23:  if(texturename != "")
k3d/share/shaders/k3d_shinymetal.sl:29:  Ci = Os * Cs * (Ka * ambient() + Ks * specular(Nf, -V, roughness) + env);
k3d/share/shaders/k3d_shinyplastic.sl:2: * shinyplastic.sl -- Shiny plastic surface
k3d/share/shaders/k3d_shinyplastic.sl:6: *    Kr - coefficient for mirror-like reflections of environment
k3d/share/shaders/k3d_shinyplastic.sl:7: *    blur - how blurry are the reflections? (0 = perfectly sharp)
k3d/share/shaders/k3d_shinyplastic.sl:8: *    ior - index of refraction (1.5 is a good estimate for most plastics)
k3d/share/shaders/k3d_shinyplastic.sl:9: *    envname, envspace, envrad - controls for using environment maps
k3d/share/shaders/k3d_shinyplastic.sl:10: *    rayjitter, raysamples - ray tracing controls for reflection
k3d/share/shaders/k3d_shinyplastic.sl:11: *    twosided - if nonzero both sides of the surface are shiny, otherwise
k3d/share/shaders/k3d_shinyplastic.sl:12: *        only the "outside" (where the surface normal points) will
k3d/share/shaders/k3d_shinyplastic.sl:27:surface k3d_shinyplastic(float Ka = 1, Kd = 0.5, Ks = .5, roughness = 0.1;
k3d/share/shaders/k3d_shinyplastic.sl:28:			 float Kr = 1, blur = 0, ior = 1.5;
k3d/share/shaders/k3d_shinyplastic.sl:30:			 float twosided = 0;
k3d/share/shaders/k3d_shinyplastic.sl:33:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_shinyplastic.sl:35:    MaterialShinyPlastic(Nf, Cs, Ka, Kd, Ks, roughness, Kr, blur, ior,
k3d/share/shaders/k3d_show_st.sl:6: * show_st(): color surface point according to its s,t coordinates.
k3d/share/shaders/k3d_show_st.sl:8:surface
k3d/share/shaders/k3d_skin1.sl:7: * This software is placed in the public domain and is provided as is 
k3d/share/shaders/k3d_skin1.sl:10: * Surface shader that implements a shading model that should have a visual 
k3d/share/shaders/k3d_skin1.sl:11: * appearence generall similar to that of skin. 
k3d/share/shaders/k3d_skin1.sl:13: * Feel free to use this shader to create skin for any character, anywhere and
k3d/share/shaders/k3d_skin1.sl:17: * Kd = the amount of uniform diffusion applyied to the skin
k3d/share/shaders/k3d_skin1.sl:18: * skincolor, skinmap = the color of the skin. Using a map overrides original skincolor
k3d/share/shaders/k3d_skin1.sl:20: * sheencolor, shinmap = the color of the skin at grazing angles. Using a map overrides
k3d/share/shaders/k3d_skin1.sl:22: * blemishfreq, blemishthresh,blemhishopac = control the freqency, threshold and opacity
k3d/share/shaders/k3d_skin1.sl:23: * of blemishes on the skin. Use to give skin a little variation.
k3d/share/shaders/k3d_skin1.sl:25: * xdir, angle = control the direction of the specular highlights.
k3d/share/shaders/k3d_skin1.sl:29: * poresfreq, poresthresh poresdepth = control the frequency, threshold and depth of the
k3d/share/shaders/k3d_skin1.sl:33: * You can replace the header functions by using
k3d/share/shaders/k3d_skin1.sl:35: * NOTE- you must copy the entire subsurface skin function to your
k3d/share/shaders/k3d_skin1.sl:36: * "locIllum.h" file
k3d/share/shaders/k3d_skin1.sl:40: * Modification history:
k3d/share/shaders/k3d_skin1.sl:42: *     Renamed RudyCSkin for RMR.
k3d/share/shaders/k3d_skin1.sl:55: * The derivation and formulae can be found in:  Ward, Gregory J.
k3d/share/shaders/k3d_skin1.sl:56: * "Measuring and Modeling Anisotropic Reflection," ACM Computer 
k3d/share/shaders/k3d_skin1.sl:57: * Graphics 26(2) (Proceedings of Siggraph '92), pp. 265-272, July, 1992.
k3d/share/shaders/k3d_skin1.sl:62:                         vector xdir;  float xroughness, yroughness;)
k3d/share/shaders/k3d_skin1.sl:64:    float sqr (float x) { return x*x; }
k3d/share/shaders/k3d_skin1.sl:66:    float cos_theta_r = clamp (N.V, 0.0001, 1);
k3d/share/shaders/k3d_skin1.sl:73:  /* Must declare extern L & Cl because we're in a function */
k3d/share/shaders/k3d_skin1.sl:75:  float nonspec = 0;
k3d/share/shaders/k3d_skin1.sl:77:  if (nonspec < 1) {
k3d/share/shaders/k3d_skin1.sl:79:      float cos_theta_i = LN . N;
k3d/share/shaders/k3d_skin1.sl:80:      if (cos_theta_i > 0.0) {
k3d/share/shaders/k3d_skin1.sl:82:    float rho = exp (-2 * (sqr(X.H) + sqr(Y.H)) / (1 + H.N))
k3d/share/shaders/k3d_skin1.sl:93: * --- subsurfaceSkin------
k3d/share/shaders/k3d_skin1.sl:94: * Surface shader that implements a shading model that should have a visual 
k3d/share/shaders/k3d_skin1.sl:95: * appearence generall similar to that of skin.  Based on phenomenological 
k3d/share/shaders/k3d_skin1.sl:96: * information about skin reflectance from Hanrahan and Krueger, 
k3d/share/shaders/k3d_skin1.sl:97: * "Reflection from layered surfaces due to subsurface scattering", 
k3d/share/shaders/k3d_skin1.sl:98: * proceedings of Siggraph 1993.
k3d/share/shaders/k3d_skin1.sl:100:/* Evaluate the Henyey-Greenstein phase function for two vectors with
k3d/share/shaders/k3d_skin1.sl:102:   be in the range (-1, 1).  Negative values of g correspond to more
k3d/share/shaders/k3d_skin1.sl:103:   back-scattering and positive values correspond to more forward scattering.
k3d/share/shaders/k3d_skin1.sl:105:float phase(vector v1, v2; float g) {
k3d/share/shaders/k3d_skin1.sl:106:  float costheta = -v1 . v2;
k3d/share/shaders/k3d_skin1.sl:110:/* Compute a the single-scattering approximation to scattering from
k3d/share/shaders/k3d_skin1.sl:111:   a one-dimensional volumetric surface.  Given incident and outgoing
k3d/share/shaders/k3d_skin1.sl:112:   directions wi and wo, surface normal n, asymmetry value g (see above),
k3d/share/shaders/k3d_skin1.sl:113:   scattering albedo (between 0 and 1 for physically-valid volumes),
k3d/share/shaders/k3d_skin1.sl:114:   and the thickness of the volume, use the closed-form single-scattering
k3d/share/shaders/k3d_skin1.sl:117:float singleScatter(vector wi, wo; normal n; float g, albedo, thickness) {
k3d/share/shaders/k3d_skin1.sl:118:    float win = abs(wi . n);
k3d/share/shaders/k3d_skin1.sl:119:    float won = abs(wo . n);
k3d/share/shaders/k3d_skin1.sl:125:vector efresnel(vector II; normal NN; float eta; output float Kr, Kt;) {
k3d/share/shaders/k3d_skin1.sl:127:    fresnel(II, NN, eta, Kr, Kt, R, T);
k3d/share/shaders/k3d_skin1.sl:133:/* Implements overall skin subsurface shading model.  Takes viewing and
k3d/share/shaders/k3d_skin1.sl:134:   surface normal information, the base color of the skin, a
k3d/share/shaders/k3d_skin1.sl:135:   color for an oily surface sheen.
k3d/share/shaders/k3d_skin1.sl:137:color subsurfaceSkin(vector Vf; normal Nn; color skinColor, sheenColor;
k3d/share/shaders/k3d_skin1.sl:138:                     float eta, thickness) {
k3d/share/shaders/k3d_skin1.sl:140:  float Kr, Kt, Kr2, Kt2;
k3d/share/shaders/k3d_skin1.sl:143:  vector T = efresnel(-Vf, Nn, eta, Kr, Kt);
k3d/share/shaders/k3d_skin1.sl:148:      vector H = normalize(Ln + Vf);
k3d/share/shaders/k3d_skin1.sl:149:      if (H . Nn > 0)
k3d/share/shaders/k3d_skin1.sl:153:      vector T2 = efresnel(-Ln, Nn, eta, Kr2, Kt2);
k3d/share/shaders/k3d_skin1.sl:160:}    /* subsurfaceSkin --ends */
k3d/share/shaders/k3d_skin1.sl:164:#define snoise(p) (2 * (float noise(p)) - 1)
k3d/share/shaders/k3d_skin1.sl:170:surface k3d_skin1(
k3d/share/shaders/k3d_skin1.sl:171:  float Kd = .1;
k3d/share/shaders/k3d_skin1.sl:176:  float blemishfreq  = 12,
k3d/share/shaders/k3d_skin1.sl:180:  float eta = 1.01,
k3d/share/shaders/k3d_skin1.sl:183:  float angle = 180;
k3d/share/shaders/k3d_skin1.sl:184:  float oily = 1.5;
k3d/share/shaders/k3d_skin1.sl:186:  float xroughness = .3,
k3d/share/shaders/k3d_skin1.sl:188:  float poresfreq = 60,
k3d/share/shaders/k3d_skin1.sl:196:  normal Nf, NN;
k3d/share/shaders/k3d_skin1.sl:197:  vector Vf = -normalize(I);
k3d/share/shaders/k3d_skin1.sl:199:  float lo;
k3d/share/shaders/k3d_skin1.sl:201:  float turb, f;
k3d/share/shaders/k3d_skin1.sl:202:  float maxfreq = 8;
k3d/share/shaders/k3d_skin1.sl:206:  float oilVal = oily;
k3d/share/shaders/k3d_skin1.sl:211:  PP = transform ("shader",P) * poresfreq;
k3d/share/shaders/k3d_skin1.sl:213:  for (f = 1; f< maxfreq; f *= 2)
k3d/share/shaders/k3d_skin1.sl:214:  turb += abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_skin1.sl:221:  Nf = faceforward(normalize(NN),I);
k3d/share/shaders/k3d_skin1.sl:223:  /* layer 1 .- apply a subsurface scattered BRDF to the surface.
k3d/share/shaders/k3d_skin1.sl:224:   * you can use an image map for the color of the skin and the sheen.
k3d/share/shaders/k3d_skin1.sl:225:   * If the map is not provided use defined colors*/
k3d/share/shaders/k3d_skin1.sl:227:  if (skinmap != "")
k3d/share/shaders/k3d_skin1.sl:230:  if ( sheenmap != "")
k3d/share/shaders/k3d_skin1.sl:238:  PP = transform ("shader",P) * blemishfreq;
k3d/share/shaders/k3d_skin1.sl:240:  for (f = 1; f< maxfreq; f *= 2)
k3d/share/shaders/k3d_skin1.sl:241:  turb += abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_skin1.sl:264:  lc =  subsurfaceSkin(Vf, Nf, blemishcol, Csheen, 1/eta, thickness);
k3d/share/shaders/k3d_skin1.sl:267:  if (blemishmap != "")
k3d/share/shaders/k3d_skin1.sl:268:      lo *= float texture (blemishmap);
k3d/share/shaders/k3d_skin1.sl:276:  if (oily > 0.01){
k3d/share/shaders/k3d_skin1.sl:278:  if (angle !=0)
k3d/share/shaders/k3d_skin1.sl:280:    matrix rot = rotate(matrix 1, radians(angle),Nf);
k3d/share/shaders/k3d_skin1.sl:281:    anisoDir = vtransform(rot,anisoDir);
k3d/share/shaders/k3d_skin1.sl:283:  lc = LocIllumWardAnisotropic(Nf,Vf,anisoDir,xroughness,yroughness);
k3d/share/shaders/k3d_skin1.sl:285:  if (oilmap != "")
k3d/share/shaders/k3d_skin1.sl:286:      oilVal *= float texture(oilmap);
k3d/share/shaders/k3d_skin1.sl:296:  Ci = sc + Kd * diffuse(Nf) ;
k3d/share/shaders/k3d_skin2.sl:6: * This software is placed in the public domain and is provided as is 
k3d/share/shaders/k3d_skin2.sl:9: * Surface shader that implements a shading model that should have a visual 
k3d/share/shaders/k3d_skin2.sl:10: * appearence generall similar to that of skin.  Based on phenomenological 
k3d/share/shaders/k3d_skin2.sl:11: * information about skin reflectance from Hanrahan and Krueger, 
k3d/share/shaders/k3d_skin2.sl:12: * "Reflection from layered surfaces due to subsurface scattering", 
k3d/share/shaders/k3d_skin2.sl:13: * proceedings of Siggraph 1993. 
k3d/share/shaders/k3d_skin2.sl:16: * for notes and background information.
k3d/share/shaders/k3d_skin2.sl:19:/* Evaluate the Henyey-Greenstein phase function for two vectors with
k3d/share/shaders/k3d_skin2.sl:21:   be in the range (-1, 1).  Negative values of g correspond to more
k3d/share/shaders/k3d_skin2.sl:22:   back-scattering and positive values correspond to more forward scattering.
k3d/share/shaders/k3d_skin2.sl:24:float phase(vector v1, v2; float g) {
k3d/share/shaders/k3d_skin2.sl:25:	float costheta = -v1 . v2;
k3d/share/shaders/k3d_skin2.sl:29:/* Compute a the single-scattering approximation to scattering from
k3d/share/shaders/k3d_skin2.sl:30:   a one-dimensional volumetric surface.  Given incident and outgoing
k3d/share/shaders/k3d_skin2.sl:31:   directions wi and wo, surface normal n, asymmetry value g (see above),
k3d/share/shaders/k3d_skin2.sl:32:   scattering albedo (between 0 and 1 for physically-valid volumes),
k3d/share/shaders/k3d_skin2.sl:33:   and the thickness of the volume, use the closed-form single-scattering
k3d/share/shaders/k3d_skin2.sl:36:float singleScatter(vector wi, wo; normal n; float g, albedo, thickness) {
k3d/share/shaders/k3d_skin2.sl:37:    float win = abs(wi . n);
k3d/share/shaders/k3d_skin2.sl:38:    float won = abs(wo . n);
k3d/share/shaders/k3d_skin2.sl:45:vector efresnel(vector II; normal NN; float eta; output float Kr, Kt;) {
k3d/share/shaders/k3d_skin2.sl:47:    fresnel(II, NN, eta, Kr, Kt, R, T);
k3d/share/shaders/k3d_skin2.sl:54:/* Implements overall skin subsurface shading model.  Takes viewing and
k3d/share/shaders/k3d_skin2.sl:55:   surface normal information, the base color of the skin, a
k3d/share/shaders/k3d_skin2.sl:56:   color for an oily surface sheen, the ratio of the indices of 
k3d/share/shaders/k3d_skin2.sl:57:   refraction of the incoming ray (typically ~1 for air) to the index
k3d/share/shaders/k3d_skin2.sl:58:   of refraction for the transmitted ray (say something like 1.4 for
k3d/share/shaders/k3d_skin2.sl:59:   skin), and the overall thickness of the skin layer.  Then loops
k3d/share/shaders/k3d_skin2.sl:60:   over light sources with illuminance() and computes the reflected
k3d/share/shaders/k3d_skin2.sl:63:color subsurfaceSkin(vector Vf; normal Nn; color skinColor, sheenColor;
k3d/share/shaders/k3d_skin2.sl:64:                     float eta, thickness) {
k3d/share/shaders/k3d_skin2.sl:66:	float Kr, Kt, Kr2, Kt2;
k3d/share/shaders/k3d_skin2.sl:69:	vector T = efresnel(-Vf, Nn, eta, Kr, Kt);
k3d/share/shaders/k3d_skin2.sl:74:	    vector H = normalize(Ln + Vf);
k3d/share/shaders/k3d_skin2.sl:75:	    if (H . Nn > 0)
k3d/share/shaders/k3d_skin2.sl:79:	    vector T2 = efresnel(-Ln, Nn, eta, Kr2, Kt2);
k3d/share/shaders/k3d_skin2.sl:88:/* Basic surface shader that uses the skin reflection model implemented
k3d/share/shaders/k3d_skin2.sl:89:   above.  Uses Cs for the basic color of the skin (.8, .5, .5) works
k3d/share/shaders/k3d_skin2.sl:90:   reasonably well for Caucasian skin.
k3d/share/shaders/k3d_skin2.sl:92:surface k3d_skin2(color Ka = .5; color sheenColor = 1.;
k3d/share/shaders/k3d_skin2.sl:93:             float eta = 1./1.4, thickness = .5) {
k3d/share/shaders/k3d_skin2.sl:94:	normal Nn = faceforward(normalize(N), I);
k3d/share/shaders/k3d_skin2.sl:95:	vector Vf = -normalize(I);
k3d/share/shaders/k3d_skin2.sl:98:	Ci = Os * subsurfaceSkin(Vf, Nn, Cs, sheenColor, eta, thickness);
k3d/share/shaders/k3d_skymetal.sl:2: * from p. 103 of Siggraph 1991 Course 21
k3d/share/shaders/k3d_skymetal.sl:3: * The RenderMan Interface and Shading Language
k3d/share/shaders/k3d_skymetal.sl:8: * A more general version with some explainations can be found in my
k3d/share/shaders/k3d_skymetal.sl:15:surface k3d_skymetal (
k3d/share/shaders/k3d_skymetal.sl:16:  float Ka = 1, Ks = 1, Kr = .2;
k3d/share/shaders/k3d_skymetal.sl:17:  float roughness = .1;
k3d/share/shaders/k3d_skymetal.sl:19:             /* actually should be vector and vtransform if using 3.5 or 
k3d/share/shaders/k3d_skymetal.sl:24:	point Nf;
k3d/share/shaders/k3d_skymetal.sl:25:	color refl;
k3d/share/shaders/k3d_skymetal.sl:26:	float costheta;
k3d/share/shaders/k3d_skymetal.sl:33:	Nf = normalize (faceforward (N, I));
k3d/share/shaders/k3d_skymetal.sl:35:	costheta = normalize (reflect (I, Nf)) . up;
k3d/share/shaders/k3d_skymetal.sl:37:	if (costheta >= 0.0)
k3d/share/shaders/k3d_skymetal.sl:38:		refl = mix (sky_horiz, sky_zenith, costheta);
k3d/share/shaders/k3d_skymetal.sl:40:		refl = mix (land_horiz, land_zenith, -costheta);
k3d/share/shaders/k3d_skymetal.sl:43:	Ci = Os * Cs * (Kr*refl + (1-Kr) * (Ka * ambient () +
k3d/share/shaders/k3d_skymetal.sl:44:		Ks * specular (Nf, -I, roughness)));
k3d/share/shaders/k3d_slateroof.sl:1:/* Renamed to PQslateroof.sl for RMR -- talrmr@SpamSucks_pacbell.net */
k3d/share/shaders/k3d_slateroof.sl:4:	slateroof.sl - a surface shader working with slateroofd.sl, to
k3d/share/shaders/k3d_slateroof.sl:5:	introduce a slate color onto roof tiles, making the last row of tiles
k3d/share/shaders/k3d_slateroof.sl:6:	transparent (and black) so that the edge of the roof looks irregular.
k3d/share/shaders/k3d_slateroof.sl:7:	You must bear this in mind when modelling - to avoid the roof ending
k3d/share/shaders/k3d_slateroof.sl:8:	before it reaches the wall which supposedly supports it! The shader
k3d/share/shaders/k3d_slateroof.sl:12:   Ka: Coefficient of ambient light;
k3d/share/shaders/k3d_slateroof.sl:13: 	Kd: Coefficient of diffuse light;
k3d/share/shaders/k3d_slateroof.sl:14:   sfreq: number of tiles on the s direction
k3d/share/shaders/k3d_slateroof.sl:15:   tfreq: number of tiles in the t direction
k3d/share/shaders/k3d_slateroof.sl:16: 	maxadd: the maximum amount of overlap of one tile and another
k3d/share/shaders/k3d_slateroof.sl:17: 	ramp: the amount of a tile used for the initial rise to the maximum height
k3d/share/shaders/k3d_slateroof.sl:19: 	gap: the size of the gap between one tile and the next in the s direction,
k3d/share/shaders/k3d_slateroof.sl:20: 		measured as a proportion of the tile (so the value of gap must lie between 0 
k3d/share/shaders/k3d_slateroof.sl:22: 	maxcolorvary: the maximum amount by which the color of a slate can vary from the 
k3d/share/shaders/k3d_slateroof.sl:24: 	txtscale: a scaling factor for the slate coloration - the larger txtscale the
k3d/share/shaders/k3d_slateroof.sl:26: 	factor: a seed used for adjusting the randomness - if you have two roofs with
k3d/share/shaders/k3d_slateroof.sl:27: 		the same sfreq, tfreq change the value of factor to ensure they have a 
k3d/share/shaders/k3d_slateroof.sl:28: 		different random patterning. A value > 20 works best
k3d/share/shaders/k3d_slateroof.sl:37:	Nb. This shader would normally be used with the slateroofd shader to
k3d/share/shaders/k3d_slateroof.sl:38:	produce an appropriate displacement and message passing from the
k3d/share/shaders/k3d_slateroof.sl:39:	displacement shader would eliminate the need for a lot of the
k3d/share/shaders/k3d_slateroof.sl:47:surface
k3d/share/shaders/k3d_slateroof.sl:48:k3d_slateroof(  float 	Ka = .2,
k3d/share/shaders/k3d_slateroof.sl:50:                   	sfreq = 10,
k3d/share/shaders/k3d_slateroof.sl:51:                   	tfreq = 10,
k3d/share/shaders/k3d_slateroof.sl:56:							factor = 22.238,
k3d/share/shaders/k3d_slateroof.sl:58:	/* sfreq and tfreq must not be below 3 */				   
k3d/share/shaders/k3d_slateroof.sl:61:   uniform float swidth = 1 / sfreq, 		/* Tile width in the s directio */
k3d/share/shaders/k3d_slateroof.sl:62:                 twidth = 1 / tfreq, 		/* ditto for the t direction */
k3d/share/shaders/k3d_slateroof.sl:63:                 offset = swidth / 2,		/* the amount by which alternate rows are offset */
k3d/share/shaders/k3d_slateroof.sl:65:   float scoord = s, tcoord = 1 - t; 		/* re map the t coord so that the coving is at the top */
k3d/share/shaders/k3d_slateroof.sl:66:	float stile, ttile, 							/* An integer identifying the current tile */
k3d/share/shaders/k3d_slateroof.sl:67:			s_offset, t_offset, 					/* Offsets withing the current tile, between 0, 1 */
k3d/share/shaders/k3d_slateroof.sl:68:			newstile, newscoord, 				/* Used in calculations to identify an overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:69:			cs, ct; 									/* Coordinates set to the centre of the tile and fed into the noise function */
k3d/share/shaders/k3d_slateroof.sl:70:   float add, 										/* Add, between 0 and 1, hold the amount the current tile overlaps the next */
k3d/share/shaders/k3d_slateroof.sl:71:			news_offset, 
k3d/share/shaders/k3d_slateroof.sl:72:			disps, dispt, disp, dispo,      	/* Displacements - s direction, t direction, final displacement, and 
k3d/share/shaders/k3d_slateroof.sl:73:										  					displacement for the non-overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:74:			temp_s_offset, 
k3d/share/shaders/k3d_slateroof.sl:75:			temp_t_offset, newadd;			 
k3d/share/shaders/k3d_slateroof.sl:76:   uniform 	float colorfactor = 3.276 * factor;	/* Used in noise calculations */	
k3d/share/shaders/k3d_slateroof.sl:78:	float 	colorvary = 0,				    	/* the random amount by which a tile is lightened or darkened */
k3d/share/shaders/k3d_slateroof.sl:82:	normal Nf = normalize(faceforward(N,I));
k3d/share/shaders/k3d_slateroof.sl:85:	/* Work out which tile we are in, and the offset within that tile */
k3d/share/shaders/k3d_slateroof.sl:87:	if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroof.sl:88:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroof.sl:90:   s_offset = stile - floor(stile);
k3d/share/shaders/k3d_slateroof.sl:91:   t_offset = ttile - floor(ttile);
k3d/share/shaders/k3d_slateroof.sl:92:   stile = floor(stile);
k3d/share/shaders/k3d_slateroof.sl:93:   ttile = floor(ttile);
k3d/share/shaders/k3d_slateroof.sl:99:	/* the noise function is always taken at the same point in the tile 
k3d/share/shaders/k3d_slateroof.sl:101:	 * start and end of an offset row, where the middle of the left side 
k3d/share/shaders/k3d_slateroof.sl:102:    * of the tile is used */
k3d/share/shaders/k3d_slateroof.sl:105:	if ((mod(ct,2) >= 1)  && ((stile == 0) || (stile == sfreq)))
k3d/share/shaders/k3d_slateroof.sl:106:	/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroof.sl:108:	if (ttile < tfreq - 1)
k3d/share/shaders/k3d_slateroof.sl:109:		add = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroof.sl:112:	ocolorvary = (noise(cs * colorfactor, ct * colorfactor) - 1) * 2 * maxcolorvary;
k3d/share/shaders/k3d_slateroof.sl:115:	temp_t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroof.sl:116:	if (1 - temp_t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:117:   	dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - temp_t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:119:	   dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), temp_t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:120:	if (s_offset > .5)
k3d/share/shaders/k3d_slateroof.sl:121:	   temp_s_offset = 1 - s_offset;
k3d/share/shaders/k3d_slateroof.sl:123:		temp_s_offset = s_offset;
k3d/share/shaders/k3d_slateroof.sl:124:	if (temp_s_offset < gap * (1 + add))
k3d/share/shaders/k3d_slateroof.sl:125:	   disps = smoothstep(0, gap * (1 + add), temp_s_offset) * Km;
k3d/share/shaders/k3d_slateroof.sl:132:	/* Work out whether the point is in fact in another tile 
k3d/share/shaders/k3d_slateroof.sl:133:	 * storing the new tile in stile, ttile and new offset
k3d/share/shaders/k3d_slateroof.sl:134:	 * in s_offset, t_offset */
k3d/share/shaders/k3d_slateroof.sl:135:	if ((t_offset <= maxadd) && (ttile >= 1))
k3d/share/shaders/k3d_slateroof.sl:138:			if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroof.sl:139:			/* We are in an offset tile row adjust the scoord appropriately for
k3d/share/shaders/k3d_slateroof.sl:141:				newscoord = scoord - offset;
k3d/share/shaders/k3d_slateroof.sl:143:				newscoord = scoord + offset;
k3d/share/shaders/k3d_slateroof.sl:145:			news_offset = newstile - floor(newstile);
k3d/share/shaders/k3d_slateroof.sl:146:			newstile = floor(newstile);
k3d/share/shaders/k3d_slateroof.sl:147:			/* Now calculate cs, ct the reference point for the noise calculation */					
k3d/share/shaders/k3d_slateroof.sl:150:			if ((mod(ct,2) >= 1) && ((newstile == 0) || (newstile == sfreq)))
k3d/share/shaders/k3d_slateroof.sl:151:			/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroof.sl:153:			newadd = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroof.sl:154:			newcolorvary =  (noise(cs * colorfactor, ct * colorfactor) - 1) * 2 * maxcolorvary;
k3d/share/shaders/k3d_slateroof.sl:155:			if (t_offset <= newadd)
k3d/share/shaders/k3d_slateroof.sl:156:				/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:161:					t_offset = t_offset + 1;
k3d/share/shaders/k3d_slateroof.sl:162:					s_offset = news_offset;
k3d/share/shaders/k3d_slateroof.sl:168:	t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroof.sl:169:	if (1 - t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:170:			dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:172:		    dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:173:	if (s_offset > .5)
k3d/share/shaders/k3d_slateroof.sl:174:		s_offset = 1 - s_offset;
k3d/share/shaders/k3d_slateroof.sl:175:	if (s_offset < gap / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:176:		disps = Km * smoothstep(0, gap / (1 + add), s_offset);
k3d/share/shaders/k3d_slateroof.sl:180:	if (dispo > disp)
k3d/share/shaders/k3d_slateroof.sl:182:	/*printf("#dispo = %f, disp = %f, colorvary = %f\n",dispo,disp,colorvary); */
k3d/share/shaders/k3d_slateroof.sl:184:	ns = noise( s * txtscale * 59.8534 * sfreq, t * txtscale * 59.8534 * tfreq);
k3d/share/shaders/k3d_slateroof.sl:192:	if (ttile < tfreq - 1) 
k3d/share/shaders/k3d_slateroof.sl:199:	Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward( normalize(N), I )));
k3d/share/shaders/k3d_slateroofd.sl:1:/* Renamed to PQslateroofd.sl for RMR -- talrmr@SpamSucks_pacbell.net */
k3d/share/shaders/k3d_slateroofd.sl:4:  slateroofd.sl - a displacement shader to produce tiles on a roof
k3d/share/shaders/k3d_slateroofd.sl:9:    	Km: Maximum displacement of tiles;
k3d/share/shaders/k3d_slateroofd.sl:10:    	sfreq: number of tiles on the s direction
k3d/share/shaders/k3d_slateroofd.sl:11:    	tfreq: number of tiles in the t direction
k3d/share/shaders/k3d_slateroofd.sl:12: 		maxadd: the maximum amount of overlap of one tile and another
k3d/share/shaders/k3d_slateroofd.sl:13: 		ramp: the amount of a tile used for the initial rise to the maximum height
k3d/share/shaders/k3d_slateroofd.sl:15: 		gap: the size of the gap between one tile and the next in the s direction,
k3d/share/shaders/k3d_slateroofd.sl:16: 			measured as a proportion of the tile (so the value of gap must lie between 0 
k3d/share/shaders/k3d_slateroofd.sl:18: 		factor: a seed used for adjusting the randomness - if you have two roofs with
k3d/share/shaders/k3d_slateroofd.sl:19: 			the same sfreq, tfreq change the value of factor to ensure they have a 
k3d/share/shaders/k3d_slateroofd.sl:20: 			different random patterning. A value > 20 works best
k3d/share/shaders/k3d_slateroofd.sl:24:		This routine produces a random tiled effect. In the s direction the
k3d/share/shaders/k3d_slateroofd.sl:25:		tiles are regular, with every other row offset by half a tile width, as
k3d/share/shaders/k3d_slateroofd.sl:26:		normal roof tiles would be. Each tile is expanded by a random amount in
k3d/share/shaders/k3d_slateroofd.sl:29:		first determines the dimensions of the current tile, and then works out
k3d/share/shaders/k3d_slateroofd.sl:30:		the surface displacement according to a simple formula: a sharp ridge at
k3d/share/shaders/k3d_slateroofd.sl:31:		the bottom of the tile, gaps to either side and the whole tile gently
k3d/share/shaders/k3d_slateroofd.sl:32:		sloping towards zero at the top of the tile. It then looks to see if the
k3d/share/shaders/k3d_slateroofd.sl:33:		point we are considering is actually in the zone of overlap with the
k3d/share/shaders/k3d_slateroofd.sl:34:		tile 'above' the current one. If it is we replace the displacement we are
k3d/share/shaders/k3d_slateroofd.sl:35:		considering with one calculated for the tile above, being a little
k3d/share/shaders/k3d_slateroofd.sl:36:		careful to ensure there are no sudden jumps in displacement.
k3d/share/shaders/k3d_slateroofd.sl:44:k3d_slateroofd(  float 	Km = 1.0,
k3d/share/shaders/k3d_slateroofd.sl:45:                   	sfreq = 10,
k3d/share/shaders/k3d_slateroofd.sl:46:                   	tfreq = 10,
k3d/share/shaders/k3d_slateroofd.sl:50:							factor = 22.838)
k3d/share/shaders/k3d_slateroofd.sl:51:/* sfreq and tfreq must not be below 3 */				   
k3d/share/shaders/k3d_slateroofd.sl:54:   uniform float swidth = 1 / sfreq, 		/* Tile width in the s directio */
k3d/share/shaders/k3d_slateroofd.sl:55:                 twidth = 1 / tfreq, 		/* ditto for the t direction */
k3d/share/shaders/k3d_slateroofd.sl:56:                 offset = swidth / 2;		/* the amount by which alternate rows are offset */
k3d/share/shaders/k3d_slateroofd.sl:57:   float scoord = s, tcoord = 1 - t; 		/* re map the t coord so that the coving is at the top */
k3d/share/shaders/k3d_slateroofd.sl:58:   float stile, ttile, 							/* An integer identifying the current tile */
k3d/share/shaders/k3d_slateroofd.sl:59:			s_offset, t_offset, 					/* Offsets withing the current tile, between 0, 1 */
k3d/share/shaders/k3d_slateroofd.sl:60:			newstile, newscoord, 				/* Used in calculations to identify an overlapping tile */
k3d/share/shaders/k3d_slateroofd.sl:61:			cs, ct; 									/* Coordinates set to the centre of the tile and fed into the noise function */
k3d/share/shaders/k3d_slateroofd.sl:62:   float add,	 									/* Add, between 0 and 1, hold the amount the current tile overlaps the next */
k3d/share/shaders/k3d_slateroofd.sl:63:			news_offset, 
k3d/share/shaders/k3d_slateroofd.sl:64:			disps, dispt, disp, dispo,      	/* Displacements - s direction, t direction, final displacement, and 
k3d/share/shaders/k3d_slateroofd.sl:65:										 				 	displacement for the non-overlapping tile */
k3d/share/shaders/k3d_slateroofd.sl:66:			temp_s_offset, 
k3d/share/shaders/k3d_slateroofd.sl:67:			temp_t_offset, newadd;			 
k3d/share/shaders/k3d_slateroofd.sl:69:	normal Nf = normalize(N);
k3d/share/shaders/k3d_slateroofd.sl:70:	float spacescale = length(vtransform("shader", Nf));
k3d/share/shaders/k3d_slateroofd.sl:71:   vector Ndisp = Nf * (1 / max(spacescale,1e-6));
k3d/share/shaders/k3d_slateroofd.sl:76:	/* Work out which tile we are in, and the offset within that tile */
k3d/share/shaders/k3d_slateroofd.sl:78:	if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroofd.sl:79:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroofd.sl:81:   s_offset = stile - floor(stile);
k3d/share/shaders/k3d_slateroofd.sl:82:   t_offset = ttile - floor(ttile);
k3d/share/shaders/k3d_slateroofd.sl:83:   stile = floor(stile);
k3d/share/shaders/k3d_slateroofd.sl:84:   ttile = floor(ttile);
k3d/share/shaders/k3d_slateroofd.sl:89:	if (ttile < tfreq - 1)
k3d/share/shaders/k3d_slateroofd.sl:91:   	/* the noise function is always taken at the same point in the tile 
k3d/share/shaders/k3d_slateroofd.sl:93:			start and end of an offset row, where the middle of the left side 
k3d/share/shaders/k3d_slateroofd.sl:94:			of the tile is used */
k3d/share/shaders/k3d_slateroofd.sl:97:   		if ((mod(ct,2) >= 1)  && ((stile == 0) || (stile == sfreq)))
k3d/share/shaders/k3d_slateroofd.sl:98:			/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroofd.sl:100:   		add = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroofd.sl:106:	temp_t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroofd.sl:107:	/* the above adjusts t_offset so that it runs from 0 to 1 within the expanded tile */
k3d/share/shaders/k3d_slateroofd.sl:108:   if (1 - temp_t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:109:		dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - temp_t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:111:	   dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), temp_t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:112:	if (s_offset > .5)
k3d/share/shaders/k3d_slateroofd.sl:113:	   temp_s_offset = 1 - s_offset;
k3d/share/shaders/k3d_slateroofd.sl:115:		temp_s_offset = s_offset;
k3d/share/shaders/k3d_slateroofd.sl:116:	if (temp_s_offset < gap * (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:117:	   disps = smoothstep(0, gap * (1 + add), temp_s_offset) * Km;
k3d/share/shaders/k3d_slateroofd.sl:124:	/* Work out whether the point is in fact in another tile 	
k3d/share/shaders/k3d_slateroofd.sl:125:		storing the new tile in stile, ttile and new offset
k3d/share/shaders/k3d_slateroofd.sl:126:		in s_offset, t_offset */
k3d/share/shaders/k3d_slateroofd.sl:127:	if ((t_offset <= maxadd) && (ttile >= 1))
k3d/share/shaders/k3d_slateroofd.sl:130:			if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroofd.sl:131:				/* We are in an offset tile row adjust the scoord appropriately for
k3d/share/shaders/k3d_slateroofd.sl:133:				newscoord = scoord - offset;
k3d/share/shaders/k3d_slateroofd.sl:135:				newscoord = scoord + offset;
k3d/share/shaders/k3d_slateroofd.sl:137:			news_offset = newstile - floor(newstile);
k3d/share/shaders/k3d_slateroofd.sl:138:			newstile = floor(newstile);
k3d/share/shaders/k3d_slateroofd.sl:139:			/* Now calculate cs, ct the reference point for the noise calculation */					
k3d/share/shaders/k3d_slateroofd.sl:142:			if ((mod(ct,2) >= 1) && ((newstile == 0) || (newstile == sfreq)))
k3d/share/shaders/k3d_slateroofd.sl:143:				/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroofd.sl:145:			newadd = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroofd.sl:146:			if (t_offset <= newadd)
k3d/share/shaders/k3d_slateroofd.sl:147:			/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroofd.sl:152:					t_offset = t_offset + 1;
k3d/share/shaders/k3d_slateroofd.sl:153:					s_offset = news_offset;
k3d/share/shaders/k3d_slateroofd.sl:157:			t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroofd.sl:158:			if (1 - t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:160:					dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:163:				dispt = Km / 2 +  smoothstep( 0, 1 - ramp, t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:164:			if (s_offset > .5)
k3d/share/shaders/k3d_slateroofd.sl:165:				s_offset = 1 - s_offset;
k3d/share/shaders/k3d_slateroofd.sl:166:			if (s_offset < gap / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:167:				disps = Km * smoothstep(0, gap / (1 + add), s_offset);
k3d/share/shaders/k3d_slateroofd.sl:172:			/* taking the maximum of dispo, disp ensures that there
k3d/share/shaders/k3d_slateroofd.sl:176:	P += Nf * (disp / max(spacescale, 1e-6));
k3d/share/shaders/k3d_slateroofd.sl:177:	/*printf("disp = %f\n",disp);*/
k3d/share/shaders/k3d_slideprojector.sl:1:light k3d_slideprojector(float intensity = 2000;
k3d/share/shaders/k3d_slideprojector.sl:3:			 point from = point(0, 0, 0);
k3d/share/shaders/k3d_slideprojector.sl:5:			 point up = point(0, 1, 0); float coneangle = 45;
k3d/share/shaders/k3d_slideprojector.sl:6:			 float conedeltaangle = 5; float beamdistribution = 2;
k3d/share/shaders/k3d_slideprojector.sl:9:  uniform vector Z = normalize(to - from);
k3d/share/shaders/k3d_slideprojector.sl:10:  uniform vector X = Z ^ up;
k3d/share/shaders/k3d_slideprojector.sl:11:  uniform vector Y = normalize(X ^ Z);
k3d/share/shaders/k3d_slideprojector.sl:14:  uniform float rconeangle = radians(coneangle) * 0.5;
k3d/share/shaders/k3d_slideprojector.sl:15:  uniform float rconedeltaangle = radians(conedeltaangle);
k3d/share/shaders/k3d_slideprojector.sl:16:  uniform float spread = 1 / tan(rconeangle);
k3d/share/shaders/k3d_slideprojector.sl:18:  float attenuation, cosangle;
k3d/share/shaders/k3d_slideprojector.sl:19:  float Pt, Pu, Pv, sloc, tloc;
k3d/share/shaders/k3d_slideprojector.sl:23:  illuminate(from, Z, rconeangle)
k3d/share/shaders/k3d_slideprojector.sl:25:    L = Ps - from;
k3d/share/shaders/k3d_slideprojector.sl:41:    if(slidename == "")
k3d/share/shaders/k3d_smoke.sl:5: *    This is a volume shader for smoke.  Trapezoidal integration is
k3d/share/shaders/k3d_smoke.sl:6: *    used to find scattering and extinction.
k3d/share/shaders/k3d_smoke.sl:9: *   opacdensity - overall smoke density control as it affects its ability
k3d/share/shaders/k3d_smoke.sl:10: *          to block light from behind it.
k3d/share/shaders/k3d_smoke.sl:11: *   lightdensity - smoke density control as it affects light scattering
k3d/share/shaders/k3d_smoke.sl:13: *   integstart, integend - bounds along the viewing ray direction of the
k3d/share/shaders/k3d_smoke.sl:14: *          integration of atmospheric effects.
k3d/share/shaders/k3d_smoke.sl:15: *   stepsize - step size for integration
k3d/share/shaders/k3d_smoke.sl:16: *   smokefreq, smokeoctaves, smokevary - control the fBm of the noisy smoke
k3d/share/shaders/k3d_smoke.sl:17: *          If either smokeoctaves or smokevary is 0, there is no noise
k3d/share/shaders/k3d_smoke.sl:20: *          extinction coefficients.
k3d/share/shaders/k3d_smoke.sl:31: * coordinates), gather illumination from the light sources and
k3d/share/shaders/k3d_smoke.sl:33: * with the "__foglight" parameter.  
k3d/share/shaders/k3d_smoke.sl:36:		  uniform float smokevary, smokefreq, smokeoctaves;
k3d/share/shaders/k3d_smoke.sl:37:		  float stepsize;
k3d/share/shaders/k3d_smoke.sl:38:		  output color Lscatter; output float smoke)
k3d/share/shaders/k3d_smoke.sl:44:    float foglight = 1;
k3d/share/shaders/k3d_smoke.sl:45:    lightsource("__foglight", foglight);
k3d/share/shaders/k3d_smoke.sl:46:    if(foglight > 0)
k3d/share/shaders/k3d_smoke.sl:49:  if(smokeoctaves > 0 && smokevary > 0)
k3d/share/shaders/k3d_smoke.sl:51:      point Psmoke = Pshad * smokefreq;
k3d/share/shaders/k3d_smoke.sl:54:      /* Optimize: one octave only if not lit */
k3d/share/shaders/k3d_smoke.sl:55:      if(comp(Lscatter, 0) + comp(Lscatter, 1) + comp(Lscatter, 2) > 0.01)
k3d/share/shaders/k3d_smoke.sl:57:	  0.5 * fBm(Psmoke * 2, stepsize * 2, smokeoctaves - 1, 2, 0.5);
k3d/share/shaders/k3d_smoke.sl:68:/* Return a component-by-component exp() of a color */
k3d/share/shaders/k3d_smoke.sl:77:volume k3d_smoke(float opacdensity = 1, lightdensity = 1;
k3d/share/shaders/k3d_smoke.sl:78:		 float integstart = 0, integend = 100;
k3d/share/shaders/k3d_smoke.sl:79:		 float stepsize = 0.1, maxsteps = 100;
k3d/share/shaders/k3d_smoke.sl:80:		 color scatter = 1;	/* for sky, try (1, 2.25, 21) */
k3d/share/shaders/k3d_smoke.sl:81:		 float smokeoctaves = 0, smokefreq = 1, smokevary = 1;)
k3d/share/shaders/k3d_smoke.sl:83:  point Worigin = P - I;	/* Origin of volume ray */
k3d/share/shaders/k3d_smoke.sl:84:  point origin = transform("shader", Worigin);
k3d/share/shaders/k3d_smoke.sl:85:  float dtau, last_dtau;
k3d/share/shaders/k3d_smoke.sl:88:  /* Integrate forwards from the start point */
k3d/share/shaders/k3d_smoke.sl:89:  float d = integstart + random() * stepsize;
k3d/share/shaders/k3d_smoke.sl:90:  vector IN = normalize(vtransform("shader", I));
k3d/share/shaders/k3d_smoke.sl:91:  vector WIN = vtransform("shader", "current", IN);
k3d/share/shaders/k3d_smoke.sl:94:  float end = min(length(I), integend) - 0.0001;
k3d/share/shaders/k3d_smoke.sl:95:  float ss = min(stepsize, end - d);
k3d/share/shaders/k3d_smoke.sl:96:  /* Get the in-scattered light and the local smoke density for the
k3d/share/shaders/k3d_smoke.sl:97:   * beginning of the ray 
k3d/share/shaders/k3d_smoke.sl:99:  smokedensity(Worigin + d * WIN, origin + d * IN, smokevary, smokefreq,
k3d/share/shaders/k3d_smoke.sl:102:  color Cv = 0, Ov = 0;		/* color & opacity of volume that we accumulate */
k3d/share/shaders/k3d_smoke.sl:108:      smokedensity(Worigin + d * WIN, origin + d * IN, smokevary, smokefreq,
k3d/share/shaders/k3d_smoke.sl:111:      /* Find the blocking and light scattering contribution of 
k3d/share/shaders/k3d_smoke.sl:112:       * the portion of the volume covered by this step.
k3d/share/shaders/k3d_smoke.sl:114:      float tau = opacdensity * ss / 2 * (dtau + last_dtau);
k3d/share/shaders/k3d_smoke.sl:118:      /* Composite with exponential extinction of background light */
k3d/share/shaders/k3d_smoke.sl:125:  /* Ci & Oi are the color and opacity of the background element.
k3d/share/shaders/k3d_smoke.sl:126:   * Now Cv is the light contributed by the volume itself, and Ov is the
k3d/share/shaders/k3d_smoke.sl:127:   * opacity of the volume, i.e. (1-Ov)*Ci is the light from the background
k3d/share/shaders/k3d_smoke2.sl:3: * random() as it made my animation look to funky -- tal 9/4/96
k3d/share/shaders/k3d_smoke2.sl:6: *    This is a volume shader for smoke.  Trapezoidal integration is
k3d/share/shaders/k3d_smoke2.sl:7: *    used to integrate the GADD to find scattering and extinction.
k3d/share/shaders/k3d_smoke2.sl:11: *   integstart, integend - bounds along the viewing ray direction of the
k3d/share/shaders/k3d_smoke2.sl:12: *          integration of atmospheric effects.
k3d/share/shaders/k3d_smoke2.sl:13: *   stepsize - step size for integration
k3d/share/shaders/k3d_smoke2.sl:14: *   use_lighting - if nonzero, light visibility along the ray will be taken
k3d/share/shaders/k3d_smoke2.sl:16: *   use_noise - makes the smoke noisy (nonuniform) when nonzero
k3d/share/shaders/k3d_smoke2.sl:17: *   freq, octaves, smokevary - control the fBm of the noisy smoke
k3d/share/shaders/k3d_smoke2.sl:18: *   lightscale - multiplier for light scattered toward viewer in volume
k3d/share/shaders/k3d_smoke2.sl:19: *   debug - if nonzero, copious output will be sent to stderr.
k3d/share/shaders/k3d_smoke2.sl:39: * Compute only one octave of noise when not lit (big speedup)
k3d/share/shaders/k3d_smoke2.sl:47:#define snoise(p) (2*noise(p)-1)
k3d/share/shaders/k3d_smoke2.sl:50:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_smoke2.sl:51:#define GADD(PP,PW,li,g)                                                    \
k3d/share/shaders/k3d_smoke2.sl:52:         if (use_lighting > 0) {                                            \
k3d/share/shaders/k3d_smoke2.sl:56:         if (use_noise != 0) {                                              \
k3d/share/shaders/k3d_smoke2.sl:57:             Psmoke = PP*freq;                                              \
k3d/share/shaders/k3d_smoke2.sl:59:             /* Optimize: one octave only if not lit */                     \
k3d/share/shaders/k3d_smoke2.sl:60:	     if (comp(li,0)+comp(li,1)+comp(li,2) > 0.01) {                 \
k3d/share/shaders/k3d_smoke2.sl:61:                 f=1;                                                       \
k3d/share/shaders/k3d_smoke2.sl:62:                 for (i=1;  i<octaves;  i+=1) {                             \
k3d/share/shaders/k3d_smoke2.sl:63:                      f *= 0.5;  Psmoke *= 2;                               \
k3d/share/shaders/k3d_smoke2.sl:64:                      smoke += f*snoise(Psmoke);                            \
k3d/share/shaders/k3d_smoke2.sl:77:k3d_smoke2 (float density = 60;
k3d/share/shaders/k3d_smoke2.sl:78:	    float integstart = 0, integend = 100;
k3d/share/shaders/k3d_smoke2.sl:79:	    float stepsize = 0.1;
k3d/share/shaders/k3d_smoke2.sl:80:	    float debug = 0;
k3d/share/shaders/k3d_smoke2.sl:81:	    float use_lighting = 1;
k3d/share/shaders/k3d_smoke2.sl:82:	    float use_noise = 1;
k3d/share/shaders/k3d_smoke2.sl:83:	    color scatter = 1;   /* for sky, try (1, 2.25, 21) */
k3d/share/shaders/k3d_smoke2.sl:84:	    float octaves = 3, freq = 1, smokevary = 1;
k3d/share/shaders/k3d_smoke2.sl:85:	    float lightscale = 15;
k3d/share/shaders/k3d_smoke2.sl:88:#ifdef BMRT
k3d/share/shaders/k3d_smoke2.sl:90:  point incident = vtransform ("shader", -I);
k3d/share/shaders/k3d_smoke2.sl:91:#else  /* PRMan and BMRT have I reverse of each other, conflict in spec */
k3d/share/shaders/k3d_smoke2.sl:93:  point incident = vtransform ("shader", I);
k3d/share/shaders/k3d_smoke2.sl:94:#endif
k3d/share/shaders/k3d_smoke2.sl:95:  point origin = transform ("shader", Worigin);
k3d/share/shaders/k3d_smoke2.sl:97:  float d, sigma, tau;
k3d/share/shaders/k3d_smoke2.sl:98:  color Cv = 0, Ov = 0;           /* net color & opacity of volume */
k3d/share/shaders/k3d_smoke2.sl:99:  color dC, dO;                   /* differential color & opacity */
k3d/share/shaders/k3d_smoke2.sl:100:  float ss, dtau, last_dtau, end;
k3d/share/shaders/k3d_smoke2.sl:101:  float nsteps = 0;          /* record number of integration steps */
k3d/share/shaders/k3d_smoke2.sl:105:  float f, i, smoke;
k3d/share/shaders/k3d_smoke2.sl:109:  /* Integrate forwards from the start point */
k3d/share/shaders/k3d_smoke2.sl:111:  if (d < end) {
k3d/share/shaders/k3d_smoke2.sl:113:      WIN = vtransform ("shader", "current", IN);
k3d/share/shaders/k3d_smoke2.sl:127:	  /* Our goal now is to find dC and dO, the color and opacity
k3d/share/shaders/k3d_smoke2.sl:128:	   * of the portion of the volume covered by this step.
k3d/share/shaders/k3d_smoke2.sl:137:	  /* Now we adjust Cv/Ov to account for dC and dO */
k3d/share/shaders/k3d_smoke2.sl:147:  /* Ci & Oi are the color (premultiplied by opacity) and opacity of 
k3d/share/shaders/k3d_smoke2.sl:149:   * Now Cv is the light contributed by the volume itself, and Ov is the
k3d/share/shaders/k3d_smoke2.sl:150:   * opacity of the volume, i.e. (1-Ov)*Ci is the light from the background
k3d/share/shaders/k3d_smoke2.sl:156:  if (debug > 0) {
k3d/share/shaders/k3d_smoke2.sl:157:      printf ("nsteps = %f, t1 = %f, end = %f\n", nsteps, integstart, end);
k3d/share/shaders/k3d_smoke2.sl:158:      printf ("   Cv = %c, Ov = %c\n", Cv, Ov);
k3d/share/shaders/k3d_softboxes.sl:14:** $Id: k3d_softboxes.sl,v 1.1 2004/05/19 18:15:20 tshead Exp $
k3d/share/shaders/k3d_softboxes.sl:16:** Derived from softbox3 v1.2 - Author Bjorke for all
k3d/share/shaders/k3d_softboxes.sl:18:** Full RCS log in .slm4 file
k3d/share/shaders/k3d_softboxes.sl:23:#define BOOL float
k3d/share/shaders/k3d_softboxes.sl:24:#define ENUM float
k3d/share/shaders/k3d_softboxes.sl:26:#define SHAD_BOX_FILT 0
k3d/share/shaders/k3d_softboxes.sl:27:#define SHAD_GAUSSIAN_FILT 1
k3d/share/shaders/k3d_softboxes.sl:29:#define TEX_GAUSSIAN_FILT 0
k3d/share/shaders/k3d_softboxes.sl:30:#define TEX_BOX_FILT 1
k3d/share/shaders/k3d_softboxes.sl:31:#define TEX_RADIAL_FILT 2
k3d/share/shaders/k3d_softboxes.sl:32:#define TEX_DISK_FILT 3
k3d/share/shaders/k3d_softboxes.sl:34:#define HALFSIZE
k3d/share/shaders/k3d_softboxes.sl:36:#define OBEY_THIS "Reflectivity"
k3d/share/shaders/k3d_softboxes.sl:38:#define CLASSIC 0
k3d/share/shaders/k3d_softboxes.sl:39:#define SPHERICAL 1
k3d/share/shaders/k3d_softboxes.sl:41:#define CUBEFACE 0
k3d/share/shaders/k3d_softboxes.sl:42:#define LATLONG 1
k3d/share/shaders/k3d_softboxes.sl:47:/* Superellipse soft clipping - straight out of "uberlight"		***/
k3d/share/shaders/k3d_softboxes.sl:50:/*   - the equations of two superellipses (with major/minor axes given	***/
k3d/share/shaders/k3d_softboxes.sl:51:/*      by  a,b and A,B for the inner and outer ellipses, respectively)	***/
k3d/share/shaders/k3d_softboxes.sl:53:/*   - 0 if Q was inside the inner ellipse				***/
k3d/share/shaders/k3d_softboxes.sl:54:/*   - 1 if Q was outside the outer ellipse				***/
k3d/share/shaders/k3d_softboxes.sl:55:/*   - smoothly varying from 0 to 1 in between				***/
k3d/share/shaders/k3d_softboxes.sl:58:/* this is the identical function used by sqLight etc */
k3d/share/shaders/k3d_softboxes.sl:60:float clipSuperellipse (
k3d/share/shaders/k3d_softboxes.sl:62:    uniform float a, b;       /* Inner superellipse */
k3d/share/shaders/k3d_softboxes.sl:63:    uniform float A, B;       /* Outer superellipse */
k3d/share/shaders/k3d_softboxes.sl:64:    uniform float roundness;  /* Same roundness for both ellipses */
k3d/share/shaders/k3d_softboxes.sl:66:    varying float result;
k3d/share/shaders/k3d_softboxes.sl:67:    varying float x = abs(xcomp(Q)), y = abs(ycomp(Q));
k3d/share/shaders/k3d_softboxes.sl:68:    if (roundness < 1.0e-6) {
k3d/share/shaders/k3d_softboxes.sl:69:	/* Simpler case of a square */
k3d/share/shaders/k3d_softboxes.sl:72:	/* more-difficult rounded corner case */
k3d/share/shaders/k3d_softboxes.sl:73:	varying float re = 2/roundness;		/* roundness exponent */
k3d/share/shaders/k3d_softboxes.sl:74:	varying float q = a * b * pow (pow(b*x, re) + pow(a*y, re), -1/re);
k3d/share/shaders/k3d_softboxes.sl:75:	varying float r = A * B * pow (pow(B*x, re) + pow(A*y, re), -1/re);
k3d/share/shaders/k3d_softboxes.sl:82:/*** Given info on a softbox, ************************************/
k3d/share/shaders/k3d_softboxes.sl:85:void softbox_contrib2(
k3d/share/shaders/k3d_softboxes.sl:86:    varying point	surfPt;
k3d/share/shaders/k3d_softboxes.sl:87:    varying vector	reflVect;
k3d/share/shaders/k3d_softboxes.sl:88:    uniform string	boxCoords;
k3d/share/shaders/k3d_softboxes.sl:89:    uniform string	boxTexture;
k3d/share/shaders/k3d_softboxes.sl:90:    uniform float	boxTexStr,
k3d/share/shaders/k3d_softboxes.sl:98:    uniform color	boxColor,
k3d/share/shaders/k3d_softboxes.sl:100:    uniform float	decayExp;
k3d/share/shaders/k3d_softboxes.sl:101:    output float theDist;
k3d/share/shaders/k3d_softboxes.sl:105:    uniform string filtTypes[4] = {"gaussian","box","radial-bspline","disk"};
k3d/share/shaders/k3d_softboxes.sl:106:    uniform string theFilterName = filtTypes[clamp(boxFilter,0,3)];
k3d/share/shaders/k3d_softboxes.sl:107:    varying float contrib;
k3d/share/shaders/k3d_softboxes.sl:109:    varying float ot = 1; 
k3d/share/shaders/k3d_softboxes.sl:110:    /* Get the surface position */
k3d/share/shaders/k3d_softboxes.sl:111:    varying point Pb1 = transform (boxCoords, surfPt);
k3d/share/shaders/k3d_softboxes.sl:112:    varying vector Vlight = vtransform (boxCoords, reflVect);
k3d/share/shaders/k3d_softboxes.sl:113:    varying float zv = zcomp(Vlight);
k3d/share/shaders/k3d_softboxes.sl:115:#ifdef HALFSIZE
k3d/share/shaders/k3d_softboxes.sl:116:    uniform float bw2 = boxWidth/2;
k3d/share/shaders/k3d_softboxes.sl:117:    uniform float bh2 = boxHeight/2;
k3d/share/shaders/k3d_softboxes.sl:119:#define bw2 boxWidth
k3d/share/shaders/k3d_softboxes.sl:120:#define bh2 boxHeight
k3d/share/shaders/k3d_softboxes.sl:121:#endif
k3d/share/shaders/k3d_softboxes.sl:122:    uniform float we = max(boxWEdge,-bw2);
k3d/share/shaders/k3d_softboxes.sl:123:    uniform float he = max(boxHEdge,-bh2);
k3d/share/shaders/k3d_softboxes.sl:124:    uniform float bW = bw2+we;
k3d/share/shaders/k3d_softboxes.sl:125:    uniform float bH = bh2+he;
k3d/share/shaders/k3d_softboxes.sl:126:    uniform float iW = min(bW,bw2);
k3d/share/shaders/k3d_softboxes.sl:127:    uniform float iH = min(bH,bh2);
k3d/share/shaders/k3d_softboxes.sl:128:    uniform float oW = max(bW,bw2);
k3d/share/shaders/k3d_softboxes.sl:129:    uniform float oH = max(bH,bh2);
k3d/share/shaders/k3d_softboxes.sl:130:    if (sign(zcomp(Pb1)) == sign(zcomp(Vlight))) {
k3d/share/shaders/k3d_softboxes.sl:132:    } else if (abs(zv) < 0.0001) {
k3d/share/shaders/k3d_softboxes.sl:136:	if (boxTexture != "") {
k3d/share/shaders/k3d_softboxes.sl:137:	    uniform float nChans;
k3d/share/shaders/k3d_softboxes.sl:138:	    textureinfo(boxTexture,"channels",nChans);
k3d/share/shaders/k3d_softboxes.sl:139:	    varying float theS = (oW+xcomp(Pplane))/(oW*2);
k3d/share/shaders/k3d_softboxes.sl:140:	    varying float theT = (oH-ycomp(Pplane))/(oH*2);
k3d/share/shaders/k3d_softboxes.sl:143:	    if (nChans>1) {
k3d/share/shaders/k3d_softboxes.sl:145:			    "filter",	theFilterName,
k3d/share/shaders/k3d_softboxes.sl:147:		if (boxTexStr != 1) {
k3d/share/shaders/k3d_softboxes.sl:151:	    if ((nChans==1)||(nChans>3)) {
k3d/share/shaders/k3d_softboxes.sl:152:		uniform float alphaChan;
k3d/share/shaders/k3d_softboxes.sl:153:		if (nChans==1) {
k3d/share/shaders/k3d_softboxes.sl:158:		ot = float texture(boxTexture[alphaChan],theS,theT,
k3d/share/shaders/k3d_softboxes.sl:159:			    "filter",	theFilterName,
k3d/share/shaders/k3d_softboxes.sl:165:    varying point ppC = transform(boxCoords,"world",Pplane);
k3d/share/shaders/k3d_softboxes.sl:166:    varying point spw = transform("world",surfPt);
k3d/share/shaders/k3d_softboxes.sl:167:    varying float pDist = length(ppC - spw); /* in "world" coords */
k3d/share/shaders/k3d_softboxes.sl:177:float sbShadow(
k3d/share/shaders/k3d_softboxes.sl:178:    uniform string	theName;
k3d/share/shaders/k3d_softboxes.sl:180:    uniform ENUM	theFilt;
k3d/share/shaders/k3d_softboxes.sl:181:    uniform float	theBlur,
k3d/share/shaders/k3d_softboxes.sl:185:    uniform string filtTypes[2] = {"box", "gaussian"};
k3d/share/shaders/k3d_softboxes.sl:186:    uniform string theFilterName = filtTypes[clamp(theFilt,0,1)];
k3d/share/shaders/k3d_softboxes.sl:187:    varying float inShadow = shadow (theName,
k3d/share/shaders/k3d_softboxes.sl:189:			    "filter",	theFilterName,
k3d/share/shaders/k3d_softboxes.sl:200:light k3d_softboxes(
k3d/share/shaders/k3d_softboxes.sl:202:#ifdef BMRT
k3d/share/shaders/k3d_softboxes.sl:205:#else /* !BMRT -- slc compiler doesn't like these definitions */
k3d/share/shaders/k3d_softboxes.sl:208:#endif /* BMRT */
k3d/share/shaders/k3d_softboxes.sl:209:    float	intensity	= 1;
k3d/share/shaders/k3d_softboxes.sl:211:    float	decayRate	= 0;
k3d/share/shaders/k3d_softboxes.sl:212:    float	meterDistance = 1;
k3d/share/shaders/k3d_softboxes.sl:214:    float	edgeRolloff = 0,
k3d/share/shaders/k3d_softboxes.sl:220:    float	boxWidth1	= 1,
k3d/share/shaders/k3d_softboxes.sl:226:    float	boxFilter1	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:232:    float	boxWidth2	= 1,
k3d/share/shaders/k3d_softboxes.sl:238:    float	boxFilter2	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:244:    float	boxWidth3	= 1,
k3d/share/shaders/k3d_softboxes.sl:250:    float	boxFilter3	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:256:    float	boxWidth4	= 1,
k3d/share/shaders/k3d_softboxes.sl:262:    float	boxFilter4	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:265:    uniform string	envTexName = "";
k3d/share/shaders/k3d_softboxes.sl:266:    uniform float	EnvType = CLASSIC;
k3d/share/shaders/k3d_softboxes.sl:267:    uniform float	MapType = CUBEFACE;
k3d/share/shaders/k3d_softboxes.sl:268:    uniform float envTexIntensity	= 1;
k3d/share/shaders/k3d_softboxes.sl:269:    uniform float envTexBlur	= 0;
k3d/share/shaders/k3d_softboxes.sl:270:    uniform float envTexStr	= 1;
k3d/share/shaders/k3d_softboxes.sl:271:    uniform float envTexFilter	= 0;
k3d/share/shaders/k3d_softboxes.sl:272:    uniform string envReflSpace	= "";
k3d/share/shaders/k3d_softboxes.sl:274:    float shadowintensity = 1;
k3d/share/shaders/k3d_softboxes.sl:276:    ENUM	shadowfilt = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:277:    float   shadowblur = 0.01,
k3d/share/shaders/k3d_softboxes.sl:281:    ENUM	shadowfiltb = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:282:    float   shadowblurb = 0.01,
k3d/share/shaders/k3d_softboxes.sl:286:    ENUM	shadowfiltc = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:287:    float   shadowblurc = 0.01,
k3d/share/shaders/k3d_softboxes.sl:291:    ENUM	shadowfiltd = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:292:    float   shadowblurd = 0.01,
k3d/share/shaders/k3d_softboxes.sl:295:    BOOL	NonDiffuse	= 1;
k3d/share/shaders/k3d_softboxes.sl:299:    output varying float __nondiffuse = 1;
k3d/share/shaders/k3d_softboxes.sl:300:    output varying float __nonspecular = 0;
k3d/share/shaders/k3d_softboxes.sl:301:    string	__category = "reflection";
k3d/share/shaders/k3d_softboxes.sl:302:    output varying float __inShadow = 0;	   
k3d/share/shaders/k3d_softboxes.sl:304:    uniform string rcsInfo = "$Id: k3d_softboxes.sl,v 1.1 2004/05/19 18:15:20 tshead Exp $";
k3d/share/shaders/k3d_softboxes.sl:305:    uniform string filtTypes[4] = {"gaussian","box","radial-bspline","disk"};
k3d/share/shaders/k3d_softboxes.sl:306:    uniform string theFilterName = filtTypes[clamp(envTexFilter,0,3)];
k3d/share/shaders/k3d_softboxes.sl:307:    normal Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_softboxes.sl:308:    vector rv = reflect(I,Nf);
k3d/share/shaders/k3d_softboxes.sl:309:    uniform float edgeLimVal = cos(radians(90-clamp(edgeAngle,0,90)));
k3d/share/shaders/k3d_softboxes.sl:310:    uniform string theEnvSpace;
k3d/share/shaders/k3d_softboxes.sl:311:    if (envReflSpace == "") {
k3d/share/shaders/k3d_softboxes.sl:314:	theEnvSpace = envReflSpace;
k3d/share/shaders/k3d_softboxes.sl:316:    uniform float adjMeterDistance;
k3d/share/shaders/k3d_softboxes.sl:317:    if (meterSpace == "") {
k3d/share/shaders/k3d_softboxes.sl:320:	uniform point metP = transform(meterSpace,"shader",point (0,0,0));
k3d/share/shaders/k3d_softboxes.sl:323:    uniform float adjIntensity = pow(adjMeterDistance,decayRate)*intensity;
k3d/share/shaders/k3d_softboxes.sl:324:    varying float fullShad = 0;
k3d/share/shaders/k3d_softboxes.sl:325:    uniform float materiaRefl = 1;
k3d/share/shaders/k3d_softboxes.sl:326:    uniform float materiaBlur = 0;
k3d/share/shaders/k3d_softboxes.sl:329:    __nondiffuse = NonDiffuse;
k3d/share/shaders/k3d_softboxes.sl:331:    if (ObeyMateria > 0) {
k3d/share/shaders/k3d_softboxes.sl:332:	if (surface("Reflectivity",materiaRefl) == 0) {
k3d/share/shaders/k3d_softboxes.sl:333:	    if (surface("abReflectivity",materiaRefl) == 0) {
k3d/share/shaders/k3d_softboxes.sl:334:		if (surface("reflectivity",materiaRefl) == 0) {
k3d/share/shaders/k3d_softboxes.sl:335:		    if (surface("Kr",materiaRefl) == 0) {
k3d/share/shaders/k3d_softboxes.sl:336:			materiaRefl = 0;
k3d/share/shaders/k3d_softboxes.sl:342:    if (UseMateriaBlur > 0) {
k3d/share/shaders/k3d_softboxes.sl:343:	if (surface("ReflectionMapBlur",materiaBlur) == 0) {
k3d/share/shaders/k3d_softboxes.sl:344:	    if (surface("abReflectionMapBlur",materiaBlur) == 0) {
k3d/share/shaders/k3d_softboxes.sl:345:		if (surface("reflectionMapBlur",materiaBlur) == 0) {
k3d/share/shaders/k3d_softboxes.sl:352:	if (materiaRefl != 0) {
k3d/share/shaders/k3d_softboxes.sl:353:	    uniform float boxCt=0;
k3d/share/shaders/k3d_softboxes.sl:354:	    varying float thisDist;
k3d/share/shaders/k3d_softboxes.sl:357:	    varying float sortedDist[4];
k3d/share/shaders/k3d_softboxes.sl:360:	    if (boxCoord1 != "") {
k3d/share/shaders/k3d_softboxes.sl:361:	    softbox_contrib2(Ps,rv,
k3d/share/shaders/k3d_softboxes.sl:372:	    if (boxCoord2 != "") {
k3d/share/shaders/k3d_softboxes.sl:373:	    softbox_contrib2(Ps,rv,
k3d/share/shaders/k3d_softboxes.sl:384:	    if (boxCoord3 != "") {
k3d/share/shaders/k3d_softboxes.sl:385:	    softbox_contrib2(Ps,rv,
k3d/share/shaders/k3d_softboxes.sl:396:	    if (boxCoord4 != "") {
k3d/share/shaders/k3d_softboxes.sl:397:	    softbox_contrib2(Ps,rv,
k3d/share/shaders/k3d_softboxes.sl:408:	    if (envTexName != "") {
k3d/share/shaders/k3d_softboxes.sl:410:		varying vector Rs = normalize (vtransform (theEnvSpace, normalize(-L)));
k3d/share/shaders/k3d_softboxes.sl:411:		if (EnvType == SPHERICAL) {
k3d/share/shaders/k3d_softboxes.sl:413:		    varying point PShd = transform (theEnvSpace, Ps);
k3d/share/shaders/k3d_softboxes.sl:414:		    varying float pl = vector(PShd).vector(PShd);
k3d/share/shaders/k3d_softboxes.sl:415:		    varying float pdotv = -vector(PShd).Rs;
k3d/share/shaders/k3d_softboxes.sl:418:		if( MapType == LATLONG ) {	/* latlong */
k3d/share/shaders/k3d_softboxes.sl:422:					    "filter", theFilterName,
k3d/share/shaders/k3d_softboxes.sl:424:		if (envTexStr != 1) {
k3d/share/shaders/k3d_softboxes.sl:429:	    if (boxCt > 0) {
k3d/share/shaders/k3d_softboxes.sl:430:		uniform float i, j, k;
k3d/share/shaders/k3d_softboxes.sl:431:		for(k=0; k<(boxCt-1); k+=1) {
k3d/share/shaders/k3d_softboxes.sl:433:		    for(i=1; i<boxCt; i+=1) {
k3d/share/shaders/k3d_softboxes.sl:434:			if (sortedDist[i]>sortedDist[j]) { /* farthest first */
k3d/share/shaders/k3d_softboxes.sl:449:		for(k=0; k<boxCt; k+=1) {
k3d/share/shaders/k3d_softboxes.sl:458:	    float theDot = Ln.Nn;
k3d/share/shaders/k3d_softboxes.sl:459:	    if (edgeRolloff > 0) {
k3d/share/shaders/k3d_softboxes.sl:460:		float q;
k3d/share/shaders/k3d_softboxes.sl:462:		q = 1 - clamp(edgeRolloff*pow(clamp(abs(q),0,1),1/max(edgeExp,0.001)),0,1);
k3d/share/shaders/k3d_softboxes.sl:465:	    varying float shadowed;
k3d/share/shaders/k3d_softboxes.sl:466:	    if (shadowname != "") {
k3d/share/shaders/k3d_softboxes.sl:467:	    shadowed = sbShadow(shadowname,Ps,shadowfilt,
k3d/share/shaders/k3d_softboxes.sl:469:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:471:	    if (shadownameb != "") {
k3d/share/shaders/k3d_softboxes.sl:472:	    shadowed = sbShadow(shadownameb,Ps,shadowfiltb,
k3d/share/shaders/k3d_softboxes.sl:474:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:476:	    if (shadownamec != "") {
k3d/share/shaders/k3d_softboxes.sl:477:	    shadowed = sbShadow(shadownamec,Ps,shadowfiltc,
k3d/share/shaders/k3d_softboxes.sl:479:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:481:	    if (shadownamed != "") {
k3d/share/shaders/k3d_softboxes.sl:482:	    shadowed = sbShadow(shadownamed,Ps,shadowfiltd,
k3d/share/shaders/k3d_softboxes.sl:484:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:486:	    __inShadow = fullShad; 
k3d/share/shaders/k3d_softboxes.sl:489:    if (materiaRefl > 0) {
k3d/share/shaders/k3d_softboxes.sl:490:	Cl *= (lightcolor * adjIntensity * materiaRefl);
k3d/share/shaders/k3d_softboxes.sl:491:	Cl = mix(Cl, (shadowcolor*shadowintensity*adjIntensity), fullShad);
k3d/share/shaders/k3d_softboxes.sl:498:/***************************************** eof ***/
k3d/share/shaders/k3d_spacecloud.sl:2: * TLSpaceCloud.sl - perform turbulence function to add more dimension to
k3d/share/shaders/k3d_spacecloud.sl:7: *   Uses a pulse function to tapper off the edges of the texture
k3d/share/shaders/k3d_spacecloud.sl:11: *   startPulse -- start of pulse function.
k3d/share/shaders/k3d_spacecloud.sl:12: *   endPulse -- end of pulse function
k3d/share/shaders/k3d_spacecloud.sl:13: *   fuzz -- amount to blur the edges of the pulse
k3d/share/shaders/k3d_spacecloud.sl:14: *   minAdjust -- amount that can be subtracted from value
k3d/share/shaders/k3d_spacecloud.sl:16: *   maxOpacity -- maximin opacity for the surface
k3d/share/shaders/k3d_spacecloud.sl:28: *  tal 2/23/97 -- Originally tried using fBm to create turbulence.  But
k3d/share/shaders/k3d_spacecloud.sl:33:#define  MINFREQ 1.1
k3d/share/shaders/k3d_spacecloud.sl:34:#define MAXFREQ 6
k3d/share/shaders/k3d_spacecloud.sl:36:#define snoise(x) (2 * noise(x) - 1)
k3d/share/shaders/k3d_spacecloud.sl:37:#define snoise2(x, y) (2 * noise(x, y) - 1)
k3d/share/shaders/k3d_spacecloud.sl:39:#define adjustNoise2(x, y, minVal, maxVal) \
k3d/share/shaders/k3d_spacecloud.sl:42:/* separate fuzzes */
k3d/share/shaders/k3d_spacecloud.sl:43:#define smoothPulse2Fuzz(a, b, afuzz, bfuzz, loc) \
k3d/share/shaders/k3d_spacecloud.sl:44:  (smoothstep (a-afuzz, a, loc) - \
k3d/share/shaders/k3d_spacecloud.sl:45:   smoothstep (b, b+bfuzz, loc) )
k3d/share/shaders/k3d_spacecloud.sl:47:surface k3d_spacecloud(
k3d/share/shaders/k3d_spacecloud.sl:49:  float startPulse = .2; /* .1 .2 .3 .01 */
k3d/share/shaders/k3d_spacecloud.sl:50:  float endPulse = .9; /* .9 .8 .7 .8 */
k3d/share/shaders/k3d_spacecloud.sl:51:  float afuzz = .1;
k3d/share/shaders/k3d_spacecloud.sl:52:  float bfuzz = .2;
k3d/share/shaders/k3d_spacecloud.sl:53:  float minAdjust = -.4;
k3d/share/shaders/k3d_spacecloud.sl:54:  float maxAdjust = .4;
k3d/share/shaders/k3d_spacecloud.sl:55:  float maxOpacity = .4;
k3d/share/shaders/k3d_spacecloud.sl:58:  float value = 0;
k3d/share/shaders/k3d_spacecloud.sl:59:  float f;
k3d/share/shaders/k3d_spacecloud.sl:62:  float freq, i, size;
k3d/share/shaders/k3d_spacecloud.sl:63:  float adjust;
k3d/share/shaders/k3d_spacecloud.sl:64:  float ss, tt;
k3d/share/shaders/k3d_spacecloud.sl:67:  if (txtFile != "")
k3d/share/shaders/k3d_spacecloud.sl:72:	PP = transform ("object", P);
k3d/share/shaders/k3d_spacecloud.sl:73:  /* fractalsum */
k3d/share/shaders/k3d_spacecloud.sl:74:  for (f = MINFREQ; f < MAXFREQ; f += 1)
k3d/share/shaders/k3d_spacecloud.sl:75:    value += abs(snoise (PP * f))/f;
k3d/share/shaders/k3d_spacecloud.sl:77:#if 0
k3d/share/shaders/k3d_spacecloud.sl:78:#define  MINFREQ 1.1
k3d/share/shaders/k3d_spacecloud.sl:79:#define MAXFREQ 6
k3d/share/shaders/k3d_spacecloud.sl:82:	fBm (P, noiseScale, octaves, PP, freq, i, size, adjust);
k3d/share/shaders/k3d_spacecloud.sl:83:	/*printf ("%.3f %.3f: adjust %.3f\n", s, t, adjust);*/
k3d/share/shaders/k3d_spacecloud.sl:89:	/* printf ("%.3f %.3f: %.3f %.3f\n", s, t, ss-s, tt-t); */
k3d/share/shaders/k3d_spacecloud.sl:91:#endif
k3d/share/shaders/k3d_spacecloud.sl:92:	Oi = value * smoothPulse2Fuzz (startPulse, endPulse, afuzz, afuzz, ss) * 
k3d/share/shaders/k3d_spacecloud.sl:93:		smoothPulse2Fuzz (startPulse, endPulse, bfuzz, afuzz, tt);
k3d/share/shaders/k3d_spaceshiphull1.sl:1:#define snoise(x) (2 * noise(x) - 1)
k3d/share/shaders/k3d_spaceshiphull1.sl:4:float fractalsum(point Q)
k3d/share/shaders/k3d_spaceshiphull1.sl:6:	float f;
k3d/share/shaders/k3d_spaceshiphull1.sl:7:	float value = 0;
k3d/share/shaders/k3d_spaceshiphull1.sl:9:	for(f = 1; f < 8; f *= 2)
k3d/share/shaders/k3d_spaceshiphull1.sl:10:		value += snoise(Q * f) / f;
k3d/share/shaders/k3d_spaceshiphull1.sl:17:surface k3d_spaceshiphull1(
k3d/share/shaders/k3d_spaceshiphull1.sl:18:	float Ka = 1;
k3d/share/shaders/k3d_spaceshiphull1.sl:19:	float Kd = 1;
k3d/share/shaders/k3d_spaceshiphull1.sl:20:	float Ks = 0.25;
k3d/share/shaders/k3d_spaceshiphull1.sl:21:	float roughness = 0.8; color specularcolor = 1;
k3d/share/shaders/k3d_spaceshiphull1.sl:22:	float width = .1; float height = .06;
k3d/share/shaders/k3d_spaceshiphull1.sl:23:	float lumavary = .4;
k3d/share/shaders/k3d_spaceshiphull1.sl:24:	float rowvary = 3.0;
k3d/share/shaders/k3d_spaceshiphull1.sl:25:	float grime = 0.1)
k3d/share/shaders/k3d_spaceshiphull1.sl:27:  float ss, tt, splate, tplate, platespecular;
k3d/share/shaders/k3d_spaceshiphull1.sl:29:  point Nf;
k3d/share/shaders/k3d_spaceshiphull1.sl:36:  tplate = floor(tt);
k3d/share/shaders/k3d_spaceshiphull1.sl:39:  splate = floor(ss);
k3d/share/shaders/k3d_spaceshiphull1.sl:42:  platecolor = Cs - (lumavary * float noise(splate + 0.4, tplate + 0.5));
k3d/share/shaders/k3d_spaceshiphull1.sl:45:  platecolor -= grime * fractalsum(P);
k3d/share/shaders/k3d_spaceshiphull1.sl:50:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_spaceshiphull1.sl:53:  Ci = Os * platecolor * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * platespecular * specular(Nf, V, roughness);
k3d/share/shaders/k3d_spotlight.sl:1:/* spotlight.sl - Standard spot light source for RenderMan Interface.
k3d/share/shaders/k3d_spotlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_spotlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_spotlight.sl:9:light k3d_spotlight(float intensity = 1;
k3d/share/shaders/k3d_spotlight.sl:11:		    point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_spotlight.sl:13:		    float coneangle = radians(30);
k3d/share/shaders/k3d_spotlight.sl:14:		    float conedeltaangle = radians(5);
k3d/share/shaders/k3d_spotlight.sl:15:		    float beamdistribution = 2;)
k3d/share/shaders/k3d_spotlight.sl:17:  float atten, cosangle;
k3d/share/shaders/k3d_spotlight.sl:18:  uniform vector A = normalize(to - from);
k3d/share/shaders/k3d_spotlight.sl:20:  illuminate(from, A, coneangle)
k3d/share/shaders/k3d_square_ridges.sl:6:// This program is free software; you can redistribute it and/or
k3d/share/shaders/k3d_square_ridges.sl:7:// modify it under the terms of the GNU General Public
k3d/share/shaders/k3d_square_ridges.sl:8:// License as published by the Free Software Foundation; either
k3d/share/shaders/k3d_square_ridges.sl:9:// version 2 of the License, or (at your option) any later version.
k3d/share/shaders/k3d_square_ridges.sl:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_square_ridges.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_square_ridges.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_square_ridges.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_square_ridges.sl:17:// License along with this program; if not, write to the Free Software
k3d/share/shaders/k3d_square_ridges.sl:20:/** \file
k3d/share/shaders/k3d_square_ridges.sl:24:/// Filtering code courtesy of the Advanced RenderMan book ... where else?
k3d/share/shaders/k3d_square_ridges.sl:26:#define MIN_FILTER_WIDTH 1.0e-6
k3d/share/shaders/k3d_square_ridges.sl:27:#define filter_width(x) max(abs(Du(x)*du) + abs(Dv(x)*dv), MIN_FILTER_WIDTH)
k3d/share/shaders/k3d_square_ridges.sl:30:float pulse(float edge0, edge1, x)
k3d/share/shaders/k3d_square_ridges.sl:35:float pulse_train(float edge, period, x)
k3d/share/shaders/k3d_square_ridges.sl:41:float filtered_pulse_train(float edge, period, x, dx)
k3d/share/shaders/k3d_square_ridges.sl:43:	float w = dx / period;
k3d/share/shaders/k3d_square_ridges.sl:44:	float x0 = x/period - w/2;
k3d/share/shaders/k3d_square_ridges.sl:45:	float x1 = x0 + w;
k3d/share/shaders/k3d_square_ridges.sl:46:	float nedge = edge / period;
k3d/share/shaders/k3d_square_ridges.sl:48:	float integral(float t)
k3d/share/shaders/k3d_square_ridges.sl:50:		extern float nedge;
k3d/share/shaders/k3d_square_ridges.sl:51:		return ((1 - nedge) * floor(t) + max(0, t-floor(t)-nedge));
k3d/share/shaders/k3d_square_ridges.sl:58:	float Km = 1.0;
k3d/share/shaders/k3d_square_ridges.sl:59:	float Frequency = 8.0;
k3d/share/shaders/k3d_square_ridges.sl:60:	float Offset = 0.25;
k3d/share/shaders/k3d_square_ridges.sl:63:	float ridge_position = filtered_pulse_train(0.5 / Frequency, 1.0 / Frequency, t + (Offset / Frequency), filter_width(t));
k3d/share/shaders/k3d_square_ridges.sl:64://	float ridge_position = pulse_train(0.5 / Frequency, 1.0 / Frequency, u, filter_width(u));
k3d/share/shaders/k3d_square_ridges.sl:67:	P += Nn * ((Km * ridge_position) / length(vtransform("shader", Nn)));
k3d/share/shaders/k3d_srfdeformation.sl:1:/* renamed shader to SIG2k_srf_deformation to be consistent with RMR 
k3d/share/shaders/k3d_srfdeformation.sl:7:   deformation surface shader
k3d/share/shaders/k3d_srfdeformation.sl:9:   projects a texture through the camera onto the Pref
k3d/share/shaders/k3d_srfdeformation.sl:10:   object and deforms it to the P position
k3d/share/shaders/k3d_srfdeformation.sl:12:   additionally, calculates the changes to shading on the surface 
k3d/share/shaders/k3d_srfdeformation.sl:13:   measured by the change in diffuse lighting from the Pref to P.
k3d/share/shaders/k3d_srfdeformation.sl:15:   additional contrast and color controls are left as an exersize
k3d/share/shaders/k3d_srfdeformation.sl:16:   for the user.
k3d/share/shaders/k3d_srfdeformation.sl:22:fnc_mydiffuse (color Cl; 
k3d/share/shaders/k3d_srfdeformation.sl:36:fnc_projectCurrentCamera(point P;
k3d/share/shaders/k3d_srfdeformation.sl:37:			 output float X, Y;)
k3d/share/shaders/k3d_srfdeformation.sl:39:    point Pndc = transform("NDC", P);
k3d/share/shaders/k3d_srfdeformation.sl:46:surface 
k3d/share/shaders/k3d_srfdeformation.sl:47:k3d_srfdeformation(
k3d/share/shaders/k3d_srfdeformation.sl:49:    float debug = 0;            /* 0 = deformed lit image
k3d/share/shaders/k3d_srfdeformation.sl:50:				   1 = texture deformed with no lighting
k3d/share/shaders/k3d_srfdeformation.sl:51:				   2 = output lighting of the P object
k3d/share/shaders/k3d_srfdeformation.sl:52:				   3 = output lighting of the Pref object
k3d/share/shaders/k3d_srfdeformation.sl:54:    float Kd=1;                 /* Surface Kd for lighting calculations */
k3d/share/shaders/k3d_srfdeformation.sl:56:    varying point Pref = point "shader" (0,0,0);
k3d/share/shaders/k3d_srfdeformation.sl:59:    float x, y;
k3d/share/shaders/k3d_srfdeformation.sl:62:    float illum_width = 180;
k3d/share/shaders/k3d_srfdeformation.sl:64:    point Porig = Pref;
k3d/share/shaders/k3d_srfdeformation.sl:66:    fnc_projectCurrentCamera(Pref, x, y);
k3d/share/shaders/k3d_srfdeformation.sl:68:    if (texname != "") {
k3d/share/shaders/k3d_srfdeformation.sl:73:    /* Calculate shading difference between P and Porig*/
k3d/share/shaders/k3d_srfdeformation.sl:76:    N1 = faceforward(normalize(N),I);
k3d/share/shaders/k3d_srfdeformation.sl:78:    N2 = faceforward(normalize(N),I);
k3d/share/shaders/k3d_srfdeformation.sl:83:       specular or reflection maps if needed */
k3d/share/shaders/k3d_srfdeformation.sl:86:	Ci1 += Kd * fnc_mydiffuse(Cl,L,N1);
k3d/share/shaders/k3d_srfdeformation.sl:90:	Ci2 += Kd * fnc_mydiffuse(Cl,L,N2);
k3d/share/shaders/k3d_srfdeformation.sl:93:    /* Difference in lighting acts as brightness control*/
k3d/share/shaders/k3d_srfdeformation.sl:98:    if (debug == 1) {  /* output the texture - no lighting */
k3d/share/shaders/k3d_srfdeformation.sl:100:    } else if (debug == 2) { /* output texture with P's lighting */
k3d/share/shaders/k3d_srfdeformation.sl:102:    } else if (debug == 3) { /* output texture with Pref's lighting */
k3d/share/shaders/k3d_star.sl:16:surface
k3d/share/shaders/k3d_star.sl:18:    uniform float Ka = 1;
k3d/share/shaders/k3d_star.sl:19:    uniform float Kd = 1;
k3d/share/shaders/k3d_star.sl:20:    uniform color starcolor = color (1.0000,0.5161,0.0000);
k3d/share/shaders/k3d_star.sl:21:    uniform float npoints = 5;
k3d/share/shaders/k3d_star.sl:22:    uniform float sctr = 0.5;
k3d/share/shaders/k3d_star.sl:23:    uniform float tctr = 0.5;
k3d/share/shaders/k3d_star.sl:26:    point Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_star.sl:28:    float ss, tt, angle, r, a, in_out;
k3d/share/shaders/k3d_star.sl:29:    uniform float rmin = 0.07, rmax = 0.2;
k3d/share/shaders/k3d_star.sl:30:    uniform float starangle = 2*PI/npoints;
k3d/share/shaders/k3d_star.sl:31:    uniform point p0 = rmax*(cos(0),sin(0),0);
k3d/share/shaders/k3d_star.sl:32:    uniform point p1 = rmin*
k3d/share/shaders/k3d_star.sl:34:    uniform point d0 = p1 - p0;
k3d/share/shaders/k3d_star.sl:42:    if (a >= 0.5)
k3d/share/shaders/k3d_star.sl:48:    /* diffuse ("matte") shading model */
k3d/share/shaders/k3d_star.sl:50:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_starfield.sl:2:	Makes a star field.  Best when used as a surface shader for the inside	of a large sphere.
k3d/share/shaders/k3d_starfield.sl:11:surface k3d_starfield(float intensity = 2.0; float frequency = 0.1; float size = 0.3; float irregularity = 2.0)
k3d/share/shaders/k3d_starfield.sl:14:	point PP = transform("object", frequency * P);
k3d/share/shaders/k3d_starfield.sl:17:	point star_center = point(0.5 * (floor(xcomp(PP)) + ceil(xcomp(PP))), 0.5 * (floor(ycomp(PP)) + ceil(ycomp(PP))), 0.5 * (floor(zcomp(PP)) + ceil(zcomp(PP))));
k3d/share/shaders/k3d_starfield.sl:22:	float star_distance = distance(PP, star_center);
k3d/share/shaders/k3d_starfield.sl:24:	float inside_star = 1 - smoothstep(0.0, size, star_distance);
k3d/share/shaders/k3d_starfield.sl:27:	float star_intensity = float cellnoise(star_center);
k3d/share/shaders/k3d_stones.sl:8: * This software is placed in the public domain and is provided as is 
k3d/share/shaders/k3d_stones.sl:11: * Shader that creates a surface covered with stones of different sizes,
k3d/share/shaders/k3d_stones.sl:12: * trying to replicate the shader usr for the ground in "A BUGS LIFE".
k3d/share/shaders/k3d_stones.sl:15: * Feel free to use this shader to create skin for any character, anywhere and
k3d/share/shaders/k3d_stones.sl:16: * everywhere, Just list me on the credits under "Shading Team" if you use the
k3d/share/shaders/k3d_stones.sl:17: *  hader as is, or under "shader info" if you do any minor modifications to
k3d/share/shaders/k3d_stones.sl:22: * Km = amount of displacement
k3d/share/shaders/k3d_stones.sl:23: * displace = should the surface be bumped(0) or displaced (1)?
k3d/share/shaders/k3d_stones.sl:24: * minfreq & maxfreq = limits to the rock loop excecution
k3d/share/shaders/k3d_stones.sl:25: * grungefreq, grunge_Pow, grunginess = freqeuncy, power and depth of grunge
k3d/share/shaders/k3d_stones.sl:31: * modified 10/17/02 Changed algorithms arround to make it render a little faster.
k3d/share/shaders/k3d_stones.sl:39:#define repeat(x,freq)    (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_stones.sl:41:#define rotate2d(x,y,rad,ox,oy,rx,ry) \
k3d/share/shaders/k3d_stones.sl:46:#define fuzzpulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - \
k3d/share/shaders/k3d_stones.sl:47:         smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_stones.sl:49:#define snoise(x)    (noise(x) * 2 - 1)
k3d/share/shaders/k3d_stones.sl:50:#define snoise2(x,y) (noise(x,y) * 2 - 1)
k3d/share/shaders/k3d_stones.sl:51:#define whichtile(x,freq) (floor((x) * (freq)))
k3d/share/shaders/k3d_stones.sl:52:#define MINFILTERWIDTH  1e-7
k3d/share/shaders/k3d_stones.sl:53:#define filterwidth_point(p) (max(sqrt(area(p)), MINFILTERWIDTH))
k3d/share/shaders/k3d_stones.sl:54:#define udn(x,lo,hi) (smoothstep(.25, .75, noise(x)) * ((hi) - (lo)) + (lo))
k3d/share/shaders/k3d_stones.sl:61: * Original by Larry Gritz. Modified to "hsv" by Rudy Cortes
k3d/share/shaders/k3d_stones.sl:63:color varyEach (color Cin; float index, varyhue, varysat, varyval;)
k3d/share/shaders/k3d_stones.sl:66:    color Chsv = ctransform ("hsv", Cin);
k3d/share/shaders/k3d_stones.sl:67:    float h = comp(Chsv,0), s = comp(Chsv,1), v = comp(Chsv,2);
k3d/share/shaders/k3d_stones.sl:68:    /* Modify Chsv by adding Cvary scaled by our separate h,s,v controls */
k3d/share/shaders/k3d_stones.sl:73:    /* Clamp hsl and transform back to rgb space */
k3d/share/shaders/k3d_stones.sl:74:    return ctransform ("hsv", "rgb", clamp(Chsv,color 0, color 1));
k3d/share/shaders/k3d_stones.sl:82:surface k3d_stones (
k3d/share/shaders/k3d_stones.sl:83:    float Ka = .6, Kd = .85,
k3d/share/shaders/k3d_stones.sl:87:    float minfreq = 1,
k3d/share/shaders/k3d_stones.sl:88:          maxfreq = 10,
k3d/share/shaders/k3d_stones.sl:89:          tilefreq = 6,
k3d/share/shaders/k3d_stones.sl:90:          grungefreq = 30, grunge_Pow = 3, grunginess = - 0.8;
k3d/share/shaders/k3d_stones.sl:93:   float varyhue = .03, varysat = .2, varylum = .25;)
k3d/share/shaders/k3d_stones.sl:96: color surface_color, layer_color;
k3d/share/shaders/k3d_stones.sl:97: float layer_opac;
k3d/share/shaders/k3d_stones.sl:98: float ss, tt, stile,ttile;
k3d/share/shaders/k3d_stones.sl:99: float freq,mag;
k3d/share/shaders/k3d_stones.sl:100: float r,theta,angle;
k3d/share/shaders/k3d_stones.sl:101: float d,d0,d1;
k3d/share/shaders/k3d_stones.sl:102: float cx,cy;
k3d/share/shaders/k3d_stones.sl:103: float noifreq = 10, noiscale = 0.3;
k3d/share/shaders/k3d_stones.sl:104: float bub;
k3d/share/shaders/k3d_stones.sl:106: normal Nf;
k3d/share/shaders/k3d_stones.sl:107: float grunge;
k3d/share/shaders/k3d_stones.sl:109: surface_color = groundcolor;
k3d/share/shaders/k3d_stones.sl:110: float surface_mag = 0;
k3d/share/shaders/k3d_stones.sl:112: /*loop for creating color layers of rocks*/
k3d/share/shaders/k3d_stones.sl:113: for (freq = maxfreq ; freq>minfreq;freq -=0.5)
k3d/share/shaders/k3d_stones.sl:115:   angle = PI * snoise(freq * 16.31456);  /*randomize angle index*/
k3d/share/shaders/k3d_stones.sl:119:   /*repeat tiles and find out in which tile we are at?*/
k3d/share/shaders/k3d_stones.sl:120:   ss = repeat(cx,freq * tilefreq);
k3d/share/shaders/k3d_stones.sl:121:   tt = repeat(cy,freq * tilefreq);
k3d/share/shaders/k3d_stones.sl:122:   stile = whichtile(cx,freq * tilefreq);
k3d/share/shaders/k3d_stones.sl:123:   ttile = whichtile(cy,freq * tilefreq);
k3d/share/shaders/k3d_stones.sl:126:   float stoneindex = stile + 13 * ttile;
k3d/share/shaders/k3d_stones.sl:129:   bub = 0.5 + snoise2(10 * freq,10 * freq);
k3d/share/shaders/k3d_stones.sl:130:   ss += noiscale * snoise(snoise2(s * noifreq, t * noifreq) + 912);
k3d/share/shaders/k3d_stones.sl:131:   tt += noiscale * snoise(snoise2(s * noifreq, t * noifreq) + 333);
k3d/share/shaders/k3d_stones.sl:134:   cx = 0.5 + 0.1 * snoise2( freq * 8.456, freq * 18.773);
k3d/share/shaders/k3d_stones.sl:135:   cy = 0.5 + 0.1 * snoise2( freq * 28.398, freq * 42.112);
k3d/share/shaders/k3d_stones.sl:140:              ((maxfreq - freq)/maxfreq); */
k3d/share/shaders/k3d_stones.sl:141:   mag= (0.5 - abs(bub - 0.5)) * 90 *(.09 - d * d)*((maxfreq - freq)/maxfreq);
k3d/share/shaders/k3d_stones.sl:144:   /*create a diferent color for each rock*/
k3d/share/shaders/k3d_stones.sl:146:   surface_color = mix(surface_color,layer_color,layer_opac);
k3d/share/shaders/k3d_stones.sl:149:   /*calculate displacement if Km > .01*/
k3d/share/shaders/k3d_stones.sl:150:     if(Km != 0)
k3d/share/shaders/k3d_stones.sl:152:    surface_mag = max(surface_mag,mag);
k3d/share/shaders/k3d_stones.sl:156:   /*apply if grunginess != 0 */
k3d/share/shaders/k3d_stones.sl:157:   if(grunginess != 0)
k3d/share/shaders/k3d_stones.sl:159:      /* compute turbulence  for grunge*/
k3d/share/shaders/k3d_stones.sl:160:       point PP = transform("shader", P) * grungefreq;
k3d/share/shaders/k3d_stones.sl:161:       float width = filterwidth_point(PP);
k3d/share/shaders/k3d_stones.sl:162:       float cutoff = clamp(0.5 / width, 0, maxfreq);
k3d/share/shaders/k3d_stones.sl:164:        float turb = 0, f;
k3d/share/shaders/k3d_stones.sl:165:        for (f = 1; f < 0.5 * cutoff; f *= 2)
k3d/share/shaders/k3d_stones.sl:166:        turb += abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_stones.sl:167:        float fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_stones.sl:168:        turb += fade * abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_stones.sl:171:        surface_mag += grunge * grunginess;
k3d/share/shaders/k3d_stones.sl:175:  if (displace == 1)
k3d/share/shaders/k3d_stones.sl:177:  P += Km * surface_mag * normalize(N);
k3d/share/shaders/k3d_stones.sl:181:  N = normalize(calculatenormal(P + Km * surface_mag * normalize(N)));
k3d/share/shaders/k3d_stones.sl:183: /*compute normals and vectors for shading*/
k3d/share/shaders/k3d_stones.sl:184:  Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_stones.sl:190:Ci = surface_color * Oi * (Ka * ambient() + Kd * diffuse(Nf))+
k3d/share/shaders/k3d_stones.sl:191:      Ks * specular(Nf,V,roughness);
k3d/share/shaders/k3d_strata.sl:2: * strata.sl -- surface shader for sedimentary rock strata
k3d/share/shaders/k3d_strata.sl:5: *    Makes sedimentary rock strata, useful for rendering landscapes.
k3d/share/shaders/k3d_strata.sl:9: *    txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_strata.sl:10: *    zscale - scaling for the thickness of the layers
k3d/share/shaders/k3d_strata.sl:12: *    offset - z offset for the pattern
k3d/share/shaders/k3d_strata.sl:13: *    octaves - number of octaves of noise to sum for the turbulence
k3d/share/shaders/k3d_strata.sl:32: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_strata.sl:35:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_strata.sl:37:surface k3d_strata(float Ka = 0.5, Kd = 1; float txtscale = 1;
k3d/share/shaders/k3d_strata.sl:38:		   float yscale = 2; float turbscale = 0.1; float offset = 0;
k3d/share/shaders/k3d_strata.sl:39:		   float octaves = 8;
k3d/share/shaders/k3d_strata.sl:44:  float cmap;
k3d/share/shaders/k3d_strata.sl:45:  float turb, i, freq;
k3d/share/shaders/k3d_strata.sl:47:  PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_strata.sl:50:  freq = 1;
k3d/share/shaders/k3d_strata.sl:51:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_strata.sl:53:      turb += abs(snoise(PP * freq) / freq);
k3d/share/shaders/k3d_strata.sl:54:      freq *= 2;
k3d/share/shaders/k3d_strata.sl:57:  cmap = yscale * ycomp(PP) + turbscale * turb - offset;
k3d/share/shaders/k3d_strata.sl:85:    Cs * Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_stucco.sl:2: * stucco.sl -- displacement shader for stucco
k3d/share/shaders/k3d_stucco.sl:5: *   Displacees a surface to make it look like stucco.
k3d/share/shaders/k3d_stucco.sl:8: *   Km 	   	the amplitude of the stucco pimples
k3d/share/shaders/k3d_stucco.sl:9: *   power	   	controls the shape of the pimples
k3d/share/shaders/k3d_stucco.sl:10: *   frequency  	the frequency of the pimples
k3d/share/shaders/k3d_stucco.sl:17:displacement k3d_stucco(float Km = 0.05, power = 5, frequency = 10;)
k3d/share/shaders/k3d_stucco.sl:19:  float magnitude;
k3d/share/shaders/k3d_stucco.sl:22:  PP = transform("shader", P);
k3d/share/shaders/k3d_stucco.sl:23:  magnitude = Km * pow(noise(PP * frequency), power);
k3d/share/shaders/k3d_superkagee.sl:3:#define BOOL    float
k3d/share/shaders/k3d_superkagee.sl:4:#define ENUM    float
k3d/share/shaders/k3d_superkagee.sl:6:#define FILT_BOX 0
k3d/share/shaders/k3d_superkagee.sl:7:#define FILT_GAUSS 1
k3d/share/shaders/k3d_superkagee.sl:13:float do_shadow6(
k3d/share/shaders/k3d_superkagee.sl:14:    uniform string      theName;
k3d/share/shaders/k3d_superkagee.sl:16:    uniform ENUM        theFilt;
k3d/share/shaders/k3d_superkagee.sl:17:    uniform float       theBlur,
k3d/share/shaders/k3d_superkagee.sl:21:    uniform string filtTypes[2] = {"box", "gaussian"};
k3d/share/shaders/k3d_superkagee.sl:22:    uniform string theFilterName = filtTypes[clamp(theFilt,0,1)];
k3d/share/shaders/k3d_superkagee.sl:23:    float inShadow;
k3d/share/shaders/k3d_superkagee.sl:24:#define SHADPOINT thePoint
k3d/share/shaders/k3d_superkagee.sl:27:                            "filter",   theFilterName,
k3d/share/shaders/k3d_superkagee.sl:39:surface k3d_superkagee(
k3d/share/shaders/k3d_superkagee.sl:42:            ENUM        shadowfilta = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:43:            float       shadowblura = 0,
k3d/share/shaders/k3d_superkagee.sl:49:            ENUM        shadowfiltb = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:50:            float       shadowblurb = 0,
k3d/share/shaders/k3d_superkagee.sl:56:            ENUM        shadowfiltc = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:57:            float       shadowblurc = 0,
k3d/share/shaders/k3d_superkagee.sl:63:            ENUM        shadowfiltd = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:64:            float       shadowblurd = 0,
k3d/share/shaders/k3d_superkagee.sl:71:    uniform string rcsInfo =
k3d/share/shaders/k3d_superkagee.sl:73:    varying float fullShad = 0;
k3d/share/shaders/k3d_superkagee.sl:74:    varying float shadowed;
k3d/share/shaders/k3d_superkagee.sl:75:    if (shadownamea != "") {
k3d/share/shaders/k3d_superkagee.sl:78:                    shadowfilta,shadowblura,shadowsamplesa,shadowbiasa
k3d/share/shaders/k3d_superkagee.sl:81:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:82:    }if (shadownameb != "") {
k3d/share/shaders/k3d_superkagee.sl:85:                    shadowfiltb,shadowblurb,shadowsamplesb,shadowbiasb
k3d/share/shaders/k3d_superkagee.sl:88:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:89:    }if (shadownamec != "") {
k3d/share/shaders/k3d_superkagee.sl:92:                    shadowfiltc,shadowblurc,shadowsamplesc,shadowbiasc
k3d/share/shaders/k3d_superkagee.sl:95:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:96:    }if (shadownamed != "") {
k3d/share/shaders/k3d_superkagee.sl:99:                    shadowfiltd,shadowblurd,shadowsamplesd,shadowbiasd
k3d/share/shaders/k3d_superkagee.sl:102:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:105:    Ci = Oi * mix(Cs,shadColor,fullShad);
k3d/share/shaders/k3d_superplank.sl:2: * superplank.sl -- another surface shader for wood planks.
k3d/share/shaders/k3d_superplank.sl:5: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_superplank.sl:7: *   reflections (either traced or via reflection map), and bumps.
k3d/share/shaders/k3d_superplank.sl:13: *   Kr, eta - reflection amount and index of refraction (for fresnel)
k3d/share/shaders/k3d_superplank.sl:14: *   Ktrace, Krefl, reflmap - const for trace, for refl map, filename
k3d/share/shaders/k3d_superplank.sl:15: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_superplank.sl:16: *   Km - overall scaling factor for bumpiness.
k3d/share/shaders/k3d_superplank.sl:17: *   lightwood - wood-like color from which the various shades are derived.
k3d/share/shaders/k3d_superplank.sl:18: *   plankwidth - width of each plank (in terms of s/t)
k3d/share/shaders/k3d_superplank.sl:19: *   planklength - length of each plank (in terms of s/t)
k3d/share/shaders/k3d_superplank.sl:20: *   groovewidth - width of the grooves between the planks (in terms of s/t)
k3d/share/shaders/k3d_superplank.sl:21: *   groovedepth - depth of the groove indentations (in shader space units)
k3d/share/shaders/k3d_superplank.sl:22: *   groovecolor - the color of the "grooves" between the planks
k3d/share/shaders/k3d_superplank.sl:24: *   plankspertile - for parquet, number of sub-planks
k3d/share/shaders/k3d_superplank.sl:25: *   plankstagger - for staggered, how much are the rows of planks staggered
k3d/share/shaders/k3d_superplank.sl:26: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_superplank.sl:27: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_superplank.sl:28: *   ringwidth - relative width of the dark ring parts
k3d/share/shaders/k3d_superplank.sl:29: *   wavy - relative wavyness of the ring pattern
k3d/share/shaders/k3d_superplank.sl:30: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_superplank.sl:31: *   grainscale - scaling for the fine grain
k3d/share/shaders/k3d_superplank.sl:32: *   graindepth - depth of grain and ring grooves
k3d/share/shaders/k3d_superplank.sl:33: *   varnishbumpfreq - frequency of bumps in the varnish coating
k3d/share/shaders/k3d_superplank.sl:34: *   varnishbumpamp - height of bumps in the varnish coating
k3d/share/shaders/k3d_superplank.sl:36: * Antialiasing: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_superplank.sl:52:surface k3d_superplank(		/* Parameters: */
k3d/share/shaders/k3d_superplank.sl:54:			float Ka = 1, Kd = 1;	/* Overall ambient & diffuse response */
k3d/share/shaders/k3d_superplank.sl:55:			float Ks = .75, roughness = .02;	/* Spec highlight control */
k3d/share/shaders/k3d_superplank.sl:56:			color specularcolor = 1;	/* Spec reflection color */
k3d/share/shaders/k3d_superplank.sl:57:			float Kr = 1, eta = 1.5;	/* Mirror refl & index of refr */
k3d/share/shaders/k3d_superplank.sl:58:			float Ktrace = 1, Krefl = 0;	/* trace and reflection map */
k3d/share/shaders/k3d_superplank.sl:59:			string reflmap = "";
k3d/share/shaders/k3d_superplank.sl:61:			float txtscale = 1;	/* Overall scaling factor */
k3d/share/shaders/k3d_superplank.sl:62:			float Km = 1;	/* Overall bumpiness factor */
k3d/share/shaders/k3d_superplank.sl:65:			float plankpattern = 1;	/* 1=straight, 2=parquet */
k3d/share/shaders/k3d_superplank.sl:66:			float plankspertile = 4;	/* For parquet */
k3d/share/shaders/k3d_superplank.sl:67:			float plankwidth = .05;	/* Width of a plank */
k3d/share/shaders/k3d_superplank.sl:68:			float planklength = .75;	/* Length of a plank */
k3d/share/shaders/k3d_superplank.sl:69:			float groovewidth = 0.001;	/* Width of the grooves between planks */
k3d/share/shaders/k3d_superplank.sl:70:			float groovedepth = .0004;	/* Depth of the groove */
k3d/share/shaders/k3d_superplank.sl:72:			float plankstagger = 1;	/* How much should rows be staggered */
k3d/share/shaders/k3d_superplank.sl:73:			float plankvary = 0.8;	/* Wood color variation plank-to-plank */
k3d/share/shaders/k3d_superplank.sl:75:			float ringscale = 25;	/* Larger makes more, thinner rings */
k3d/share/shaders/k3d_superplank.sl:76:			float ringwidth = 1;	/* Relative ring width */
k3d/share/shaders/k3d_superplank.sl:77:			float wavy = 0.08;	/* Larger makes rings more wavy */
k3d/share/shaders/k3d_superplank.sl:78:			float grainy = 1;	/* Relative graininess */
k3d/share/shaders/k3d_superplank.sl:79:			float grainscale = 60;	/* Larger makes smaller "grains" */
k3d/share/shaders/k3d_superplank.sl:80:			float graindepth = 0.0001;	/* Depth of divots where grains are */
k3d/share/shaders/k3d_superplank.sl:81:			float varnishbumpfreq = 30;	/* Bump freq of the varnish */
k3d/share/shaders/k3d_superplank.sl:82:			float varnishbumpamp = 0.0003;	/* How big are the varnish bumps? */
k3d/share/shaders/k3d_superplank.sl:86:  float ss, tt;
k3d/share/shaders/k3d_superplank.sl:87:  float grain_s, grain_t, ring_s, ring_t, plank_s, plank_t;
k3d/share/shaders/k3d_superplank.sl:89:  float swidth, twidth, fwidth;
k3d/share/shaders/k3d_superplank.sl:90:  float sw, tw, overallscale;
k3d/share/shaders/k3d_superplank.sl:92:  uniform float PGWIDTH, PGHEIGHT, GWF, GHF;
k3d/share/shaders/k3d_superplank.sl:93:  float whichrow, whichplank;	/* Index for each row & plank within row */
k3d/share/shaders/k3d_superplank.sl:94:  float w, h;			/* temporaries */
k3d/share/shaders/k3d_superplank.sl:95:  float groovy;			/* 0 in groove, 1 in woody part */
k3d/share/shaders/k3d_superplank.sl:98:  float r2;
k3d/share/shaders/k3d_superplank.sl:99:  float fade, ttt;
k3d/share/shaders/k3d_superplank.sl:100:  float ring;			/* 1 in a ring darkening, 0 where not */
k3d/share/shaders/k3d_superplank.sl:101:  float grain;			/* 1 inside a grain bit, 0 elsewhere */
k3d/share/shaders/k3d_superplank.sl:103:  float adjustedKs;
k3d/share/shaders/k3d_superplank.sl:105:  normal NN;			/* normalized N for displacing */
k3d/share/shaders/k3d_superplank.sl:106:  normal Nf;			/* forward facing, normalized normal */
k3d/share/shaders/k3d_superplank.sl:107:  vector R, T_dummy;		/* Refl (and tummy transmit) from fresnel */
k3d/share/shaders/k3d_superplank.sl:108:  float fresnelKr, fresnelKt;	/* Fresnel reflection coefficients */
k3d/share/shaders/k3d_superplank.sl:109:  float shadlen;		/* length of a unit of shader space */
k3d/share/shaders/k3d_superplank.sl:110:  float disp;			/* accumulate displacement here */
k3d/share/shaders/k3d_superplank.sl:111:  point Pndc;			/* NDC coordinate of P */
k3d/share/shaders/k3d_superplank.sl:114:  float nonspec;
k3d/share/shaders/k3d_superplank.sl:115:  float tmp;
k3d/share/shaders/k3d_superplank.sl:120:   * Determine the basic mapping, filter sizes for antialiasing, other
k3d/share/shaders/k3d_superplank.sl:127:  /* Compute the basic filter size for antialiasing */
k3d/share/shaders/k3d_superplank.sl:128:  swidth = filterwidth(ss);
k3d/share/shaders/k3d_superplank.sl:129:  twidth = filterwidth(tt);
k3d/share/shaders/k3d_superplank.sl:130:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_superplank.sl:132:  /* How much current space corresponds to a unit of s or t?
k3d/share/shaders/k3d_superplank.sl:135:   * strictly tied to the scale of the object.
k3d/share/shaders/k3d_superplank.sl:144:   * antialiased term for whether we're in or out of a groove.
k3d/share/shaders/k3d_superplank.sl:146:  if(plankpattern == 1)
k3d/share/shaders/k3d_superplank.sl:152:      whichrow = floor(plank_s);
k3d/share/shaders/k3d_superplank.sl:155:      whichplank = floor(plank_t);
k3d/share/shaders/k3d_superplank.sl:163:      whichrow = floor(plank_s);
k3d/share/shaders/k3d_superplank.sl:165:      whichplank = floor(plank_t);
k3d/share/shaders/k3d_superplank.sl:166:      if(mod((whichrow / plankspertile) + whichplank, 2) >= 1)
k3d/share/shaders/k3d_superplank.sl:170:	  whichrow = floor(plank_s);
k3d/share/shaders/k3d_superplank.sl:171:	  whichplank = floor(plank_t);
k3d/share/shaders/k3d_superplank.sl:180:  /* Now whichplank is a unique integer index for each plank */
k3d/share/shaders/k3d_superplank.sl:184:   * antialiasing by trying to box filter the edges of the grooves.
k3d/share/shaders/k3d_superplank.sl:187:  /* compute half width & length of groove as fraction of plank size */
k3d/share/shaders/k3d_superplank.sl:192:  if(sw >= 1)
k3d/share/shaders/k3d_superplank.sl:193:    w = 1 - 2 * GWF;		/* Filter width is wider than the plank itself */
k3d/share/shaders/k3d_superplank.sl:195:    w = filteredpulse(whichrow + GWF, whichrow + 1 - GWF, plank_s, sw);
k3d/share/shaders/k3d_superplank.sl:196:  if(tw >= 1)
k3d/share/shaders/k3d_superplank.sl:197:    h = 1 - 2 * GHF;		/* Filter width is longer than the plank itself */
k3d/share/shaders/k3d_superplank.sl:199:    h = filteredpulse(whichplank + GHF, whichplank + 1 - GHF, plank_t, tw);
k3d/share/shaders/k3d_superplank.sl:205:   * The wood has rings at one scale, grain at a finer scale.  They
k3d/share/shaders/k3d_superplank.sl:209:  /* Compute the filter width first, so we don't bother with more if
k3d/share/shaders/k3d_superplank.sl:212:  fwidth = max(swidth * ringscale, twidth * ringscale);
k3d/share/shaders/k3d_superplank.sl:213:  fade = smoothstep(.75, 4, fwidth);
k3d/share/shaders/k3d_superplank.sl:214:  if(fade < 0.999)
k3d/share/shaders/k3d_superplank.sl:220:      ring -= floor(ring);
k3d/share/shaders/k3d_superplank.sl:224:      ring = (1 - fade) * ring + 0.65 * fade;
k3d/share/shaders/k3d_superplank.sl:227:      fwidth = max(swidth * grainscale, twidth * grainscale);
k3d/share/shaders/k3d_superplank.sl:228:      fade = smoothstep(.75, 4, fwidth);
k3d/share/shaders/k3d_superplank.sl:229:      if(fade < 0.999)
k3d/share/shaders/k3d_superplank.sl:235:	  grain = (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_superplank.sl:251:    1 - plankvary / 2 + plankvary * float cellnoise(whichplank, whichrow);
k3d/share/shaders/k3d_superplank.sl:254:  /* Combine the rings, grain, plank variation into one surface color */
k3d/share/shaders/k3d_superplank.sl:266:  if(Km > 0)
k3d/share/shaders/k3d_superplank.sl:271:      if(varnishbumpamp > 0)
k3d/share/shaders/k3d_superplank.sl:274:			    noise(varnishbumpfreq * ss,
k3d/share/shaders/k3d_superplank.sl:275:				  varnishbumpfreq * tt) - 1);
k3d/share/shaders/k3d_superplank.sl:278:      /* Find out how long a unit of shader space is, in current units */
k3d/share/shaders/k3d_superplank.sl:280:      shadlen = overallscale / length(ntransform("shader", NN));
k3d/share/shaders/k3d_superplank.sl:289:   * The wood itself behaves like plastic, the varnish overtop reflects
k3d/share/shaders/k3d_superplank.sl:290:   * using the fresnel formula (grazing angles reflect like mirrors).
k3d/share/shaders/k3d_superplank.sl:296:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_superplank.sl:297:  fresnel(IN, Nf, 1 / eta, fresnelKr, fresnelKt, R, T_dummy);
k3d/share/shaders/k3d_superplank.sl:298:  fresnelKr *= Kr;
k3d/share/shaders/k3d_superplank.sl:300:  illuminance(P, Nf, PI / 2)
k3d/share/shaders/k3d_superplank.sl:304:    if(nonspec < 1)
k3d/share/shaders/k3d_superplank.sl:309:		smoothstep(.6, .85, pow(max(0, Nf.H), 8 / roughness)));
k3d/share/shaders/k3d_superplank.sl:313:    (1 - fresnelKr) * (Ct * (Ka * ambient() + Kd * diffuse(Nf))) +
k3d/share/shaders/k3d_superplank.sl:316:  /* Only compute reflections if Kr > 0 */
k3d/share/shaders/k3d_superplank.sl:317:  if(fresnelKr > 0.001)
k3d/share/shaders/k3d_superplank.sl:319:      if(Krefl > 0 && reflmap != "")
k3d/share/shaders/k3d_superplank.sl:321:	  Pndc = transform("NDC", P);
k3d/share/shaders/k3d_superplank.sl:323:	    fresnelKr * specularcolor * texture(reflmap, xcomp(Pndc),
k3d/share/shaders/k3d_superplank.sl:326:      if(Ktrace > 0)
k3d/share/shaders/k3d_superplank.sl:327:	Ci += Ktrace * fresnelKr * specularcolor * trace(P, R);
k3d/share/shaders/k3d_superpplastic.sl:1:/* paintedplastic.sl - Standard texture map surface for RenderMan Interface.
k3d/share/shaders/k3d_superpplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_superpplastic.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_superpplastic.sl:9: *    Apply a texture map to a plastic surface, indexing the texture
k3d/share/shaders/k3d_superpplastic.sl:10: *    by the s,t parameters of the surface.
k3d/share/shaders/k3d_superpplastic.sl:14: *    texturename - the name of the texture file.
k3d/share/shaders/k3d_superpplastic.sl:18:/* Modified to support filter type and aize, amount of image blur, nuber samples
k3d/share/shaders/k3d_superpplastic.sl:19:along S and T, fidelty and number of samples by Giueppe Zompatori joesunny@tiscalinet.it*/
k3d/share/shaders/k3d_superpplastic.sl:21:surface k3d_superpplastic(float Ka = 1, Kd = .5, Ks = .5, roughness = .1;
k3d/share/shaders/k3d_superpplastic.sl:23:			  float filtertype = 1; float blur = 0.0;
k3d/share/shaders/k3d_superpplastic.sl:24:			  float fidelity = 1; float samples = 1;
k3d/share/shaders/k3d_superpplastic.sl:25:			  float Swidth = 1; float Twidth = 1;)
k3d/share/shaders/k3d_superpplastic.sl:27:  normal Nf;
k3d/share/shaders/k3d_superpplastic.sl:30:  string filter;
k3d/share/shaders/k3d_superpplastic.sl:32:  if(filtertype == 1)
k3d/share/shaders/k3d_superpplastic.sl:33:    filter = "box";
k3d/share/shaders/k3d_superpplastic.sl:34:  if(filtertype == 2);
k3d/share/shaders/k3d_superpplastic.sl:35:  filter = "catmull-rom";
k3d/share/shaders/k3d_superpplastic.sl:36:  if(filtertype == 3);
k3d/share/shaders/k3d_superpplastic.sl:37:  filter = "guassian";
k3d/share/shaders/k3d_superpplastic.sl:38:  if(filtertype == 4)
k3d/share/shaders/k3d_superpplastic.sl:39:    filter = "sinc";
k3d/share/shaders/k3d_superpplastic.sl:40:  if(filtertype == 5)
k3d/share/shaders/k3d_superpplastic.sl:41:    filter = "disk";
k3d/share/shaders/k3d_superpplastic.sl:43:    filter = "box";
k3d/share/shaders/k3d_superpplastic.sl:45:  if(texturename != "")
k3d/share/shaders/k3d_superpplastic.sl:47:      color texture(texturename, s, t, "filter", filter, "fidelity", fidelity,
k3d/share/shaders/k3d_superpplastic.sl:53:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_superpplastic.sl:57:    Os * (Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_superpplastic.sl:58:	  specularcolor * Ks * specular(Nf, V, roughness));
k3d/share/shaders/k3d_supertexmap.sl:6: *    to a plastic surface.  This is essentially a replacement for the
k3d/share/shaders/k3d_supertexmap.sl:7: *    standard "paintedplastic", but with much more flexibility in the
k3d/share/shaders/k3d_supertexmap.sl:8: *    coordinate mapping of the texture.
k3d/share/shaders/k3d_supertexmap.sl:12: *    texturename - the name of the texture file.
k3d/share/shaders/k3d_supertexmap.sl:13: *    projection - specifies the projection type, one of "st", "planar",
k3d/share/shaders/k3d_supertexmap.sl:18: *    mx - 16 floats giving an 3-D affine transformation to apply to the
k3d/share/shaders/k3d_supertexmap.sl:19: *                projected point before texture coordinates are extracted.
k3d/share/shaders/k3d_supertexmap.sl:20: *    truedisp - 1 for true displacement, 0 for bump mapping
k3d/share/shaders/k3d_supertexmap.sl:24: * Reference:
k3d/share/shaders/k3d_supertexmap.sl:25: *   _Advanced RenderMan: Creating CGI for Motion Picture_, 
k3d/share/shaders/k3d_supertexmap.sl:26: *   by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999.
k3d/share/shaders/k3d_supertexmap.sl:30:#include "k3d_filterwidth.h"
k3d/share/shaders/k3d_supertexmap.sl:36:surface k3d_supertexmap(float Ka = 1, Kd = .5, Ks = .5, roughness = .1;
k3d/share/shaders/k3d_supertexmap.sl:40:			float Csmx[16] =
k3d/share/shaders/k3d_supertexmap.sl:43:			float Csblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:47:			float Osmx[16] =
k3d/share/shaders/k3d_supertexmap.sl:50:			float Osblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:54:			float Ksmx[16] =
k3d/share/shaders/k3d_supertexmap.sl:57:			float Ksblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:61:			float dispmx[16] =
k3d/share/shaders/k3d_supertexmap.sl:64:			float dispblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:65:			float truedisp = 1;
k3d/share/shaders/k3d_supertexmap.sl:72:  float ks = Ks;
k3d/share/shaders/k3d_supertexmap.sl:73:  float disp = 0;
k3d/share/shaders/k3d_supertexmap.sl:76:  if(Csmapname != "")
k3d/share/shaders/k3d_supertexmap.sl:82:  if(Osmapname != "")
k3d/share/shaders/k3d_supertexmap.sl:88:  if(Ksmapname != "")
k3d/share/shaders/k3d_supertexmap.sl:94:  if(dispmapname != "")
k3d/share/shaders/k3d_supertexmap.sl:103:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_supertexmap.sl:104:  Ci = MaterialPlastic(Nf, Ct, Ka, Kd, ks, roughness);
k3d/share/shaders/k3d_supertoon.sl:2: * <felipe@siggraph.org.mx>, abril 2002

k3d/share/shaders/k3d_supertoon.sl:4: * Toon shader con antialiasing. Modula diffuse mediante escaloneo de modo que

k3d/share/shaders/k3d_supertoon.sl:6: * hace en tres puntos definidos por lim2, lim3 y lim4. A falta de antialiasing

k3d/share/shaders/k3d_supertoon.sl:9: * Toon shader with non-analitic antialiasing (controlled by delta). Difusion is modulated with

k3d/share/shaders/k3d_supertoon.sl:10: * clamping, the inflection points are lim2, lim3 and lim4. This shader is very cheap, 

k3d/share/shaders/k3d_supertoon.sl:14:color splitColor(color valor; float delta; float lim2; float lim3; float lim4;){

k3d/share/shaders/k3d_supertoon.sl:17:  if(comp(valor, 0) < lim3 - delta){

k3d/share/shaders/k3d_supertoon.sl:20:  else if(comp(valor, 0) >= lim3 - delta && comp(valor, 0) < lim4 - delta){

k3d/share/shaders/k3d_supertoon.sl:23:  else if(comp(valor, 0) >= lim4 - delta){

k3d/share/shaders/k3d_supertoon.sl:30:surface k3d_supertoon(float Kd = 1,

k3d/share/shaders/k3d_supertoon.sl:34:                        lim2 = 0.3,      /* inflection points  */

k3d/share/shaders/k3d_supertoon.sl:39:    normal Nf = normalize(N);

k3d/share/shaders/k3d_supertoon.sl:41:    color  difusion = 0;

k3d/share/shaders/k3d_supertoon.sl:44:    if(Ks != 0){ /* Some optimization. If the multiplier is zero, why call an expensive function? */

k3d/share/shaders/k3d_supertoon.sl:45:      especular = specular(Nf, -NI, roughness);

k3d/share/shaders/k3d_supertoon.sl:48:    if(Kd != 0){

k3d/share/shaders/k3d_supertoon.sl:49:      difusion = diffuse(faceforward(Nf, NI, Nf));

k3d/share/shaders/k3d_supertoon.sl:50:      difusion = splitColor(difusion, delta, lim2, lim3, lim4);

k3d/share/shaders/k3d_supertoon.sl:54:    Ci = Os * (Cs * Kd * difusion + Ks * especular * specColor);

k3d/share/shaders/k3d_terran.sl:7:#ifdef BMRT
k3d/share/shaders/k3d_terran.sl:8:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terran.sl:11:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terran.sl:12:#endif
k3d/share/shaders/k3d_terran.sl:14:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terran.sl:15:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terran.sl:16:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terran.sl:17:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terran.sl:20:surface k3d_terran(float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_terran.sl:21:		   float spectral_exp = 0.5;
k3d/share/shaders/k3d_terran.sl:22:		   float lacunarity = 2, octaves = 7;
k3d/share/shaders/k3d_terran.sl:23:		   float multifractal = 0; float dist_scale = .2;
k3d/share/shaders/k3d_terran.sl:24:		   float offset = 0;
k3d/share/shaders/k3d_terran.sl:25:		   float sea_level = 0;
k3d/share/shaders/k3d_terran.sl:26:		   float mtn_scale = 1;
k3d/share/shaders/k3d_terran.sl:27:		   float lat_scale = 0.95;
k3d/share/shaders/k3d_terran.sl:28:		   float nonlinear = 0;
k3d/share/shaders/k3d_terran.sl:29:		   float purt_scale = .9; float map_exp = 0;
k3d/share/shaders/k3d_terran.sl:30:		   float ice_caps = 0.9; float depth_scale = 1;
k3d/share/shaders/k3d_terran.sl:31:		   float depth_max = .5; float mottle_limit = 0.75;
k3d/share/shaders/k3d_terran.sl:32:		   float mottle_scale = 20; float mottle_dim = .25;
k3d/share/shaders/k3d_terran.sl:33:		   float mottle_mag = .02;)
k3d/share/shaders/k3d_terran.sl:37:  float chaos, latitude, purt;
k3d/share/shaders/k3d_terran.sl:40:  float l, o, a, i, weight;	/* Loop variables for fBm calc */
k3d/share/shaders/k3d_terran.sl:41:  float bumpy;
k3d/share/shaders/k3d_terran.sl:44:  Ptexture = transform("shader", P);
k3d/share/shaders/k3d_terran.sl:45:  PtN = normalize(Ptexture);	/* Version of Ptexture with radius 1 */
k3d/share/shaders/k3d_terran.sl:48:   * First, figure out where we are in relation to the oceans/mountains.
k3d/share/shaders/k3d_terran.sl:49:   * Note: this section of code must be identical to "terranbump" if you
k3d/share/shaders/k3d_terran.sl:53:  if(multifractal == 0)
k3d/share/shaders/k3d_terran.sl:54:    {				/* use a "standard" fBm bump function */
k3d/share/shaders/k3d_terran.sl:58:      for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_terran.sl:66:    {				/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terran.sl:69:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terran.sl:74:      for(i = 1; i < octaves && weight >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_terran.sl:85:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terran.sl:86:  chaos = bumpy + offset;
k3d/share/shaders/k3d_terran.sl:87:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran.sl:88:  if(chaos > sea_level)
k3d/share/shaders/k3d_terran.sl:102:  /* fractally purturb color map offset using "chaos" */
k3d/share/shaders/k3d_terran.sl:106:  if(map_exp > 0)
k3d/share/shaders/k3d_terran.sl:112:  if(chaos > sea_level)
k3d/share/shaders/k3d_terran.sl:114:      /* Choose color of land based on the following spline.
k3d/share/shaders/k3d_terran.sl:116:       * so I used a scanned photo of the real Earth to select some
k3d/share/shaders/k3d_terran.sl:142:      if(latitude < mottle_limit)
k3d/share/shaders/k3d_terran.sl:147:	  for(i = 0; i < 6; i += 1)
k3d/share/shaders/k3d_terran.sl:160:      if(ice_caps > 0 && latitude > ice_caps)
k3d/share/shaders/k3d_terran.sl:164:	  /* Adjust color of water to darken deeper seas */
k3d/share/shaders/k3d_terran.sl:175:    Os * Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_terran2.sl:5: * terran.sl - surface for an Earth-like planet.
k3d/share/shaders/k3d_terran2.sl:10: *   Earth-like.  The shader works by using a variety of fractal 
k3d/share/shaders/k3d_terran2.sl:13: *   which is necessary to get the best effect.  If you do this, it is
k3d/share/shaders/k3d_terran2.sl:16: *   in the middle of the ocean.
k3d/share/shaders/k3d_terran2.sl:21: *    spectral_exp, lacunarity, octaves - control the fractal characteristics
k3d/share/shaders/k3d_terran2.sl:22: *                of the bump pattern.
k3d/share/shaders/k3d_terran2.sl:23: *    bump_scale - scaling of the mountains
k3d/share/shaders/k3d_terran2.sl:24: *    multifractal - zero uses fBm noise, nonzero uses multifractal
k3d/share/shaders/k3d_terran2.sl:25: *    dist_scale - scaling for multifractal distortion
k3d/share/shaders/k3d_terran2.sl:26: *    offset - elevation offset
k3d/share/shaders/k3d_terran2.sl:28: *    mtn_scale - scaling factor for mountains
k3d/share/shaders/k3d_terran2.sl:29: *    lat_scale, nonlinear, purt_scale, map_exp - control scaling of 
k3d/share/shaders/k3d_terran2.sl:31: *    ice_caps - latitude at which ice caps tend to form on the oceans
k3d/share/shaders/k3d_terran2.sl:32: *    depth_scale, depth_max - scaling factor and max depth of oceans
k3d/share/shaders/k3d_terran2.sl:38: *       The default values for the shader assume that the planet is
k3d/share/shaders/k3d_terran2.sl:40: *    to this shader will need to be altered if the size of your planet
k3d/share/shaders/k3d_terran2.sl:41: *    is radically different.
k3d/share/shaders/k3d_terran2.sl:47: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_terran2.sl:57: *    May 28 1995 Didn't want polar caps so removed white from color spline --
k3d/share/shaders/k3d_terran2.sl:63:#ifdef BMRT
k3d/share/shaders/k3d_terran2.sl:64:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terran2.sl:67:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terran2.sl:68:#endif
k3d/share/shaders/k3d_terran2.sl:70:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terran2.sl:71:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terran2.sl:72:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terran2.sl:73:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terran2.sl:76:surface
k3d/share/shaders/k3d_terran2.sl:77:k3d_terran2 (float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_terran2.sl:78:	  float spectral_exp = 0.5;
k3d/share/shaders/k3d_terran2.sl:79:	  float lacunarity = 2, octaves = 7;
k3d/share/shaders/k3d_terran2.sl:80:	  float bump_scale = 0.07;
k3d/share/shaders/k3d_terran2.sl:81:	  float multifractal = 0;
k3d/share/shaders/k3d_terran2.sl:82:	  float dist_scale = .2;
k3d/share/shaders/k3d_terran2.sl:83:	  float offset = 0;
k3d/share/shaders/k3d_terran2.sl:84:	  float sea_level = 0;
k3d/share/shaders/k3d_terran2.sl:85:	  float mtn_scale = 1;
k3d/share/shaders/k3d_terran2.sl:86:	  float lat_scale = 0.95;
k3d/share/shaders/k3d_terran2.sl:87:	  float nonlinear = 0;
k3d/share/shaders/k3d_terran2.sl:88:	  float purt_scale = .9;
k3d/share/shaders/k3d_terran2.sl:89:	  float map_exp = 0;
k3d/share/shaders/k3d_terran2.sl:90:	  float ice_caps = 0.9;
k3d/share/shaders/k3d_terran2.sl:91:	  float depth_scale = 1;
k3d/share/shaders/k3d_terran2.sl:92:	  float depth_max = .5;
k3d/share/shaders/k3d_terran2.sl:93:	  float mottle_limit = 0.75;
k3d/share/shaders/k3d_terran2.sl:94:	  float mottle_scale = 20;
k3d/share/shaders/k3d_terran2.sl:95:	  float mottle_dim = .25;
k3d/share/shaders/k3d_terran2.sl:96:	  float mottle_mag = .02;)
k3d/share/shaders/k3d_terran2.sl:100:  float chaos, latitude, purt;
k3d/share/shaders/k3d_terran2.sl:103:  float l, o, a, i, weight;      /* Loop variables for fBm calc */
k3d/share/shaders/k3d_terran2.sl:104:  float bumpy;
k3d/share/shaders/k3d_terran2.sl:107:  Ptexture = transform ("shader", P);
k3d/share/shaders/k3d_terran2.sl:108:  PtN = normalize (Ptexture);      /* Version of Ptexture with radius 1 */
k3d/share/shaders/k3d_terran2.sl:111:   * First, figure out where we are in relation to the oceans/mountains.
k3d/share/shaders/k3d_terran2.sl:112:   * Note: this section of code must be identical to "terranbump" if you
k3d/share/shaders/k3d_terran2.sl:116:  if (multifractal == 0) {	/* use a "standard" fBm bump function */
k3d/share/shaders/k3d_terran2.sl:118:      for (i = 0;  i < octaves;  i += 1) {
k3d/share/shaders/k3d_terran2.sl:124:  else {			/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terran2.sl:127:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terran2.sl:131:      for (i = 1;  i < octaves  &&  weight >= VERY_SMALL;  i += 1) {
k3d/share/shaders/k3d_terran2.sl:141:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terran2.sl:142:  chaos = bumpy + offset;
k3d/share/shaders/k3d_terran2.sl:143:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran2.sl:144:  if (chaos > sea_level) {
k3d/share/shaders/k3d_terran2.sl:157:  /* fractally purturb color map offset using "chaos" */
k3d/share/shaders/k3d_terran2.sl:161:  if (map_exp > 0)
k3d/share/shaders/k3d_terran2.sl:166:  if (chaos > sea_level) {
k3d/share/shaders/k3d_terran2.sl:167:      /* Choose color of land based on the following spline.
k3d/share/shaders/k3d_terran2.sl:169:       * so I used a scanned photo of the real Earth to select some
k3d/share/shaders/k3d_terran2.sl:202:     if (latitude < mottle_limit) {
k3d/share/shaders/k3d_terran2.sl:205:	 for (i = 0;  i < 6;  i += 1) {
k3d/share/shaders/k3d_terran2.sl:216:      if (ice_caps > 0  &&  latitude > ice_caps)
k3d/share/shaders/k3d_terran2.sl:219:	  /* Adjust color of water to darken deeper seas */
k3d/share/shaders/k3d_terran2.sl:229:  Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N),I)));
k3d/share/shaders/k3d_terranbump.sl:3:#ifdef BMRT
k3d/share/shaders/k3d_terranbump.sl:4:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terranbump.sl:7:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terranbump.sl:8:#endif
k3d/share/shaders/k3d_terranbump.sl:10:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terranbump.sl:11:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terranbump.sl:12:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terranbump.sl:13:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terranbump.sl:17:displacement k3d_terranbump(float spectral_exp = 0.5;
k3d/share/shaders/k3d_terranbump.sl:18:			    float lacunarity = 2, octaves = 7;
k3d/share/shaders/k3d_terranbump.sl:19:			    float bump_scale = 0.04; float multifractal = 0;
k3d/share/shaders/k3d_terranbump.sl:20:			    float dist_scale = .2; float offset = 0;
k3d/share/shaders/k3d_terranbump.sl:21:			    float sea_level = 0;)
k3d/share/shaders/k3d_terranbump.sl:23:  float chaos;
k3d/share/shaders/k3d_terranbump.sl:25:  float l, o, a, i, weight;	/* Loop variables for fBm calc */
k3d/share/shaders/k3d_terranbump.sl:26:  float bumpy;
k3d/share/shaders/k3d_terranbump.sl:29:  Ptexture = transform("shader", P);
k3d/share/shaders/k3d_terranbump.sl:31:  if(multifractal == 0)
k3d/share/shaders/k3d_terranbump.sl:32:    {				/* use a "standard" fBm bump function */
k3d/share/shaders/k3d_terranbump.sl:36:      for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_terranbump.sl:44:    {				/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terranbump.sl:47:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terranbump.sl:52:      for(i = 1; i < octaves && weight >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_terranbump.sl:63:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terranbump.sl:64:  chaos = bumpy + offset;
k3d/share/shaders/k3d_terranbump.sl:66:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terranbump.sl:67:  if(chaos > sea_level)
k3d/share/shaders/k3d_terranbump.sl:70:  /* Recalculate the surface normal (this is where all the real magic is!) */
k3d/share/shaders/k3d_texblender.sl:3:#include "k3d_filterwidth.h"
k3d/share/shaders/k3d_texblender.sl:7:#include "k3d_reflections.h"
k3d/share/shaders/k3d_texblender.sl:11:color altMaterialPlastic (normal Nf;  color basecolor,selftcolor,Rcolor,RFcolor;
k3d/share/shaders/k3d_texblender.sl:12:                       float Ka, Kd, Ks, roughness,selft,Kr,Krfr;)
k3d/share/shaders/k3d_texblender.sl:15:    return (basecolor * ( Ka*ambient() + Kd*diffuse(Nf)+selft*selftcolor ) )
k3d/share/shaders/k3d_texblender.sl:16:	   + Kr*Rcolor+Krfr*RFcolor
k3d/share/shaders/k3d_texblender.sl:17:     + Ks*specular(Nf,-normalize(I),roughness);
k3d/share/shaders/k3d_texblender.sl:21:myEnvironment (point P;  vector R;  float Kr, blur;  DECLARE_ENVPARAMS;)
k3d/share/shaders/k3d_texblender.sl:24:    float alpha;
k3d/share/shaders/k3d_texblender.sl:25:    if (envname != "") {
k3d/share/shaders/k3d_texblender.sl:26:        if (envspace == "NDC")
k3d/share/shaders/k3d_texblender.sl:27:            C = ReflMap (envname, P, blur, alpha);
k3d/share/shaders/k3d_texblender.sl:33:#if (defined(BMRT) || defined(RAYSERVER_H))
k3d/share/shaders/k3d_texblender.sl:36:#endif
k3d/share/shaders/k3d_texblender.sl:41:float myrand(point p;)
k3d/share/shaders/k3d_texblender.sl:43:	float x,hx;
k3d/share/shaders/k3d_texblender.sl:48:	float n=log(x,10);
k3d/share/shaders/k3d_texblender.sl:57:float tex_clouds(point P;float depth)
k3d/share/shaders/k3d_texblender.sl:59:	float val=0;
k3d/share/shaders/k3d_texblender.sl:60:	float i,arm=1;
k3d/share/shaders/k3d_texblender.sl:61:	float Karm=1;
k3d/share/shaders/k3d_texblender.sl:63:	for(i=0;i<depth;i=i+1)
k3d/share/shaders/k3d_texblender.sl:73:float tex_wood(point PP; float ringscale)
k3d/share/shaders/k3d_texblender.sl:75:	float grainy = 1;
k3d/share/shaders/k3d_texblender.sl:77:    float my_t = zcomp(PP) / ringscale;
k3d/share/shaders/k3d_texblender.sl:82:    float r = ringscale * noise (PQ);
k3d/share/shaders/k3d_texblender.sl:83:    r -= floor (r);
k3d/share/shaders/k3d_texblender.sl:86:    float r2 = grainy * (1.3 - noise (PQ)) + (1-grainy);
k3d/share/shaders/k3d_texblender.sl:92:		float scalex, scaley, scalez, octaves, blur;)
k3d/share/shaders/k3d_texblender.sl:97:	transp=transform(space,P)*vector (scalex, scaley, scalez);
k3d/share/shaders/k3d_texblender.sl:99:	if (mapname=="clouds")
k3d/share/shaders/k3d_texblender.sl:101:	else if (mapname=="noise")
k3d/share/shaders/k3d_texblender.sl:103:	else if (mapname=="wood")
k3d/share/shaders/k3d_texblender.sl:107:		newc=texture(mapname,s*scalex,t*scaley,"blur",blur,"fill",-1,"width",0);
k3d/share/shaders/k3d_texblender.sl:108:    if (comp(newc,1)==-1) newc=comp(newc,0); /* treat a 1-channel texture map as a greyscale */
k3d/share/shaders/k3d_texblender.sl:113:color BlendColor(string mode; float K; color newc, oldc)
k3d/share/shaders/k3d_texblender.sl:116:  if (mode=="m") res+=K*newc;
k3d/share/shaders/k3d_texblender.sl:117:  if (mode=="f") res*= (1-K)*(color 1)+K*newc;
k3d/share/shaders/k3d_texblender.sl:121:float BlendFloat(string mode; float K, newf, oldf)
k3d/share/shaders/k3d_texblender.sl:123:  float res=oldf;
k3d/share/shaders/k3d_texblender.sl:125: if (mode=="m") res=(res+K*newf)/(1+K);
k3d/share/shaders/k3d_texblender.sl:126: if (mode=="f") res*= ((1-K)+K*newf);
k3d/share/shaders/k3d_texblender.sl:131:surface
k3d/share/shaders/k3d_texblender.sl:132:k3d_texblender (float Ka = 1, Kd = .5, Ks = .2, roughness = .3, Kr=0,selft=0;
k3d/share/shaders/k3d_texblender.sl:133:		float Rblur=0.1,RFblur=0.1;
k3d/share/shaders/k3d_texblender.sl:134:		float Krfr=0,eta=0.8,Ko=1;
k3d/share/shaders/k3d_texblender.sl:136:		float cKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:137:		float oKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:138:		float sKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:139:		float mKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:140:		float bKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:141:		float rKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:142:		float iKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:143:		float aKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:144:		float nGmap=0;
k3d/share/shaders/k3d_texblender.sl:145:		float Kcs=1;
k3d/share/shaders/k3d_texblender.sl:146:		float Sgmx[5]={1,1,1,1,1},Sgmy[5]={1,1,1,1,1},Sgmz[5]={1,1,1,1,1};
k3d/share/shaders/k3d_texblender.sl:147:		float Depth[5]={3,3,3,3,3};
k3d/share/shaders/k3d_texblender.sl:148:		float Gblur[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:156:    color Ct = Kcs*Cs, Ot = Os*Ko,Cselft=Kcs*Cs;
k3d/share/shaders/k3d_texblender.sl:157:    float ks = Ks,kr=Kr;
k3d/share/shaders/k3d_texblender.sl:158:    float disp = 0,i,Alpha=1;
k3d/share/shaders/k3d_texblender.sl:161:    normal Nf =normalize( faceforward(normalize(N),I));
k3d/share/shaders/k3d_texblender.sl:162:    dispDir=normalize( faceforward(normalize(Ng),I));
k3d/share/shaders/k3d_texblender.sl:163:    corr=Nf-dispDir;
k3d/share/shaders/k3d_texblender.sl:165:	for(i=0;i<nGmap;i=i+1)
k3d/share/shaders/k3d_texblender.sl:170:    float MF=(comp(MC,0)+comp(MC,1)+comp(MC,2))/3; // when we want a float
k3d/share/shaders/k3d_texblender.sl:173:		if((Alpha*cKmap[i])!=0) Ct=BlendColor(mode,Alpha*cKmap[i],MC,Ct);
k3d/share/shaders/k3d_texblender.sl:174:		if((Alpha*oKmap[i])!=0) Ot=BlendColor(mode,Alpha*oKmap[i],MC,Ot);
k3d/share/shaders/k3d_texblender.sl:175:		if((Alpha*sKmap[i])!=0) ks=BlendFloat(mode,Alpha*sKmap[i],MF,ks);
k3d/share/shaders/k3d_texblender.sl:176:		if((Alpha*mKmap[i])!=0) kr=BlendFloat(mode,Alpha*mKmap[i],MF,kr);
k3d/share/shaders/k3d_texblender.sl:177:		if((Alpha*rKmap[i])!=0) roughness=BlendFloat(mode,Alpha*rKmap[i],
k3d/share/shaders/k3d_texblender.sl:179:		if(aKmap[i]!=0) Alpha=BlendFloat("f",aKmap[i],MF,1);
k3d/share/shaders/k3d_texblender.sl:180:		if((Alpha*iKmap[i])!=0) selft=BlendFloat(mode,Alpha*iKmap[i],MF,selft);
k3d/share/shaders/k3d_texblender.sl:181:		if((Alpha*bKmap[i])!=0) disp=BlendFloat(mode,Alpha*bKmap[i],MF,disp);
k3d/share/shaders/k3d_texblender.sl:183:	if(disp!=0)
k3d/share/shaders/k3d_texblender.sl:186:			ndir=normalize(ndir-(Nf*(ndir.Nf)));
k3d/share/shaders/k3d_texblender.sl:187:			ndir=normalize(Nf+ndir);
k3d/share/shaders/k3d_texblender.sl:188:			ndir=normalize(ndir-(Nf*(ndir.Nf)));
k3d/share/shaders/k3d_texblender.sl:189:			Nf+=disp*(normalize(ndir));
k3d/share/shaders/k3d_texblender.sl:190:			Nf=normalize(Nf);
k3d/share/shaders/k3d_texblender.sl:194:	float olds=raysamples;
k3d/share/shaders/k3d_texblender.sl:197:	if((kr!=0) && (((Nf.V)>=0) || (raylevel()==0)) ) 
k3d/share/shaders/k3d_texblender.sl:199:		if(Rblur==0) raysamples=1;
k3d/share/shaders/k3d_texblender.sl:200:		env=myEnvironment(P,normalize(reflect(V,Nf)),1,Rblur,ENVPARAMS);
k3d/share/shaders/k3d_texblender.sl:202:	if(Krfr!=0) 
k3d/share/shaders/k3d_texblender.sl:204:		if(RFblur==0) raysamples=1;
k3d/share/shaders/k3d_texblender.sl:206:		benv=myEnvironment(P,refract(V,Nf,(V.Nf > 0) ? 1.0/eta : eta),1,RFblur,ENVPARAMS);
k3d/share/shaders/k3d_texblender.sl:208:    Ci = altMaterialPlastic (Nf,Ct,Cselft,env,benv,
k3d/share/shaders/k3d_texblender.sl:209:				Ka,Kd,ks,roughness,selft,kr,Krfr);
k3d/share/shaders/k3d_threads.sl:10:	float   Km		=  .1,
k3d/share/shaders/k3d_threads.sl:11:		frequency	= 5.0,
k3d/share/shaders/k3d_threads.sl:13:		offset		=  .0,
k3d/share/shaders/k3d_threads.sl:16:	float magnitude;
k3d/share/shaders/k3d_threads.sl:19:	magnitude = (sin( PI*2*(t*frequency + s + phase))+offset) * Km;
k3d/share/shaders/k3d_threads.sl:22:	if( t > (1-dampzone)) 
k3d/share/shaders/k3d_threads.sl:24:	else if( t < dampzone )
k3d/share/shaders/k3d_tooledsteel.sl:1:/*  tooledsteel.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_tooledsteel.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_tooledsteel.sl:4: *  in any way you see fit, but please leave my name near the top
k3d/share/shaders/k3d_tooledsteel.sl:6: *  a combination of IDbrushedmetal.sl and the Worley-esque
k3d/share/shaders/k3d_tooledsteel.sl:7: *  F1 from bubbly.sl adapted to happen in parameter space.
k3d/share/shaders/k3d_tooledsteel.sl:8: *  A vector is computed from the gradient of the distance function,
k3d/share/shaders/k3d_tooledsteel.sl:9: *  and then used as the vector of anisotropy. works best on parametric
k3d/share/shaders/k3d_tooledsteel.sl:10: *  surfaces where you don't care about the seams. 
k3d/share/shaders/k3d_tooledsteel.sl:16: *  mult    		- multiples of swirls per unit
k3d/share/shaders/k3d_tooledsteel.sl:17: *  Nzscale 		- scale of the noise that randomizes the location of 
k3d/share/shaders/k3d_tooledsteel.sl:18: *          		  the swirls. set this to zero for a perfect grid.
k3d/share/shaders/k3d_tooledsteel.sl:19: *  Ks			- coefficient of specular
k3d/share/shaders/k3d_tooledsteel.sl:20: *  Kd			- coefficient of diffuse
k3d/share/shaders/k3d_tooledsteel.sl:21: *  Ka			- coefficient of ambient
k3d/share/shaders/k3d_tooledsteel.sl:22: *  Kr			- coefficient of reflectivity
k3d/share/shaders/k3d_tooledsteel.sl:23: *  specwidth		- the width of the specular stripe
k3d/share/shaders/k3d_tooledsteel.sl:25: *  specspread		- the spread of the specular stripe
k3d/share/shaders/k3d_tooledsteel.sl:27: *  mapspread		- the spread of the reflection map streaking
k3d/share/shaders/k3d_tooledsteel.sl:29: *  twist		- allows you to twist the direction of anisotropy
k3d/share/shaders/k3d_tooledsteel.sl:31: *  mapname		- name of the environment map
k3d/share/shaders/k3d_tooledsteel.sl:32: *  specularcolor	- color of the specular hilight
k3d/share/shaders/k3d_tooledsteel.sl:36:getvec(float  mult; float Nzscale)
k3d/share/shaders/k3d_tooledsteel.sl:41:  extern float s;
k3d/share/shaders/k3d_tooledsteel.sl:42:  extern float t;
k3d/share/shaders/k3d_tooledsteel.sl:46:  float a,b,c;
k3d/share/shaders/k3d_tooledsteel.sl:47:  float dist, shortest=10000;
k3d/share/shaders/k3d_tooledsteel.sl:48:  float valu,valv;
k3d/share/shaders/k3d_tooledsteel.sl:55:  vector offset, nzoff, out;
k3d/share/shaders/k3d_tooledsteel.sl:56:  float chu, chv;
k3d/share/shaders/k3d_tooledsteel.sl:58:  float ncells = floor(mult);
k3d/share/shaders/k3d_tooledsteel.sl:59:  float cellsize = 1/ncells;
k3d/share/shaders/k3d_tooledsteel.sl:61:  setxcomp(trucell,floor(xcomp(Po))+.5);
k3d/share/shaders/k3d_tooledsteel.sl:62:  setycomp(trucell,floor(ycomp(Po))+.5);
k3d/share/shaders/k3d_tooledsteel.sl:67:  for(a = -1; a<= 1; a+=1){
k3d/share/shaders/k3d_tooledsteel.sl:68:    for(b = -1; b<=1; b += 1){
k3d/share/shaders/k3d_tooledsteel.sl:69:	offset = vector(a,b,c);
k3d/share/shaders/k3d_tooledsteel.sl:70:	surrcell = trucell+offset;
k3d/share/shaders/k3d_tooledsteel.sl:71:	nzoff = ((vector cellnoise(surrcell)-.5)*Nzscale);
k3d/share/shaders/k3d_tooledsteel.sl:72:	setzcomp(nzoff,0);
k3d/share/shaders/k3d_tooledsteel.sl:73:	nzcell = surrcell + nzoff;
k3d/share/shaders/k3d_tooledsteel.sl:75:	if(dist<shortest){
k3d/share/shaders/k3d_tooledsteel.sl:89:anisospecular (vector VA; float specspread; float specwidth)
k3d/share/shaders/k3d_tooledsteel.sl:96:    float nonspec;
k3d/share/shaders/k3d_tooledsteel.sl:99:    normal Nf = faceforward(NN,-V);
k3d/share/shaders/k3d_tooledsteel.sl:100:    color pixbrdf, C = 0;
k3d/share/shaders/k3d_tooledsteel.sl:103:    illuminance (P, Nf, PI*.5) {
k3d/share/shaders/k3d_tooledsteel.sl:109:        if (nonspec < 1) {
k3d/share/shaders/k3d_tooledsteel.sl:113:	    pixbrdf  = specularbrdf(LN, Nf,V,specspread);
k3d/share/shaders/k3d_tooledsteel.sl:114:            C += Cl * pixbrdf * pow( 1-abs(VA.H), 1/specwidth );
k3d/share/shaders/k3d_tooledsteel.sl:121:surface
k3d/share/shaders/k3d_tooledsteel.sl:123:	float	mult		=  3,
k3d/share/shaders/k3d_tooledsteel.sl:137:	point Po = transform("object",P);
k3d/share/shaders/k3d_tooledsteel.sl:140:	vector Nf, Ntmp;
k3d/share/shaders/k3d_tooledsteel.sl:142:	float i, numsamples = 20;
k3d/share/shaders/k3d_tooledsteel.sl:143:	float angle, jitter;
k3d/share/shaders/k3d_tooledsteel.sl:144:	float Jspread = PI*(1/numsamples)*mapspread;
k3d/share/shaders/k3d_tooledsteel.sl:149:	Nf = faceforward(normalize(N), -I);
k3d/share/shaders/k3d_tooledsteel.sl:150:        Ntmp = Nf;
k3d/share/shaders/k3d_tooledsteel.sl:152:	if( mapname != "" ) {
k3d/share/shaders/k3d_tooledsteel.sl:153:	    for(i=0;i<=numsamples;i=i+1){
k3d/share/shaders/k3d_tooledsteel.sl:156:	      Ntmp = rotate(Nf,angle+jitter,zro,VA);
k3d/share/shaders/k3d_tooledsteel.sl:157:	      D = reflect(-V, Ntmp);
k3d/share/shaders/k3d_tooledsteel.sl:158:	      D = vtransform("world", D);
k3d/share/shaders/k3d_tooledsteel.sl:165:	Ci = Oi * (Cs * (Ka * ambient() + Kd * diffuse(-Nf)) + 
k3d/share/shaders/k3d_toonmap.sl:3:surface k3d_toonmap (
k3d/share/shaders/k3d_toonmap.sl:5:float Ka=0.327; 
k3d/share/shaders/k3d_toonmap.sl:6:float Kd=0.336; 
k3d/share/shaders/k3d_toonmap.sl:7:float Ks=0.929; 
k3d/share/shaders/k3d_toonmap.sl:8:float roughness=0.107; 
k3d/share/shaders/k3d_toonmap.sl:11:float channel4=0; 
k3d/share/shaders/k3d_toonmap.sl:12:float swidth4=1; 
k3d/share/shaders/k3d_toonmap.sl:13:float twidth4=1; 
k3d/share/shaders/k3d_toonmap.sl:14:float samples4=1; 
k3d/share/shaders/k3d_toonmap.sl:15:float ss4=1; 
k3d/share/shaders/k3d_toonmap.sl:16:float tt4=1; 
k3d/share/shaders/k3d_toonmap.sl:19:float channel3=0; 
k3d/share/shaders/k3d_toonmap.sl:20:float swidth3=1; 
k3d/share/shaders/k3d_toonmap.sl:21:float twidth3=1; 
k3d/share/shaders/k3d_toonmap.sl:22:float samples3=1; 
k3d/share/shaders/k3d_toonmap.sl:23:float ss3=1; 
k3d/share/shaders/k3d_toonmap.sl:24:float tt3=1; 
k3d/share/shaders/k3d_toonmap.sl:25:float paint_spec=0.0888; 
k3d/share/shaders/k3d_toonmap.sl:26:float paint_trans=0.539; 
k3d/share/shaders/k3d_toonmap.sl:27:float paint_fuzz=0.274; 
k3d/share/shaders/k3d_toonmap.sl:28:float ink_thresh=0.389; 
k3d/share/shaders/k3d_toonmap.sl:29:float ink_fuzz=0.765; 
k3d/share/shaders/k3d_toonmap.sl:32:float channel2=0; 
k3d/share/shaders/k3d_toonmap.sl:33:float swidth2=1; 
k3d/share/shaders/k3d_toonmap.sl:34:float twidth2=1; 
k3d/share/shaders/k3d_toonmap.sl:35:float samples2=1; 
k3d/share/shaders/k3d_toonmap.sl:36:float ss2=1; 
k3d/share/shaders/k3d_toonmap.sl:37:float tt2=1; ) 
k3d/share/shaders/k3d_toonmap.sl:39:/** Surface main-code start **/
k3d/share/shaders/k3d_toonmap.sl:43:float temp_ss4;
k3d/share/shaders/k3d_toonmap.sl:44:float temp_tt4;
k3d/share/shaders/k3d_toonmap.sl:45:if (ss4 ==1) {temp_ss4=s;} else {temp_ss4=ss4;}
k3d/share/shaders/k3d_toonmap.sl:46:if (tt4 ==1) {temp_tt4=t;} else {temp_tt4=tt4;}
k3d/share/shaders/k3d_toonmap.sl:47:if ( Highlight_Map=="" ) 
k3d/share/shaders/k3d_toonmap.sl:53:if (channel4 < 0 || channel4 > 3)
k3d/share/shaders/k3d_toonmap.sl:64:float temp_ss3;
k3d/share/shaders/k3d_toonmap.sl:65:float temp_tt3;
k3d/share/shaders/k3d_toonmap.sl:66:if (ss3 ==1) {temp_ss3=s;} else {temp_ss3=ss3;}
k3d/share/shaders/k3d_toonmap.sl:67:if (tt3 ==1) {temp_tt3=t;} else {temp_tt3=tt3;}
k3d/share/shaders/k3d_toonmap.sl:68:if ( Paint_Map=="" ) 
k3d/share/shaders/k3d_toonmap.sl:74:if (channel3 < 0 || channel3 > 3)
k3d/share/shaders/k3d_toonmap.sl:85:float temp_ss2;
k3d/share/shaders/k3d_toonmap.sl:86:float temp_tt2;
k3d/share/shaders/k3d_toonmap.sl:87:if (ss2 ==1) {temp_ss2=s;} else {temp_ss2=ss2;}
k3d/share/shaders/k3d_toonmap.sl:88:if (tt2 ==1) {temp_tt2=t;} else {temp_tt2=tt2;}
k3d/share/shaders/k3d_toonmap.sl:89:if ( Ink_Map=="" ) 
k3d/share/shaders/k3d_toonmap.sl:95:if (channel2 < 0 || channel2 > 3)
k3d/share/shaders/k3d_toonmap.sl:104:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_toonmap.sl:105:#define union(a,b) ((a) + (b) - (a) * (b))
k3d/share/shaders/k3d_toonmap.sl:107:float
k3d/share/shaders/k3d_toonmap.sl:108:toonspec(vector N, V; float roughness)
k3d/share/shaders/k3d_toonmap.sl:110:float C = 0;
k3d/share/shaders/k3d_toonmap.sl:120:float cos_here;
k3d/share/shaders/k3d_toonmap.sl:121:float diff, spec;
k3d/share/shaders/k3d_toonmap.sl:122:normal Nf;
k3d/share/shaders/k3d_toonmap.sl:123:vector normI, half;
k3d/share/shaders/k3d_toonmap.sl:128:Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_toonmap.sl:138:diff = 0;
k3d/share/shaders/k3d_toonmap.sl:139:illuminance(P, Nf, PI/2)
k3d/share/shaders/k3d_toonmap.sl:140:diff += normalize(L).Nf; 
k3d/share/shaders/k3d_toonmap.sl:143:diff = smoothstep(paint_trans - paint_fuzz/2, paint_trans + paint_fuzz/2, diff);
k3d/share/shaders/k3d_toonmap.sl:146:spec = toonspec(Nf, -normalize(I), roughness);
k3d/share/shaders/k3d_toonmap.sl:147:spec = smoothstep(paint_spec - paint_fuzz/2, paint_spec + paint_fuzz/2, spec);
k3d/share/shaders/k3d_toonmap.sl:149:layer_color = Cs*(Kd*diff*temt_c3 + Ka*ambient()) + temt_c4*Ks*spec;
k3d/share/shaders/k3d_toonmap.sl:157:cos_here = normalize(Nf).normI;
k3d/share/shaders/k3d_toonmap.sl:160:layer_opac = 1 - smoothstep(ink_thresh - ink_fuzz/2, ink_thresh + ink_fuzz/2, abs(cos_here));
k3d/share/shaders/k3d_toonmap.sl:162:if (abs(cos_here) < ink_thresh)
k3d/share/shaders/k3d_toonmap.sl:173:/** Surface main-code end **/
k3d/share/shaders/k3d_translucency.sl:11:* Description:  It's possible to use one different color and
k3d/share/shaders/k3d_translucency.sl:12:*		translucency texture for each side of a flat object
k3d/share/shaders/k3d_translucency.sl:18:*		 when a texture is present, as scale value for the texture.
k3d/share/shaders/k3d_translucency.sl:20:*		 It burns out the surface color.
k3d/share/shaders/k3d_translucency.sl:22:* Notes: Please send me any kind of suggestions or bugs.
k3d/share/shaders/k3d_translucency.sl:23:*	 If you use it in some production please email me the result.
k3d/share/shaders/k3d_translucency.sl:31:#define SQR(A) ((A)*(A))
k3d/share/shaders/k3d_translucency.sl:33:surface k3d_translucency(float Ka = 1;
k3d/share/shaders/k3d_translucency.sl:34:			float Kd = 1;
k3d/share/shaders/k3d_translucency.sl:35:			float Ks = 0.5;
k3d/share/shaders/k3d_translucency.sl:36:			float roughness = 0.1;
k3d/share/shaders/k3d_translucency.sl:39:			float blurcolorTx = 0;
k3d/share/shaders/k3d_translucency.sl:41:			float blurcolorTx2 = 0;
k3d/share/shaders/k3d_translucency.sl:43:			float colorS = 0;
k3d/share/shaders/k3d_translucency.sl:44:			float colorT = 0;
k3d/share/shaders/k3d_translucency.sl:45:			float colorScaleS = 1;
k3d/share/shaders/k3d_translucency.sl:46:			float colorScaleT = 1;
k3d/share/shaders/k3d_translucency.sl:47:			float transTx = 0.8;
k3d/share/shaders/k3d_translucency.sl:48:			float transblurTx = 0;
k3d/share/shaders/k3d_translucency.sl:50:			float transTx2 = 0.8;
k3d/share/shaders/k3d_translucency.sl:51:			float transblurTx2 = 0;
k3d/share/shaders/k3d_translucency.sl:57:	float ss = (s - colorS) / colorScaleS;
k3d/share/shaders/k3d_translucency.sl:58:	float tt = (t - colorT) / colorScaleT;
k3d/share/shaders/k3d_translucency.sl:65:	float cosine, sine;
k3d/share/shaders/k3d_translucency.sl:71:	normal Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_translucency.sl:74:	/*Color texturing of different side*/
k3d/share/shaders/k3d_translucency.sl:78:	if (Nf.N>0)
k3d/share/shaders/k3d_translucency.sl:80:		if (colorTx != ""){
k3d/share/shaders/k3d_translucency.sl:81:			float opac = float texture(colorTx[3], ss, tt);
k3d/share/shaders/k3d_translucency.sl:86:	 	if (colorTx2 != ""){
k3d/share/shaders/k3d_translucency.sl:87:			float opac = float texture(colorTx2[3], ss, tt);
k3d/share/shaders/k3d_translucency.sl:92:	float Kt;
k3d/share/shaders/k3d_translucency.sl:94:	/*Translucency texturing of different side*/
k3d/share/shaders/k3d_translucency.sl:96:	if (Nf.N>0)
k3d/share/shaders/k3d_translucency.sl:98:		if (transTex != ""){
k3d/share/shaders/k3d_translucency.sl:99:			 Kt = float texture(transTex[0], ss, tt, "blur", transblurTx);
k3d/share/shaders/k3d_translucency.sl:104:		if (transTex2 != ""){
k3d/share/shaders/k3d_translucency.sl:105:			 Kt = float texture(transTex2[0], ss, tt, "blur", transblurTx2);
k3d/share/shaders/k3d_translucency.sl:117:	illuminance (P, Nf, 1.57079632679489661923){
k3d/share/shaders/k3d_translucency.sl:119:		cosine = max (-Nf.V,0);
k3d/share/shaders/k3d_translucency.sl:120:		shiny += pow (cosine, 1.0/roughness) / (ln.Nf) * Cl * sheen;
k3d/share/shaders/k3d_translucency.sl:121:		cosine = max (Nf.V, 0);
k3d/share/shaders/k3d_translucency.sl:123:		shiny += pow(sine, 10.0)*ln.Nf * Cl*sheen;
k3d/share/shaders/k3d_translucency.sl:127:	Ci = Ct * (Ka*ambient() + Kd*diffuse(Nf) + Kt*diffuse(-Nf)) + Ks*specular(Nf,V,roughness) + shiny;
k3d/share/shaders/k3d_uberlight.sl:2: * uberlight.sl - a light with many fun controls.
k3d/share/shaders/k3d_uberlight.sl:5: *   Based on Ronen Barzel's paper "Lighting Controls for Computer
k3d/share/shaders/k3d_uberlight.sl:6: *   Cinematography" (in Journal of Graphics Tools, vol. 2, no. 1: 1-20).
k3d/share/shaders/k3d_uberlight.sl:8: * Rather than explicitly pass "from" and "to" points to indicate the
k3d/share/shaders/k3d_uberlight.sl:9: * position and direction of the light (as spotlight does), this light
k3d/share/shaders/k3d_uberlight.sl:10: * emits from the origin of the local light shader space and points
k3d/share/shaders/k3d_uberlight.sl:13: * coordinate system in effect when the light source is declared.
k3d/share/shaders/k3d_uberlight.sl:14: * Perhaps this is a new idea for some users, but it isn't really
k3d/share/shaders/k3d_uberlight.sl:15: * hard, and it vastly simplifies the math in the shader.
k3d/share/shaders/k3d_uberlight.sl:18: *   intensity - overall intensity scaling of the light
k3d/share/shaders/k3d_uberlight.sl:19: *   lightcolor - overall color filtering for the light
k3d/share/shaders/k3d_uberlight.sl:22: *   lighttype - one of "spot", "omni", or "arealight".  Spot lights are
k3d/share/shaders/k3d_uberlight.sl:24: *       space, for this light).  Omni lights throw light in all directions.
k3d/share/shaders/k3d_uberlight.sl:25: *       Area lights are emitted from actual geometry (this only works on
k3d/share/shaders/k3d_uberlight.sl:26: *       BMRT area lights for the time being).
k3d/share/shaders/k3d_uberlight.sl:28: * Distance shaping and falloff controls:
k3d/share/shaders/k3d_uberlight.sl:29: *   cuton, cutoff - define the depth range (z range from the origin, in
k3d/share/shaders/k3d_uberlight.sl:32: *   nearedge, faredge - define the width of the transition regions
k3d/share/shaders/k3d_uberlight.sl:33: *       for the cuton and cutoff.  The transitions will be smooth.
k3d/share/shaders/k3d_uberlight.sl:34: *   falloff - defines the exponent for falloff.  A falloff of 0 (the
k3d/share/shaders/k3d_uberlight.sl:35: *       default) indicates that the light is the same brightness
k3d/share/shaders/k3d_uberlight.sl:36: *       regardless of distance from the source.  Falloff==1 indicates
k3d/share/shaders/k3d_uberlight.sl:37: *       linear (1/r) falloff, falloff==2 indicates 1/r^2 falloff
k3d/share/shaders/k3d_uberlight.sl:38: *       (which is physically correct for point-like sources, but
k3d/share/shaders/k3d_uberlight.sl:40: *   falloffdist - the distance at which the incident energy is actually
k3d/share/shaders/k3d_uberlight.sl:42: *       is actually given by:   I = (falloffdist / distance) ^ falloff
k3d/share/shaders/k3d_uberlight.sl:43: *   maxintensity - to prevent the light from becoming unboundedly
k3d/share/shaders/k3d_uberlight.sl:44: *       large when the distance < falloffdist, the intensity is
k3d/share/shaders/k3d_uberlight.sl:46: *   parallelrays - when 0 (the default), the light appears to emanate
k3d/share/shaders/k3d_uberlight.sl:47: *       from a single point (i.e., the rays diverge).  When nonzero, 
k3d/share/shaders/k3d_uberlight.sl:48: *       the light rays are parallel, as if from an infinitely distant
k3d/share/shaders/k3d_uberlight.sl:51: * Shaping of the cross-section.  The cross-section of the light cone
k3d/share/shaders/k3d_uberlight.sl:52: * is actually described by a superellipse with the following
k3d/share/shaders/k3d_uberlight.sl:54: *   shearx, sheary - define the amount of shear applied to the light
k3d/share/shaders/k3d_uberlight.sl:55: *       cone direction.  Default is 0, meaning that the center of the
k3d/share/shaders/k3d_uberlight.sl:57: *   width, height - define the dimensions of the "barn door" opening.
k3d/share/shaders/k3d_uberlight.sl:58: *       They are the cross-sectional dimensions at a distance of 1
k3d/share/shaders/k3d_uberlight.sl:59: *       from the light.  In other words, width==height==1 indicates a
k3d/share/shaders/k3d_uberlight.sl:60: *       90 degree cone angle for the light.
k3d/share/shaders/k3d_uberlight.sl:61: *   wedge, hedge - the amount of width and height edge fuzz,
k3d/share/shaders/k3d_uberlight.sl:62: *       respectively.  Values of 0 will make a sharp cutoff, larger
k3d/share/shaders/k3d_uberlight.sl:63: *       values (up to 1) will make the edge softer.
k3d/share/shaders/k3d_uberlight.sl:64: *   roundness - controls how rounded the corners of the superellipse
k3d/share/shaders/k3d_uberlight.sl:65: *       are.  If this value is 0, the cross-section will be a perfect
k3d/share/shaders/k3d_uberlight.sl:66: *       rectangle.  If the value is 1, the cross-section will be a
k3d/share/shaders/k3d_uberlight.sl:67: *       perfect ellipse.  In-between values control the roundness of
k3d/share/shaders/k3d_uberlight.sl:68: *       the corners in a fairly obvious way.
k3d/share/shaders/k3d_uberlight.sl:69: *   beamdistribution - controls intensity falloff due to angle.
k3d/share/shaders/k3d_uberlight.sl:70: *       A value of 0 (the default) means no angle falloff.  A value
k3d/share/shaders/k3d_uberlight.sl:71: *       of 1 is roughly physically correct for a spotlight and 
k3d/share/shaders/k3d_uberlight.sl:72: *       corresponds to a cosine falloff.  For a BMRT area light, the
k3d/share/shaders/k3d_uberlight.sl:73: *       cosine falloff happens automatically, so 0 is the right physical
k3d/share/shaders/k3d_uberlight.sl:76: *       This parameter has no effect for omni lights.
k3d/share/shaders/k3d_uberlight.sl:78: * Cookie or slide filter:
k3d/share/shaders/k3d_uberlight.sl:79: *   slidename - if a filename is supplied, a texture lookup will be
k3d/share/shaders/k3d_uberlight.sl:80: *       done and the light emitted from the source will be filtered
k3d/share/shaders/k3d_uberlight.sl:81: *       by that color, much like a slide projector.  If you want to
k3d/share/shaders/k3d_uberlight.sl:84: *       simplicity, the shader assumes that the texture file will
k3d/share/shaders/k3d_uberlight.sl:88: *   noiseamp - amplitude of the noise.  A value of 0 (the default) 
k3d/share/shaders/k3d_uberlight.sl:90: *       of the projected noise.
k3d/share/shaders/k3d_uberlight.sl:91: *   noisefreq - frequency of the noise.
k3d/share/shaders/k3d_uberlight.sl:92: *   noiseoffset - spatial offset of the noise.  This can be animated,
k3d/share/shaders/k3d_uberlight.sl:93: *       for example, you can use the noise to simulate the
k3d/share/shaders/k3d_uberlight.sl:94: *       attenuation of light as it passes through a window with 
k3d/share/shaders/k3d_uberlight.sl:99: * PRMan documentation for more information on the meanings of these
k3d/share/shaders/k3d_uberlight.sl:101: *   shadowmap - the name of the texture containing the shadow map.  If
k3d/share/shaders/k3d_uberlight.sl:102: *       this value is "" (the default), no shadow map will be used.
k3d/share/shaders/k3d_uberlight.sl:103: *   shadowblur - how soft to make the shadow edge, expressed as a
k3d/share/shaders/k3d_uberlight.sl:104: *       percentage of the width of the entire shadow map.
k3d/share/shaders/k3d_uberlight.sl:105: *   shadowbias - the amount of shadow bias to add to the lookup.
k3d/share/shaders/k3d_uberlight.sl:106: *   shadownsamps - the number of samples to use.
k3d/share/shaders/k3d_uberlight.sl:108: * Ray-traced shadows.  These options work only for BMRT:
k3d/share/shaders/k3d_uberlight.sl:109: *   raytraceshadow - if nonzero, cast rays to see if we are in shadow.
k3d/share/shaders/k3d_uberlight.sl:110: *       The default is zero, i.e., not to try raytracing.
k3d/share/shaders/k3d_uberlight.sl:111: *   nshadowrays - The number of rays to trace to determine shadowing.
k3d/share/shaders/k3d_uberlight.sl:112: *   shadowcheat - add this offset to the light source position.  This
k3d/share/shaders/k3d_uberlight.sl:113: *       allows you to cause the shadows to emanate as if the light
k3d/share/shaders/k3d_uberlight.sl:115: *       illuminated or the appearance of highlights, etc.
k3d/share/shaders/k3d_uberlight.sl:117: * "Fake" shadows from a blocker object.  A blocker is a superellipse
k3d/share/shaders/k3d_uberlight.sl:118: * in 3-space which effectively blocks light.  But it's not really
k3d/share/shaders/k3d_uberlight.sl:120: * superellipse.  The blocker is defined to lie on the x-y plane of
k3d/share/shaders/k3d_uberlight.sl:121: * its own coordinate system (which obviously needs to be defined in
k3d/share/shaders/k3d_uberlight.sl:122: * the RIB file using the CoordinateSystem command).
k3d/share/shaders/k3d_uberlight.sl:123: *   blockercoords - the name of the coordinate system that defines the
k3d/share/shaders/k3d_uberlight.sl:124: *       local coordinates of the blocker.  If this is "", it indicates 
k3d/share/shaders/k3d_uberlight.sl:126: *   blockerwidth, blockerheight - define the dimensions of the blocker's
k3d/share/shaders/k3d_uberlight.sl:128: *   blockerwedge, blockerhedge - define the fuzzyness of the edges.
k3d/share/shaders/k3d_uberlight.sl:129: *   blockerround - how round the corners of the blocker are (same
k3d/share/shaders/k3d_uberlight.sl:130: *       control as the "roundness" parameter that affects the light
k3d/share/shaders/k3d_uberlight.sl:135: *       defined by any or all of the shadow map, ray cast, or
k3d/share/shaders/k3d_uberlight.sl:136: *       blocker) don't actually have to block light.  In fact, in
k3d/share/shaders/k3d_uberlight.sl:138: *       of the light to "shadowcolor".  If this color is set to
k3d/share/shaders/k3d_uberlight.sl:139: *       (0,0,0), it effectively blocks all light.  But if you set it
k3d/share/shaders/k3d_uberlight.sl:141: *       their full brightness but not go completely dark.  Another
k3d/share/shaders/k3d_uberlight.sl:142: *       use is if you are simulating sunlight: set the lightcolor to
k3d/share/shaders/k3d_uberlight.sl:144: *       somewhat bluish.  Another effect of shadows is to set the
k3d/share/shaders/k3d_uberlight.sl:145: *       __nonspecular flag so that the shadowed regions are lit only
k3d/share/shaders/k3d_uberlight.sl:146: *       diffusely, without highlights.
k3d/share/shaders/k3d_uberlight.sl:150: *       specular highlights!  The default is 0, which means it makes
k3d/share/shaders/k3d_uberlight.sl:151: *       highlights just fine (except for regions in shadows, as
k3d/share/shaders/k3d_uberlight.sl:152: *       explained above).  This is very handy for lights that are
k3d/share/shaders/k3d_uberlight.sl:153: *       meant to be fill lights, rather than key lights.
k3d/share/shaders/k3d_uberlight.sl:154: *       NOTE: This depends on the surface shader looking for, and
k3d/share/shaders/k3d_uberlight.sl:155: *       correctly acting upon, this parameter.  The built-in functions
k3d/share/shaders/k3d_uberlight.sl:156: *       diffuse(), specular() and phong() all do this, for PRMan 3.5
k3d/share/shaders/k3d_uberlight.sl:157: *       and later, as well as BMRT 2.3.5 and later.  But if you write
k3d/share/shaders/k3d_uberlight.sl:158: *       your own illuminance loops in your surface shader, you've got
k3d/share/shaders/k3d_uberlight.sl:159: *       to account for it yourself.  The PRMan user manual explains how
k3d/share/shaders/k3d_uberlight.sl:161: *   __nondiffuse - the analog to nonspecular; if this flag is set to
k3d/share/shaders/k3d_uberlight.sl:163: *       diffuse light.  This is useful for making a light that only
k3d/share/shaders/k3d_uberlight.sl:164: *       makes specular highlights, without affecting the rest of the
k3d/share/shaders/k3d_uberlight.sl:166: *       respect to the surface shader, as described above for
k3d/share/shaders/k3d_uberlight.sl:168: *   __foglight - the "noisysmoke" shader distributed with BMRT will add
k3d/share/shaders/k3d_uberlight.sl:169: *       atmospheric scattering only for those lights that have this
k3d/share/shaders/k3d_uberlight.sl:170: *       parameter set to 1 (the default).  In other words, if you use
k3d/share/shaders/k3d_uberlight.sl:171: *       this light with noisysmoke, you can set this flag to 0 to
k3d/share/shaders/k3d_uberlight.sl:172: *       make a particular light *not* cause illumination in the fog.
k3d/share/shaders/k3d_uberlight.sl:174: *       will also work just fine with PRMan (3.7 or later).
k3d/share/shaders/k3d_uberlight.sl:176: * NOTE: this shader has one each of: blocker, shadow map, slide, and
k3d/share/shaders/k3d_uberlight.sl:177: * noise texture.  Some advanced users may want more than one of some or
k3d/share/shaders/k3d_uberlight.sl:178: * all of these.  It is left as an exercise for the reader to make such
k3d/share/shaders/k3d_uberlight.sl:183: * This shader was written as part of the course notes for ACM
k3d/share/shaders/k3d_uberlight.sl:185: * (co-chaired by Tony Apodaca and Larry Gritz).  Feel free to use and
k3d/share/shaders/k3d_uberlight.sl:186: * distribute the source code of this shader, but please leave the
k3d/share/shaders/k3d_uberlight.sl:192: * older versions of these renderers, but I do make liberal use of the
k3d/share/shaders/k3d_uberlight.sl:193: * "vector" type and I often declare variables where they are used,
k3d/share/shaders/k3d_uberlight.sl:194: * rather than only at the beginning of blocks.  If you are using a
k3d/share/shaders/k3d_uberlight.sl:195: * renderer which does not support these new language features, just
k3d/share/shaders/k3d_uberlight.sl:196: * substitute "point" for all occurrances of "vector", and move the
k3d/share/shaders/k3d_uberlight.sl:197: * variable declarations to the top of the shader.
k3d/share/shaders/k3d_uberlight.sl:209:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_uberlight.sl:216:/* Superellipse soft clipping
k3d/share/shaders/k3d_uberlight.sl:219: *   - the equations of two superellipses (with major/minor axes given by
k3d/share/shaders/k3d_uberlight.sl:220: *        a,b and A,B for the inner and outer ellipses, respectively)
k3d/share/shaders/k3d_uberlight.sl:222: *   - 0 if Q was inside the inner ellipse
k3d/share/shaders/k3d_uberlight.sl:223: *   - 1 if Q was outside the outer ellipse
k3d/share/shaders/k3d_uberlight.sl:224: *   - smoothly varying from 0 to 1 in between
k3d/share/shaders/k3d_uberlight.sl:226:float clipSuperellipse(point Q;	/* Test point on the x-y plane */
k3d/share/shaders/k3d_uberlight.sl:227:		       float a, b;	/* Inner superellipse */
k3d/share/shaders/k3d_uberlight.sl:228:		       float A, B;	/* Outer superellipse */
k3d/share/shaders/k3d_uberlight.sl:229:		       float roundness;	/* Same roundness for both ellipses */
k3d/share/shaders/k3d_uberlight.sl:232:  float result = 0;
k3d/share/shaders/k3d_uberlight.sl:233:  float x = abs(xcomp(Q)), y = abs(ycomp(Q));
k3d/share/shaders/k3d_uberlight.sl:234:  if(x != 0 || y != 0)
k3d/share/shaders/k3d_uberlight.sl:236:      if(roundness < 1.0e-6)
k3d/share/shaders/k3d_uberlight.sl:238:	  /* Simpler case of a square */
k3d/share/shaders/k3d_uberlight.sl:241:      else if(roundness > 0.9999)
k3d/share/shaders/k3d_uberlight.sl:243:	  /* Simple case of a circle */
k3d/share/shaders/k3d_uberlight.sl:244:	  float sqr(float x)
k3d/share/shaders/k3d_uberlight.sl:248:	  float q = a * b / sqrt(sqr(b * x) + sqr(a * y));
k3d/share/shaders/k3d_uberlight.sl:249:	  float r = A * B / sqrt(sqr(B * x) + sqr(A * y));
k3d/share/shaders/k3d_uberlight.sl:255:	  float re = 2 / roundness;	/* roundness exponent */
k3d/share/shaders/k3d_uberlight.sl:256:	  float q = a * b * pow(pow(b * x, re) + pow(a * y, re), -1 / re);
k3d/share/shaders/k3d_uberlight.sl:257:	  float r = A * B * pow(pow(B * x, re) + pow(A * y, re), -1 / re);
k3d/share/shaders/k3d_uberlight.sl:271: *   - all information about the light shaping, including z smooth depth
k3d/share/shaders/k3d_uberlight.sl:272: *     clipping, superellipse x-y shaping, and distance falloff.
k3d/share/shaders/k3d_uberlight.sl:274: *   - attenuation factor based on the falloff and shaping
k3d/share/shaders/k3d_uberlight.sl:276:float ShapeLightVolume(point PL;	/* Point in light space */
k3d/share/shaders/k3d_uberlight.sl:277:		       string lighttype;	/* what kind of light */
k3d/share/shaders/k3d_uberlight.sl:279:		       float znear, zfar;	/* z clipping */
k3d/share/shaders/k3d_uberlight.sl:280:		       float nearedge, faredge;
k3d/share/shaders/k3d_uberlight.sl:281:		       float falloff, falloffdist;	/* distance falloff */
k3d/share/shaders/k3d_uberlight.sl:282:		       float maxintensity;
k3d/share/shaders/k3d_uberlight.sl:283:		       float shearx, sheary;	/* shear the direction */
k3d/share/shaders/k3d_uberlight.sl:284:		       float width, height;	/* xy superellipse */
k3d/share/shaders/k3d_uberlight.sl:285:		       float hedge, wedge, roundness;
k3d/share/shaders/k3d_uberlight.sl:286:		       float beamdistribution;	/* angle falloff */
k3d/share/shaders/k3d_uberlight.sl:289:  /* Examine the z depth of PL to apply the (possibly smooth) cuton and
k3d/share/shaders/k3d_uberlight.sl:290:   * cutoff.
k3d/share/shaders/k3d_uberlight.sl:292:  float atten = 1;
k3d/share/shaders/k3d_uberlight.sl:293:  float PLlen = length(PL);
k3d/share/shaders/k3d_uberlight.sl:294:  float Pz;
k3d/share/shaders/k3d_uberlight.sl:295:  if(lighttype == "spot")
k3d/share/shaders/k3d_uberlight.sl:301:      /* For omni or area lights, use distance from the light */
k3d/share/shaders/k3d_uberlight.sl:305:  atten *= 1 - smoothstep(zfar, zfar + faredge, Pz);
k3d/share/shaders/k3d_uberlight.sl:307:  /* Distance falloff */
k3d/share/shaders/k3d_uberlight.sl:308:  if(falloff != 0)
k3d/share/shaders/k3d_uberlight.sl:310:      if(PLlen > falloffdist)
k3d/share/shaders/k3d_uberlight.sl:312:	  atten *= pow(falloffdist / PLlen, falloff);
k3d/share/shaders/k3d_uberlight.sl:316:	  float s = log(1 / maxintensity);
k3d/share/shaders/k3d_uberlight.sl:317:	  float beta = -falloff / s;
k3d/share/shaders/k3d_uberlight.sl:318:	  atten *= (maxintensity * exp(s * pow(PLlen / falloffdist, beta)));
k3d/share/shaders/k3d_uberlight.sl:323:  if(lighttype != "omni" && beamdistribution > 0)
k3d/share/shaders/k3d_uberlight.sl:325:  if(lighttype == "spot")
k3d/share/shaders/k3d_uberlight.sl:338:/* Evaluate the occlusion between two points, P1 and P2, due to a fake
k3d/share/shaders/k3d_uberlight.sl:339: * blocker.  Return 0 if the light is totally blocked, 1 if it totally
k3d/share/shaders/k3d_uberlight.sl:342:float BlockerContribution(point P1, P2;
k3d/share/shaders/k3d_uberlight.sl:344:			  float blockerwidth, blockerheight;
k3d/share/shaders/k3d_uberlight.sl:345:			  float blockerwedge, blockerhedge;
k3d/share/shaders/k3d_uberlight.sl:346:			  float blockerround;
k3d/share/shaders/k3d_uberlight.sl:349:  float unoccluded = 1;
k3d/share/shaders/k3d_uberlight.sl:350:  /* Get the surface and light positions in blocker coords */
k3d/share/shaders/k3d_uberlight.sl:351:  point Pb1 = transform(blockercoords, P1);
k3d/share/shaders/k3d_uberlight.sl:352:  point Pb2 = transform(blockercoords, P2);
k3d/share/shaders/k3d_uberlight.sl:353:  /* Blocker works only if it's straddled by ray endpoints. */
k3d/share/shaders/k3d_uberlight.sl:354:  if(zcomp(Pb2) * zcomp(Pb1) < 0)
k3d/share/shaders/k3d_uberlight.sl:370:		     /* Basic intensity and color of the light */
k3d/share/shaders/k3d_uberlight.sl:371:		     string lighttype = "spot"; float intensity = 1;
k3d/share/shaders/k3d_uberlight.sl:373:		     /* Z shaping and distance falloff */
k3d/share/shaders/k3d_uberlight.sl:374:		     float cuton = 0.01, cutoff = 1.0e6, nearedge =
k3d/share/shaders/k3d_uberlight.sl:375:		     0, faredge = 0;
k3d/share/shaders/k3d_uberlight.sl:376:		     float falloff = 0, falloffdist = 1, maxintensity = 1;
k3d/share/shaders/k3d_uberlight.sl:377:		     float parallelrays = 0;
k3d/share/shaders/k3d_uberlight.sl:378:		     /* xy shaping of the cross-section and angle falloff */
k3d/share/shaders/k3d_uberlight.sl:379:		     float shearx = 0, sheary = 0;
k3d/share/shaders/k3d_uberlight.sl:380:		     float width = 1, height = 1, wedge = .1, hedge = .1;
k3d/share/shaders/k3d_uberlight.sl:381:		     float roundness = 1;
k3d/share/shaders/k3d_uberlight.sl:382:		     float beamdistribution = 0;
k3d/share/shaders/k3d_uberlight.sl:386:		     float noiseamp = 0, noisefreq = 4;
k3d/share/shaders/k3d_uberlight.sl:387:		     vector noiseoffset = 0;
k3d/share/shaders/k3d_uberlight.sl:390:		     float shadowblur = 0.01, shadowbias = .01, shadownsamps =
k3d/share/shaders/k3d_uberlight.sl:394:		     float raytraceshadow = 0, nshadowrays = 1;
k3d/share/shaders/k3d_uberlight.sl:398:		     float blockerwidth = 1, blockerheight = 1;
k3d/share/shaders/k3d_uberlight.sl:399:		     float blockerwedge = .1, blockerhedge =
k3d/share/shaders/k3d_uberlight.sl:402:		     float nonspecular = 0;
k3d/share/shaders/k3d_uberlight.sl:403:		     output varying float __nonspecular = 0;
k3d/share/shaders/k3d_uberlight.sl:404:		     output float __nondiffuse = 0;
k3d/share/shaders/k3d_uberlight.sl:405:		     output float __foglight = 1;)
k3d/share/shaders/k3d_uberlight.sl:407:  /* For simplicity, assume that the light is at the origin of shader
k3d/share/shaders/k3d_uberlight.sl:409:   * light, you transform the coordinate system in the RIB stream, prior
k3d/share/shaders/k3d_uberlight.sl:410:   * to instancing the light shader.  But that sure simplifies the
k3d/share/shaders/k3d_uberlight.sl:411:   * internals of the light shader!  Anyway, let PL be the position of
k3d/share/shaders/k3d_uberlight.sl:412:   * the surface point we're shading, expressed in the local light
k3d/share/shaders/k3d_uberlight.sl:415:  point PL = transform("shader", Ps);
k3d/share/shaders/k3d_uberlight.sl:416:#ifdef BMRT
k3d/share/shaders/k3d_uberlight.sl:417:  /* If it's an area light, we want the point and normal of the light
k3d/share/shaders/k3d_uberlight.sl:418:   * geometry.  If not an area light, BMRT guarantees P,N will be the
k3d/share/shaders/k3d_uberlight.sl:419:   * origin and z-axis of shader space.
k3d/share/shaders/k3d_uberlight.sl:421:  point from = P;
k3d/share/shaders/k3d_uberlight.sl:425:  point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_uberlight.sl:427:#endif
k3d/share/shaders/k3d_uberlight.sl:428:  uniform float angle;
k3d/share/shaders/k3d_uberlight.sl:429:  if(lighttype == "spot")
k3d/share/shaders/k3d_uberlight.sl:431:      uniform float maxradius = 1.4142136 * max(height + hedge + abs(sheary),
k3d/share/shaders/k3d_uberlight.sl:435:  else if(lighttype == "arealight")
k3d/share/shaders/k3d_uberlight.sl:445:  illuminate(from, axis, angle)
k3d/share/shaders/k3d_uberlight.sl:447:    /* Accumulate attenuation of the light as it is affected by various
k3d/share/shaders/k3d_uberlight.sl:449:     * multiplicative attenuation of 1.
k3d/share/shaders/k3d_uberlight.sl:451:    float atten = 1.0;
k3d/share/shaders/k3d_uberlight.sl:455:     * in the ShapeLightVolume function.
k3d/share/shaders/k3d_uberlight.sl:458:      ShapeLightVolume(PL, lighttype, axis, cuton, cutoff, nearedge, faredge,
k3d/share/shaders/k3d_uberlight.sl:459:		       falloff, falloffdist, maxintensity / intensity, shearx,
k3d/share/shaders/k3d_uberlight.sl:464:    if(slidename != "")
k3d/share/shaders/k3d_uberlight.sl:467:	float zslide = zcomp(Pslide);
k3d/share/shaders/k3d_uberlight.sl:468:	float xslide = 0.5 + 0.5 * xcomp(Pslide) / zslide;
k3d/share/shaders/k3d_uberlight.sl:469:	float yslide = 0.5 - 0.5 * ycomp(Pslide) / zslide;
k3d/share/shaders/k3d_uberlight.sl:473:    /* If the volume says we aren't being lit, skip the remaining tests */
k3d/share/shaders/k3d_uberlight.sl:474:    if(atten > 0)
k3d/share/shaders/k3d_uberlight.sl:477:	if(noiseamp > 0)
k3d/share/shaders/k3d_uberlight.sl:480:	    float n = noise(noisefreq * (PL + noiseoffset) * point(1, 1, 0));
k3d/share/shaders/k3d_uberlight.sl:486:	float unoccluded = 1;
k3d/share/shaders/k3d_uberlight.sl:487:	if(shadowmap != "")
k3d/share/shaders/k3d_uberlight.sl:492:	if(parallelrays == 0)
k3d/share/shaders/k3d_uberlight.sl:493:	  shadoworigin = from;
k3d/share/shaders/k3d_uberlight.sl:496:#if (defined(BMRT) || defined(RAYSERVER_H))
k3d/share/shaders/k3d_uberlight.sl:497:	/* If we can, apply ray cast shadows.  Force a ray trace if
k3d/share/shaders/k3d_uberlight.sl:500:	if(raytraceshadow != 0)
k3d/share/shaders/k3d_uberlight.sl:503:	    uniform float i;
k3d/share/shaders/k3d_uberlight.sl:504:	    for(i = 0; i < nshadowrays; i += 1)
k3d/share/shaders/k3d_uberlight.sl:509:#endif
k3d/share/shaders/k3d_uberlight.sl:510:	/* Apply blocker fake shadows */
k3d/share/shaders/k3d_uberlight.sl:511:	if(blockercoords != "")
k3d/share/shaders/k3d_uberlight.sl:522:    if(parallelrays != 0)
k3d/share/shaders/k3d_uberlight.sl:523:      L = axis * length(Ps - from);
k3d/share/shaders/k3d_urbermap.sl:3:surface k3d_urbermap (
k3d/share/shaders/k3d_urbermap.sl:5:string abColorMap="I:/ArtWorks/Textures/Batik_1.4.tif"; 
k3d/share/shaders/k3d_urbermap.sl:6:float abColorMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:7:float abUseColorMapAlpha=0; 
k3d/share/shaders/k3d_urbermap.sl:8:float abDiffuse=0.8; 
k3d/share/shaders/k3d_urbermap.sl:9:string abDiffuseMap="I:/ArtWorks/Textures/BubbaWeb_1.1.3.tif"; 
k3d/share/shaders/k3d_urbermap.sl:10:float abDiffuseMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:11:float abSpecular=0.3; 
k3d/share/shaders/k3d_urbermap.sl:12:string abSpecularMap="I:/ArtWorks/Textures/Curlitron_1.1.tif"; 
k3d/share/shaders/k3d_urbermap.sl:13:float abSpecularMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:15:string abSpecularColorMap="I:/ArtWorks/Textures/Native_1.2.highlight.tif"; 
k3d/share/shaders/k3d_urbermap.sl:16:float abSpecularColorMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:17:float abRoughness=0.3; 
k3d/share/shaders/k3d_urbermap.sl:18:string abRoughnessMap="I:/ArtWorks/Textures/Native_1.2.shadow.tif"; 
k3d/share/shaders/k3d_urbermap.sl:19:float abRoughnessMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:20:string abTransparencyMap="I:/ArtWorks/Textures/Native_1.2.tif"; 
k3d/share/shaders/k3d_urbermap.sl:21:float abInvertTransparencyMap=0; 
k3d/share/shaders/k3d_urbermap.sl:22:float abTransparencyMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:24:string abIncandescenseMap="I:/ArtWorks/Textures/BubbaWeb_1.1.3.tif"; 
k3d/share/shaders/k3d_urbermap.sl:25:float abIncandescenseMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:26:string abReflectionMap="I:/ArtWorks/Textures/Batik_1.4.tif"; 
k3d/share/shaders/k3d_urbermap.sl:27:float abReflectionUp=0; 
k3d/share/shaders/k3d_urbermap.sl:28:float abReflectivity=0.1; 
k3d/share/shaders/k3d_urbermap.sl:29:float abReflectionMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:30:string abBumpMap="I:/ArtWorks/Textures/Curlitron_1.1.tif"; 
k3d/share/shaders/k3d_urbermap.sl:31:float abBumpMapBlur=1; 
k3d/share/shaders/k3d_urbermap.sl:32:float abBumpScale=1; 
k3d/share/shaders/k3d_urbermap.sl:33:float abDoDisplacement=0; 
k3d/share/shaders/k3d_urbermap.sl:34:float abUseNormals=0; 
k3d/share/shaders/k3d_urbermap.sl:38:/** Surface main-code start **/
k3d/share/shaders/k3d_urbermap.sl:40:normal Nf;
k3d/share/shaders/k3d_urbermap.sl:43:color Csurf, Cspec, Copac, Cincand, Crefl;
k3d/share/shaders/k3d_urbermap.sl:44:float ss, tt, roughness, diff, spec, bmp;
k3d/share/shaders/k3d_urbermap.sl:47:ss = vector(s, t, 1) . vector(transform("shader", STMatrix0));
k3d/share/shaders/k3d_urbermap.sl:48:tt = vector(s, t, 1) . vector(transform("shader", STMatrix1));
k3d/share/shaders/k3d_urbermap.sl:51:if(abColorMap != "")
k3d/share/shaders/k3d_urbermap.sl:53:Csurf = Cs * color texture(abColorMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:56:if(abUseColorMapAlpha != 0)
k3d/share/shaders/k3d_urbermap.sl:58:Copac = float texture(abColorMap[3], ss, tt,
k3d/share/shaders/k3d_urbermap.sl:62:Csurf = Csurf / Copac;
k3d/share/shaders/k3d_urbermap.sl:71:Csurf = Cs;
k3d/share/shaders/k3d_urbermap.sl:76:if(abDiffuseMap != "")
k3d/share/shaders/k3d_urbermap.sl:78:diff = abDiffuse * float texture(abDiffuseMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:79:"swidth", abDiffuseMapBlur,
k3d/share/shaders/k3d_urbermap.sl:80:"twidth", abDiffuseMapBlur );
k3d/share/shaders/k3d_urbermap.sl:84:diff = abDiffuse;
k3d/share/shaders/k3d_urbermap.sl:88:if(abSpecularMap != "")
k3d/share/shaders/k3d_urbermap.sl:90:spec = abSpecular * float texture(abSpecularMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:100:if(abSpecularColorMap != "")
k3d/share/shaders/k3d_urbermap.sl:112:if(abRoughnessMap != "")
k3d/share/shaders/k3d_urbermap.sl:114:roughness = abRoughness * float texture(abRoughnessMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:124:if(abTransparencyMap != "")
k3d/share/shaders/k3d_urbermap.sl:126:if(abInvertTransparencyMap != 0)
k3d/share/shaders/k3d_urbermap.sl:141:if(abIncandescenseMap != "")
k3d/share/shaders/k3d_urbermap.sl:154:if( abBumpMap != "" )
k3d/share/shaders/k3d_urbermap.sl:156:bmp = abBumpScale * float texture( abBumpMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:159:PP = transform("shader", P);
k3d/share/shaders/k3d_urbermap.sl:160:Nf = normalize( ntransform("shader", N) );
k3d/share/shaders/k3d_urbermap.sl:161:PP += bmp * Nf;
k3d/share/shaders/k3d_urbermap.sl:162:PP = transform("shader", "current", PP);
k3d/share/shaders/k3d_urbermap.sl:163:Nf = calculatenormal(PP);
k3d/share/shaders/k3d_urbermap.sl:165:if (abUseNormals == 1) {
k3d/share/shaders/k3d_urbermap.sl:167:Nf = normalize(Nf) + deltaN;
k3d/share/shaders/k3d_urbermap.sl:170:if( abDoDisplacement == 1.0 )
k3d/share/shaders/k3d_urbermap.sl:175:Nf = N;
k3d/share/shaders/k3d_urbermap.sl:179:Nf = faceforward( normalize(Nf), I );
k3d/share/shaders/k3d_urbermap.sl:183:if( abReflectionMap != "" )
k3d/share/shaders/k3d_urbermap.sl:185:D = reflect(-V, Nf);
k3d/share/shaders/k3d_urbermap.sl:186:D = vtransform("worldspace", D);
k3d/share/shaders/k3d_urbermap.sl:187:if( abReflectionUp != 0 )
k3d/share/shaders/k3d_urbermap.sl:191:Crefl = abReflectivity *
k3d/share/shaders/k3d_urbermap.sl:192:color environment(abReflectionMap, D,
k3d/share/shaders/k3d_urbermap.sl:193:"swidth", abReflectionMapBlur,
k3d/share/shaders/k3d_urbermap.sl:194:"twidth", abReflectionMapBlur );
k3d/share/shaders/k3d_urbermap.sl:197:Crefl = color(0);
k3d/share/shaders/k3d_urbermap.sl:199:/** Surface main-code end **/
k3d/share/shaders/k3d_urbermap.sl:201:Ci = Csurf * (Cincand + ambient() + diff * diffuse(Nf)) + (spec * Cspec * (specular(Nf, V, roughness) + Crefl));
k3d/share/shaders/k3d_veinedmarble.sl:2: * veinedmarble.sl -- surface shader for a nice veined marble.
k3d/share/shaders/k3d_veinedmarble.sl:6: *   controls the color of the veins.  The background color is given by the
k3d/share/shaders/k3d_veinedmarble.sl:7: *   surface color (Cs).
k3d/share/shaders/k3d_veinedmarble.sl:11: *   veinfreq - controls fhe lowest frequency of the color veins
k3d/share/shaders/k3d_veinedmarble.sl:12: *   veinlevels - how many "levels" of vein tendrills it has
k3d/share/shaders/k3d_veinedmarble.sl:13: *   warpfreq - lowest frequency of the turbulent warping in the marble
k3d/share/shaders/k3d_veinedmarble.sl:15: *   veincolor - the color of the veins
k3d/share/shaders/k3d_veinedmarble.sl:16: *   sharpness - controls how sharp or fuzzy the veins are (higher = sharper)
k3d/share/shaders/k3d_veinedmarble.sl:24: * last modified  29 Jun 1994 by Larry Gritz
k3d/share/shaders/k3d_veinedmarble.sl:32:surface k3d_veinedmarble(float Ka = .5;
k3d/share/shaders/k3d_veinedmarble.sl:33:			 float Kd = .8;
k3d/share/shaders/k3d_veinedmarble.sl:34:			 float Ks = .4;
k3d/share/shaders/k3d_veinedmarble.sl:35:			 float roughness = .075;
k3d/share/shaders/k3d_veinedmarble.sl:37:			 float veinfreq = 1;
k3d/share/shaders/k3d_veinedmarble.sl:38:			 float veinlevels = 2;
k3d/share/shaders/k3d_veinedmarble.sl:39:			 float warpfreq = 1;
k3d/share/shaders/k3d_veinedmarble.sl:40:			 float warping = .5;
k3d/share/shaders/k3d_veinedmarble.sl:42:			 float sharpness = 8;
k3d/share/shaders/k3d_veinedmarble.sl:46:  point offset;
k3d/share/shaders/k3d_veinedmarble.sl:47:  float i, turb, freq;
k3d/share/shaders/k3d_veinedmarble.sl:48:  float turbsum;
k3d/share/shaders/k3d_veinedmarble.sl:50:  point PP = transform("shader", P);
k3d/share/shaders/k3d_veinedmarble.sl:51:  float dPP = filterwidthp(PP);
k3d/share/shaders/k3d_veinedmarble.sl:53:  PP += 0.5 * vfBm(PP, dPP, 6, 2, 0.5);
k3d/share/shaders/k3d_veinedmarble.sl:55:  /* Now calculate the veining function for the lookup area */
k3d/share/shaders/k3d_veinedmarble.sl:57:  freq = 1;
k3d/share/shaders/k3d_veinedmarble.sl:58:  PP *= veinfreq;
k3d/share/shaders/k3d_veinedmarble.sl:59:  for(i = 0; i < veinlevels; i += 1)
k3d/share/shaders/k3d_veinedmarble.sl:61:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
k3d/share/shaders/k3d_veinedmarble.sl:62:      turb = pow(smoothstep(0.8, 1, 1 - turb), sharpness) / freq;
k3d/share/shaders/k3d_veinedmarble.sl:64:      freq *= 3;
k3d/share/shaders/k3d_veinedmarble.sl:70:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_veinedmarble.sl:71:  Ci = MaterialPlastic(Nf, Ct, Ka, Kd, Ks, roughness);
k3d/share/shaders/k3d_velvet.sl:7: *   An attempt at a velvet surface.
k3d/share/shaders/k3d_velvet.sl:9: *   - A retroreflective lobe (back toward the light source)
k3d/share/shaders/k3d_velvet.sl:10: *   - Scattering near the horizon, regardless of incident direction
k3d/share/shaders/k3d_velvet.sl:11: *   - A diffuse color
k3d/share/shaders/k3d_velvet.sl:14: *   Ks:	controls retroreflective lobe
k3d/share/shaders/k3d_velvet.sl:15: *   Kd:	scales diffuse color
k3d/share/shaders/k3d_velvet.sl:16: *   Ka:	ambient component (affects diffuse color only)
k3d/share/shaders/k3d_velvet.sl:17: *   sheen:	color of retroreflective lobe and horizon scattering
k3d/share/shaders/k3d_velvet.sl:18: *   roughness: shininess of fabric (controls retroreflection only)
k3d/share/shaders/k3d_velvet.sl:20: * ANTIALIASING: should antialias itself fairly well
k3d/share/shaders/k3d_velvet.sl:26: *			Fixed retroreflection lobe (sign error); added
k3d/share/shaders/k3d_velvet.sl:29: *			defined SQR()
k3d/share/shaders/k3d_velvet.sl:31: * prev modified  28 January 1997 S. H. Westin
k3d/share/shaders/k3d_velvet.sl:34:#define SQR(A) ((A)*(A))
k3d/share/shaders/k3d_velvet.sl:36:surface
k3d/share/shaders/k3d_velvet.sl:37:k3d_velvet (float Ka = 0.05,
k3d/share/shaders/k3d_velvet.sl:40:	    float backscatter = 0.1,
k3d/share/shaders/k3d_velvet.sl:43:        float roughness = .1;
k3d/share/shaders/k3d_velvet.sl:46:  normal Nf;                     /* Normalized normal vector */
k3d/share/shaders/k3d_velvet.sl:48:  vector H;                      /* Bisector vector for Phong/Blinn */
k3d/share/shaders/k3d_velvet.sl:50:  color shiny;                   /* Non-diffuse components */
k3d/share/shaders/k3d_velvet.sl:51:  float cosine, sine;            /* Components for horizon scatter */
k3d/share/shaders/k3d_velvet.sl:53:  Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_velvet.sl:57:  illuminance ( P, Nf, 1.57079632679489661923 /* Hemisphere */ ) {
k3d/share/shaders/k3d_velvet.sl:59:    /* Retroreflective lobe */
k3d/share/shaders/k3d_velvet.sl:64:    cosine = max ( Nf.V, 0 );
k3d/share/shaders/k3d_velvet.sl:66:    shiny += pow ( sine, edginess ) * Ln.Nf * Cl * sheen;
k3d/share/shaders/k3d_velvet.sl:70:  /* Add in diffuse color */
k3d/share/shaders/k3d_velvet.sl:71:  Ci = Os * (Ka*ambient() + Kd*diffuse(Nf)) * Cs + shiny;
k3d/share/shaders/k3d_venus.sl:2: * venus.sl - surface for a very cloudy planet like Venus.
k3d/share/shaders/k3d_venus.sl:8: *      The shader works by creating a fractal turbulence function over
k3d/share/shaders/k3d_venus.sl:9: *   the surface to simulate the clouds.  Strong Coriolis forces are
k3d/share/shaders/k3d_venus.sl:10: *   simulated to give the twisting of clouds that is typically seen
k3d/share/shaders/k3d_venus.sl:16: *    offset, scale - control the linear scaling of the cloud value.
k3d/share/shaders/k3d_venus.sl:17: *    twist - controls the twisting of the clouds due to Coriolis forces.
k3d/share/shaders/k3d_venus.sl:18: *    omega - controls the fractal characteristics of the clouds
k3d/share/shaders/k3d_venus.sl:19: *    octaves - the number of octaves of noise to sum for the clouds.
k3d/share/shaders/k3d_venus.sl:23: *    The default values for the shader assume that the planet is
k3d/share/shaders/k3d_venus.sl:25: *    to this shader will need to be altered if the size of your planet
k3d/share/shaders/k3d_venus.sl:26: *    is radically different.
k3d/share/shaders/k3d_venus.sl:30: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_venus.sl:43: * last modified 1 March 1994 by lg
k3d/share/shaders/k3d_venus.sl:46:#define TWOPI (2*PI)
k3d/share/shaders/k3d_venus.sl:50:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_venus.sl:54:surface k3d_venus(float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_venus.sl:55:		  float offset = 1; float scale = 0.6; float twist = 0.22;
k3d/share/shaders/k3d_venus.sl:56:		  float omega = 0.65;
k3d/share/shaders/k3d_venus.sl:57:		  float octaves = 8;)
k3d/share/shaders/k3d_venus.sl:60:  point PtN;			/* normalized version of Ptexture */
k3d/share/shaders/k3d_venus.sl:61:  point PP;			/* Point after rotation by coriolis twist */
k3d/share/shaders/k3d_venus.sl:62:  float rsq;			/* Used in calculation of twist */
k3d/share/shaders/k3d_venus.sl:63:  float angle;			/* Twist angle */
k3d/share/shaders/k3d_venus.sl:64:  float sine, cosine;		/* sin and cos of angle */
k3d/share/shaders/k3d_venus.sl:65:  float l, o, a, i;		/* Loop control for fractal sum */
k3d/share/shaders/k3d_venus.sl:66:  float value;			/* Fractal sum is stored here */
k3d/share/shaders/k3d_venus.sl:68:  /* Transform to texture coordinates */
k3d/share/shaders/k3d_venus.sl:69:  Ptexture = transform("shader", P);
k3d/share/shaders/k3d_venus.sl:81:  /* Compute VLfBm */
k3d/share/shaders/k3d_venus.sl:85:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_venus.sl:92:  value = abs(offset + scale * a);
k3d/share/shaders/k3d_venus.sl:98:			 Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_venus2.sl:4: * venus.sl - surface for a very cloudy planet like Venus.
k3d/share/shaders/k3d_venus2.sl:10: *      The shader works by creating a fractal turbulence function over
k3d/share/shaders/k3d_venus2.sl:11: *   the surface to simulate the clouds.  Strong Coriolis forces are
k3d/share/shaders/k3d_venus2.sl:12: *   simulated to give the twisting of clouds that is typically seen
k3d/share/shaders/k3d_venus2.sl:18: *    offset, scale - control the linear scaling of the cloud value.
k3d/share/shaders/k3d_venus2.sl:19: *    twist - controls the twisting of the clouds due to Coriolis forces.
k3d/share/shaders/k3d_venus2.sl:20: *    omega - controls the fractal characteristics of the clouds
k3d/share/shaders/k3d_venus2.sl:21: *    octaves - the number of octaves of noise to sum for the clouds.
k3d/share/shaders/k3d_venus2.sl:22: *    radius - radius of planet
k3d/share/shaders/k3d_venus2.sl:26: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_venus2.sl:38: *    Dec 1996 - Added radius of planet as a parameter by Mark Beckwith
k3d/share/shaders/k3d_venus2.sl:44:#define TWOPI (2*PI)
k3d/share/shaders/k3d_venus2.sl:48:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_venus2.sl:52:surface
k3d/share/shaders/k3d_venus2.sl:53:k3d_venus2 (float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_venus2.sl:54:       float offset = 1;
k3d/share/shaders/k3d_venus2.sl:55:       float scale = 0.6;
k3d/share/shaders/k3d_venus2.sl:56:       float twist = 0.22;
k3d/share/shaders/k3d_venus2.sl:57:       float omega = 0.65;
k3d/share/shaders/k3d_venus2.sl:58:       float octaves = 8;
k3d/share/shaders/k3d_venus2.sl:59:       float radius = 1)
k3d/share/shaders/k3d_venus2.sl:62:  point PtN;                /* normalized version of Ptexture */
k3d/share/shaders/k3d_venus2.sl:63:  point PP;                 /* Point after rotation by coriolis twist */
k3d/share/shaders/k3d_venus2.sl:64:  float rsq;                /* Used in calculation of twist */
k3d/share/shaders/k3d_venus2.sl:65:  float angle;              /* Twist angle */
k3d/share/shaders/k3d_venus2.sl:66:  float sine, cosine;       /* sin and cos of angle */
k3d/share/shaders/k3d_venus2.sl:67:  float l, o, a, i;         /* Loop control for fractal sum */
k3d/share/shaders/k3d_venus2.sl:68:  float value;              /* Fractal sum is stored here */
k3d/share/shaders/k3d_venus2.sl:70:  /* Transform to texture coordinates and map to nit sphere */
k3d/share/shaders/k3d_venus2.sl:71:  Ptexture = transform ("shader", P) / radius;
k3d/share/shaders/k3d_venus2.sl:83:  /* Compute VLfBm */
k3d/share/shaders/k3d_venus2.sl:85:  for (i = 0;  i < octaves;  i += 1) {
k3d/share/shaders/k3d_venus2.sl:91:  value = abs (offset + scale * a);
k3d/share/shaders/k3d_venus2.sl:96:			    Kd * diffuse(faceforward(normalize(N),I)));
k3d/share/shaders/k3d_volcube.sl:1:/* srf_vol_cube - Brian Steiner - Sony Pictures Imageworks
k3d/share/shaders/k3d_volcube.sl:8:   Epsilon             - offset for calculating gradient normal. 
k3d/share/shaders/k3d_volcube.sl:9:   Vol_Mult, Vol_Offset - animation controls.
k3d/share/shaders/k3d_volcube.sl:10:   Do_Shading          - if 1, shading will be calculated.
k3d/share/shaders/k3d_volcube.sl:11:   SurfNormalDepth     - the mixing depth from surface
k3d/share/shaders/k3d_volcube.sl:13:   Additive            - if 1 add samples, if 0 over samples . 
k3d/share/shaders/k3d_volcube.sl:14:   ShowActiveVol       - if 1 show the active volume instead of density.
k3d/share/shaders/k3d_volcube.sl:15:   RunShadowPass       - set to 1 if running a shadow pass.
k3d/share/shaders/k3d_volcube.sl:21:/* fnc_traceBox returns an intersection point on a box */
k3d/share/shaders/k3d_volcube.sl:23:fnc_traceBox (float XMin;
k3d/share/shaders/k3d_volcube.sl:24:	      float XMax;
k3d/share/shaders/k3d_volcube.sl:25:	      float YMin;
k3d/share/shaders/k3d_volcube.sl:26:	      float YMax;
k3d/share/shaders/k3d_volcube.sl:27:	      float ZMin;
k3d/share/shaders/k3d_volcube.sl:28:	      float ZMax;
k3d/share/shaders/k3d_volcube.sl:29:	      float idx;
k3d/share/shaders/k3d_volcube.sl:30:	      string refractSpace;)
k3d/share/shaders/k3d_volcube.sl:38:    float D,T;
k3d/share/shaders/k3d_volcube.sl:39:    float TMin = 1000000;
k3d/share/shaders/k3d_volcube.sl:45:    Rd = vtransform(refractSpace,IN);
k3d/share/shaders/k3d_volcube.sl:46:    Ro = transform(refractSpace,P);
k3d/share/shaders/k3d_volcube.sl:52:    if(T > 0){
k3d/share/shaders/k3d_volcube.sl:60:    if(T > 0 && T < TMin){
k3d/share/shaders/k3d_volcube.sl:68:    if(T > 0 && T < TMin){
k3d/share/shaders/k3d_volcube.sl:76:    if(T > 0 && T < TMin){
k3d/share/shaders/k3d_volcube.sl:84:    if(T > 0 && T < TMin){
k3d/share/shaders/k3d_volcube.sl:92:    if(T > 0 && T < TMin){
k3d/share/shaders/k3d_volcube.sl:103:float
k3d/share/shaders/k3d_volcube.sl:104:active_volume(point Pos; float vol_mult, vol_offset;)
k3d/share/shaders/k3d_volcube.sl:106:    return (noise((Pos+30.445)*2)-.5+vol_offset)*vol_mult;
k3d/share/shaders/k3d_volcube.sl:112:/* density function will return the final volume density */
k3d/share/shaders/k3d_volcube.sl:113:float
k3d/share/shaders/k3d_volcube.sl:114:get_density(point Pos; float vol_mult, vol_offset;)
k3d/share/shaders/k3d_volcube.sl:116:    float dens = 0;
k3d/share/shaders/k3d_volcube.sl:117:    float activeVol = 0;
k3d/share/shaders/k3d_volcube.sl:118:    float offset_active = .1;
k3d/share/shaders/k3d_volcube.sl:119:    float mult_active = 20;
k3d/share/shaders/k3d_volcube.sl:120:    activeVol = active_volume(Pos,vol_mult,vol_offset);
k3d/share/shaders/k3d_volcube.sl:129:normal calcGradeNorm(point Pos; float vol_mult, vol_offset, dens, epsilon;)
k3d/share/shaders/k3d_volcube.sl:133:				    zcomp(Pos)),vol_mult,vol_offset) - dens,
k3d/share/shaders/k3d_volcube.sl:135:				    ycomp(Pos) - epsilon, zcomp(Pos)),vol_mult,vol_offset) - dens,
k3d/share/shaders/k3d_volcube.sl:137:				    ycomp(Pos), zcomp(Pos) - epsilon),vol_mult,vol_offset) - dens);
k3d/share/shaders/k3d_volcube.sl:138:    Nd = ntransform("object","current",Nd);
k3d/share/shaders/k3d_volcube.sl:146:/* shading function returns diffuse ans specular */
k3d/share/shaders/k3d_volcube.sl:148:		  normal Nf;
k3d/share/shaders/k3d_volcube.sl:150:		  float Roughness;
k3d/share/shaders/k3d_volcube.sl:151:		  output color diff;
k3d/share/shaders/k3d_volcube.sl:156:    diff = 0;
k3d/share/shaders/k3d_volcube.sl:158:    illuminance (Pos, Nf, radians(90)){
k3d/share/shaders/k3d_volcube.sl:159:	diff += Cl * max(0,normalize(L).Nf);
k3d/share/shaders/k3d_volcube.sl:160:	spec += Cl * specularbrdf(L, Nf, V, Roughness);
k3d/share/shaders/k3d_volcube.sl:169:fnc_normalMix (normal N1; normal N2; float mixer)
k3d/share/shaders/k3d_volcube.sl:171:    float N1_mag = 1;
k3d/share/shaders/k3d_volcube.sl:172:    float N2_mag = 1;
k3d/share/shaders/k3d_volcube.sl:186:surface
k3d/share/shaders/k3d_volcube.sl:187:k3d_volcube(float  StepSize       = 1;
k3d/share/shaders/k3d_volcube.sl:188:	     float  StepJitter     = 0;
k3d/share/shaders/k3d_volcube.sl:189:	     float  Density        = 1;
k3d/share/shaders/k3d_volcube.sl:190:	     float  Epsilon        = .001;
k3d/share/shaders/k3d_volcube.sl:191:	     float  Vol_Mult       = 1;
k3d/share/shaders/k3d_volcube.sl:192:	     float  Vol_Offset     = 0;
k3d/share/shaders/k3d_volcube.sl:193:	     float  Do_Shading     = 1;
k3d/share/shaders/k3d_volcube.sl:194:	     float  SurfNormalDepth = .05;
k3d/share/shaders/k3d_volcube.sl:195:	     float  Additive       = 1;
k3d/share/shaders/k3d_volcube.sl:196:	     float  ShowActiveVol  = 0;
k3d/share/shaders/k3d_volcube.sl:197:	     float  RunShadowPass  = 0;
k3d/share/shaders/k3d_volcube.sl:200:    point  inPoint_obj  = transform("object",P);
k3d/share/shaders/k3d_volcube.sl:201:    point  outPoint_obj = fnc_traceBox(-.501,.501,-.501,.501,-.501,.501,1,"object");
k3d/share/shaders/k3d_volcube.sl:203:    normal Nf = normalize(N);
k3d/share/shaders/k3d_volcube.sl:204:    float  Roughness    = .21;
k3d/share/shaders/k3d_volcube.sl:205:    color  diff	= 1;
k3d/share/shaders/k3d_volcube.sl:207:    float  vol_length   = length(outPoint_obj-inPoint_obj);
k3d/share/shaders/k3d_volcube.sl:208:    float  numOfSteps   = vol_length/StepSize;
k3d/share/shaders/k3d_volcube.sl:209:    vector step_obj     = (outPoint_obj-inPoint_obj)/numOfSteps;
k3d/share/shaders/k3d_volcube.sl:210:    vector step_cur     = vtransform("object","current",step_obj);
k3d/share/shaders/k3d_volcube.sl:211:    float  curStep      = 0;
k3d/share/shaders/k3d_volcube.sl:212:    float  density_sum  = 0;
k3d/share/shaders/k3d_volcube.sl:214:    float  shad_sum     = 0;
k3d/share/shaders/k3d_volcube.sl:215:    float  remainder    = 100;
k3d/share/shaders/k3d_volcube.sl:216:    float  cur_density  = 0;
k3d/share/shaders/k3d_volcube.sl:218:    float  density      = StepSize * Density;
k3d/share/shaders/k3d_volcube.sl:219:    float  jitter       = (random() - .5) * StepJitter;
k3d/share/shaders/k3d_volcube.sl:220:    float  cur_depth    = 0;
k3d/share/shaders/k3d_volcube.sl:229:    while(curStep < numOfSteps && density_sum < 1){
k3d/share/shaders/k3d_volcube.sl:234:	if(ShowActiveVol == 1)
k3d/share/shaders/k3d_volcube.sl:235:	    cur_density = active_volume(Pcur_obj,Vol_Mult,Vol_Offset);
k3d/share/shaders/k3d_volcube.sl:237:	    cur_density = get_density(Pcur_obj,Vol_Mult,Vol_Offset);
k3d/share/shaders/k3d_volcube.sl:239:	/*--- If Density > 0 Run The Rest Of The Loop ---*/
k3d/share/shaders/k3d_volcube.sl:240:	if(cur_density > 0 && RunShadowPass == 0){
k3d/share/shaders/k3d_volcube.sl:243:	    if(Do_Shading > 0){
k3d/share/shaders/k3d_volcube.sl:244:		if(cur_depth > 0){
k3d/share/shaders/k3d_volcube.sl:245:		    normal Vol_Nf = calcGradeNorm(Pcur_obj,Vol_Mult,Vol_Offset,
k3d/share/shaders/k3d_volcube.sl:247:		    Vol_Nf = normalize(Vol_Nf);
k3d/share/shaders/k3d_volcube.sl:248:		    Nf = fnc_normalMix(Nf,Vol_Nf,clamp(cur_depth/SurfNormalDepth,0,1));
k3d/share/shaders/k3d_volcube.sl:250:		get_shading(Pcur,Nf,V,Roughness,diff,spec);
k3d/share/shaders/k3d_volcube.sl:252:	    cur_color = (cur_color * diff) + spec*(1,.8,.2);
k3d/share/shaders/k3d_volcube.sl:254:	    /*---- if sample is not a full step ----*/
k3d/share/shaders/k3d_volcube.sl:255:	    remainder = numOfSteps - curStep;
k3d/share/shaders/k3d_volcube.sl:256:	    if(remainder < 1){
k3d/share/shaders/k3d_volcube.sl:264:	    if(Additive > 0){      
k3d/share/shaders/k3d_volcube.sl:270:                /* Do Over Instead of Add */
k3d/share/shaders/k3d_volcube.sl:278:            /* if Shadow Pass */
k3d/share/shaders/k3d_volcube.sl:279:	    if(Additive > 0){
k3d/share/shaders/k3d_volcube.sl:286:	    if(shad_sum >= .5){
k3d/share/shaders/k3d_wallpaper.sl:14:#define NCELLS 10
k3d/share/shaders/k3d_wallpaper.sl:15:#define CELLSIZE (1/NCELLS)
k3d/share/shaders/k3d_wallpaper.sl:16:#define snoise(s,t)	(2*noise((s),(t))-1)
k3d/share/shaders/k3d_wallpaper.sl:18:surface
k3d/share/shaders/k3d_wallpaper.sl:20:    uniform float Ka = 1;
k3d/share/shaders/k3d_wallpaper.sl:21:    uniform float Kd = 1;
k3d/share/shaders/k3d_wallpaper.sl:22:    uniform color starcolor = color (1.0000,0.5161,0.0000);
k3d/share/shaders/k3d_wallpaper.sl:23:    uniform float npoints = 5;
k3d/share/shaders/k3d_wallpaper.sl:27:    point Nf;
k3d/share/shaders/k3d_wallpaper.sl:28:    float ss, tt, angle, r, a, in_out;
k3d/share/shaders/k3d_wallpaper.sl:29:    float sctr, tctr, scell, tcell;
k3d/share/shaders/k3d_wallpaper.sl:30:    float scellctr, tcellctr;
k3d/share/shaders/k3d_wallpaper.sl:31:    float i, j;
k3d/share/shaders/k3d_wallpaper.sl:32:    uniform float rmin = 0.01, rmax = 0.03;
k3d/share/shaders/k3d_wallpaper.sl:33:    uniform float starangle = 2*PI/npoints;
k3d/share/shaders/k3d_wallpaper.sl:34:    uniform point p0 = rmax*(cos(0),sin(0),0);
k3d/share/shaders/k3d_wallpaper.sl:35:    uniform point p1 = rmin*
k3d/share/shaders/k3d_wallpaper.sl:37:    uniform point d0 = p1 - p0;
k3d/share/shaders/k3d_wallpaper.sl:40:    scellctr = floor(s*NCELLS);
k3d/share/shaders/k3d_wallpaper.sl:41:    tcellctr = floor(t*NCELLS);
k3d/share/shaders/k3d_wallpaper.sl:44:    for (i = -1; i <= 1; i += 1) {
k3d/share/shaders/k3d_wallpaper.sl:45:        for (j = -1; j <= 1; j += 1) {
k3d/share/shaders/k3d_wallpaper.sl:48:	    if (float noise(3*scell-9.5,7*tcell+7.5) < 0.55) {
k3d/share/shaders/k3d_wallpaper.sl:60:                if (a >= 0.5)
k3d/share/shaders/k3d_wallpaper.sl:69:    /* "matte" reflection model */
k3d/share/shaders/k3d_wallpaper.sl:70:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_wallpaper.sl:72:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_wallpaper_2stripe.sl:2: * wallpaper_2stripe.sl -- surface shader for double striped wall paper
k3d/share/shaders/k3d_wallpaper_2stripe.sl:5: *   Makes a double striped pattern appropriate for wall paper.  Stripes
k3d/share/shaders/k3d_wallpaper_2stripe.sl:6: *   are shaded in s-t space, and the stripes are parallel to lines of
k3d/share/shaders/k3d_wallpaper_2stripe.sl:7: *   equal s.  The background color is given by the surface color.
k3d/share/shaders/k3d_wallpaper_2stripe.sl:13: *   bgcolor, stripecolor       color of background and stripes
k3d/share/shaders/k3d_wallpaper_2stripe.sl:14: *   stripewidth                width of stripes, in s coordinates
k3d/share/shaders/k3d_wallpaper_2stripe.sl:15: *   stripespacing              dist between sets of stripes, in s coordinates
k3d/share/shaders/k3d_wallpaper_2stripe.sl:18: * ANTIALIASING:  should analytically antialias itself quite well.
k3d/share/shaders/k3d_wallpaper_2stripe.sl:29:surface k3d_wallpaper_2stripe(float Ka = 0.5, Kd = 0.75, Ks = 0.25;
k3d/share/shaders/k3d_wallpaper_2stripe.sl:30:			      float roughness = 0.1;
k3d/share/shaders/k3d_wallpaper_2stripe.sl:32:			      float stripewidth = 0.05;
k3d/share/shaders/k3d_wallpaper_2stripe.sl:33:			      float stripespacing = 0.5;)
k3d/share/shaders/k3d_wallpaper_2stripe.sl:35:  float ss = s / stripespacing - 0.5;
k3d/share/shaders/k3d_wallpaper_2stripe.sl:36:  float ds = filterwidth(ss);
k3d/share/shaders/k3d_wallpaper_2stripe.sl:37:  float edge = (1 - stripewidth);
k3d/share/shaders/k3d_wallpaper_2stripe.sl:39:  float stripe =
k3d/share/shaders/k3d_wallpaper_2stripe.sl:40:    (filteredpulsetrain(edge, 1, ss, ds) +
k3d/share/shaders/k3d_wallpaper_2stripe.sl:41:     filteredpulsetrain(edge, 1, ss + 2 * stripewidth, ds));
k3d/share/shaders/k3d_wallpaper_2stripe.sl:45:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_wallpaper_2stripe.sl:46:  Ci = MaterialPlastic(Nf, Ct, Ka, Kd, Ks, roughness);
k3d/share/shaders/k3d_warningstripes.sl:6:// This program is free software; you can redistribute it and/or
k3d/share/shaders/k3d_warningstripes.sl:7:// modify it under the terms of the GNU General Public
k3d/share/shaders/k3d_warningstripes.sl:8:// License as published by the Free Software Foundation; either
k3d/share/shaders/k3d_warningstripes.sl:9:// version 2 of the License, or (at your option) any later version.
k3d/share/shaders/k3d_warningstripes.sl:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_warningstripes.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_warningstripes.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_warningstripes.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_warningstripes.sl:17:// License along with this program; if not, write to the Free Software
k3d/share/shaders/k3d_warningstripes.sl:20:/** \file
k3d/share/shaders/k3d_warningstripes.sl:24:/// Filtering code courtesy of the Advanced RenderMan book ... where else?
k3d/share/shaders/k3d_warningstripes.sl:26:#define MIN_FILTER_WIDTH 1.0e-6
k3d/share/shaders/k3d_warningstripes.sl:27:#define filter_width(x) max(abs(Du(x)*du) + abs(Dv(x)*dv), MIN_FILTER_WIDTH)
k3d/share/shaders/k3d_warningstripes.sl:29:float filtered_pulse_train(float edge, period, x, dx)
k3d/share/shaders/k3d_warningstripes.sl:31:	float w = dx / period;
k3d/share/shaders/k3d_warningstripes.sl:32:	float x0 = x/period - w/2;
k3d/share/shaders/k3d_warningstripes.sl:33:	float x1 = x0 + w;
k3d/share/shaders/k3d_warningstripes.sl:34:	float nedge = edge / period;
k3d/share/shaders/k3d_warningstripes.sl:36:	float integral(float t)
k3d/share/shaders/k3d_warningstripes.sl:38:		extern float nedge;
k3d/share/shaders/k3d_warningstripes.sl:39:		return ((1 - nedge) * floor(t) + max(0, t-floor(t)-nedge));
k3d/share/shaders/k3d_warningstripes.sl:45:surface k3d_warningstripes(
k3d/share/shaders/k3d_warningstripes.sl:46:	float Frequency = 8.0;
k3d/share/shaders/k3d_warningstripes.sl:50:	float stripe_position = filtered_pulse_train(0.5 / Frequency, 1.0 / Frequency, u+v, filter_width(u+v));
k3d/share/shaders/k3d_warningstripes.sl:54:	vector Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_warningstripes.sl:57:	Ci = (Os * Ct * (ambient() + diffuse(Nf)));
k3d/share/shaders/k3d_water.sl:2: * water.sl -- water surface, using ray tracing.

k3d/share/shaders/k3d_water.sl:6: * note : This is very similar to shiny.sl with a slight modification to give it a

k3d/share/shaders/k3d_water.sl:9: * modified by Lawrence D. Chin, cs184-bo

k3d/share/shaders/k3d_water.sl:14: *   reflections of the environment.

k3d/share/shaders/k3d_water.sl:18: *    Kr - coefficient for mirror-like reflections of environment

k3d/share/shaders/k3d_water.sl:19: *    blur - how blurry are the reflections? (0 = perfectly sharp)

k3d/share/shaders/k3d_water.sl:20: *    samples - set to higher than 1 for oversampling of blur

k3d/share/shaders/k3d_water.sl:27: * last modified 25 Jan 1994 by Larry Gritz

k3d/share/shaders/k3d_water.sl:30:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - \

k3d/share/shaders/k3d_water.sl:31:                           smoothstep((b)-(fuzz),(b),(x)))

k3d/share/shaders/k3d_water.sl:33:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))

k3d/share/shaders/k3d_water.sl:35:surface

k3d/share/shaders/k3d_water.sl:36:k3d_water ( float Ka = 0, Kd = 0, Ks = 1;

k3d/share/shaders/k3d_water.sl:37:	float Kr = 1, roughness = 0, blur = 0;

k3d/share/shaders/k3d_water.sl:39:	float samples = 0,

k3d/share/shaders/k3d_water.sl:40:        radius = 8,           /* radius of ring */

k3d/share/shaders/k3d_water.sl:41:        half_width = 0.1;      /* half width of ring */

k3d/share/shaders/k3d_water.sl:46:    normal Nf;               /* Forward facing normal vector */

k3d/share/shaders/k3d_water.sl:48:    vector uoffset, voffset; /* Offsets for blur */

k3d/share/shaders/k3d_water.sl:49:    color surface_color,     /* Resulting color */

k3d/share/shaders/k3d_water.sl:50:          ev;                /* Color of the reflections */

k3d/share/shaders/k3d_water.sl:52:    uniform float i, j;

k3d/share/shaders/k3d_water.sl:54:    /* Construct a forward facing surface normal */

k3d/share/shaders/k3d_water.sl:55:    Nf = faceforward (normalize(N), I);

k3d/share/shaders/k3d_water.sl:59:    /* Calculate the reflection color */

k3d/share/shaders/k3d_water.sl:60:    if (Kr > 0.001) {

k3d/share/shaders/k3d_water.sl:61:	/* Rdir gets the perfect reflection direction */

k3d/share/shaders/k3d_water.sl:62:	Rdir = normalize (reflect (IN, Nf));

k3d/share/shaders/k3d_water.sl:63:	if (blur > 0) {

k3d/share/shaders/k3d_water.sl:65:	    uoffset = blur * normalize (vector (zcomp(Rdir) - ycomp(Rdir),

k3d/share/shaders/k3d_water.sl:68:	    voffset = Rdir ^ uoffset;

k3d/share/shaders/k3d_water.sl:69:	    for (i = 0;  i < samples;  i += 1) {

k3d/share/shaders/k3d_water.sl:70:		for (j = 0;  j < samples;  j += 1) {

k3d/share/shaders/k3d_water.sl:71:		    /* Add a random offset to the smooth reflection vector */

k3d/share/shaders/k3d_water.sl:73:			((i + float random())/samples - 0.5) * uoffset +

k3d/share/shaders/k3d_water.sl:74:			((j + float random())/samples - 0.5) * voffset;

k3d/share/shaders/k3d_water.sl:85:    surface_color = Os * ( Cs * (Ka*ambient() + Kd*diffuse(Nf)) +

k3d/share/shaders/k3d_water.sl:86:		specularcolor * (ev + Ks*specular(Nf,-IN,roughness)));

k3d/share/shaders/k3d_water.sl:93:    float fuzz = 0.025;

k3d/share/shaders/k3d_water.sl:95:    float d;

k3d/share/shaders/k3d_water.sl:97:    center = (0.5, 0.5, 0);  /* position of ring */

k3d/share/shaders/k3d_water.sl:99:    layer_opac = pulse(radius - half_width, radius + half_width, fuzz, d);

k3d/share/shaders/k3d_water.sl:100:    surface_color = blend(surface_color, layer_color, layer_opac);

k3d/share/shaders/k3d_water.sl:102:    Ci = surface_color;

k3d/share/shaders/k3d_watercolor.sl:2: *	The shader exploits that fact that the Renderman interface already

k3d/share/shaders/k3d_watercolor.sl:4: *	R, T, ^nr, and ^nt using the surface normal, incident direction

k3d/share/shaders/k3d_watercolor.sl:5: *	vector, and index of refraction. The shader for the air-to-water 

k3d/share/shaders/k3d_watercolor.sl:6: * 	case is as follows:

k3d/share/shaders/k3d_watercolor.sl:10:surface k3d_watercolor(

k3d/share/shaders/k3d_watercolor.sl:14:	float nSnell = 1.34;

k3d/share/shaders/k3d_watercolor.sl:15:	float Kdiffuse = 0.91;

k3d/share/shaders/k3d_watercolor.sl:19:	float reflectivity;

k3d/share/shaders/k3d_watercolor.sl:22:	float costhetai = abs(nI . nN);

k3d/share/shaders/k3d_watercolor.sl:23:	float thetai = acos(costhetai);

k3d/share/shaders/k3d_watercolor.sl:24:	float sinthetat = sin(thetai)/nSnell;

k3d/share/shaders/k3d_watercolor.sl:25:	float thetat = asin(sinthetat);

k3d/share/shaders/k3d_watercolor.sl:26:	if(thetai == 0.0)

k3d/share/shaders/k3d_watercolor.sl:28:		reflectivity = (nSnell - 1)/(nSnell + 1);

k3d/share/shaders/k3d_watercolor.sl:29:		reflectivity = reflectivity * reflectivity;

k3d/share/shaders/k3d_watercolor.sl:33:		float fs = sin(thetat - thetai) / sin(thetat + thetai);

k3d/share/shaders/k3d_watercolor.sl:34:		float ts = tan(thetat - thetai) / tan(thetat + thetai);

k3d/share/shaders/k3d_watercolor.sl:35:		reflectivity = 0.5 * ( fs*fs + ts*ts );

k3d/share/shaders/k3d_watercolor.sl:38:	float dist = length(dPE) * Kdiffuse;

k3d/share/shaders/k3d_watercolor.sl:41:	if(envmap != "")

k3d/share/shaders/k3d_watercolor.sl:45:	Ci = dist * ( reflectivity * sky + (1-reflectivity) * upwelling ) + (1-dist)* air;

k3d/share/shaders/k3d_waterdisplacement.sl:2: *	P			surface position

k3d/share/shaders/k3d_waterdisplacement.sl:3: *	N			surface geometric normal

k3d/share/shaders/k3d_waterdisplacement.sl:4: *	s, t		surface texture coordinates

k3d/share/shaders/k3d_waterdisplacement.sl:5: *	Ng			surface geometric normal

k3d/share/shaders/k3d_waterdisplacement.sl:6: *	u,v			surface parameters

k3d/share/shaders/k3d_waterdisplacement.sl:7: *	du, dv		change in u, v across the surface

k3d/share/shaders/k3d_waterdisplacement.sl:9: *	I			direction of ray stricking a surface point (from the camera)

k3d/share/shaders/k3d_waterdisplacement.sl:10: *	E			position of the camera

k3d/share/shaders/k3d_waterdisplacement.sl:13:displacement k3d_waterdisplacement (float Km = 1.0; string bumpmap = "")

k3d/share/shaders/k3d_waterdisplacement.sl:15:	float	hump;

k3d/share/shaders/k3d_waterdisplacement.sl:18:	/* STEP 1 - Make a copy of the surface normal */

k3d/share/shaders/k3d_waterdisplacement.sl:21:	/* STEP 2 - Calculate an appropriate value for the displacement */

k3d/share/shaders/k3d_waterdisplacement.sl:22:	if (bumpmap != "")

k3d/share/shaders/k3d_waterdisplacement.sl:25:	/* STEP 3 - Calculate a new position of the surface point, "P" */

k3d/share/shaders/k3d_waterdisplacement.sl:28:	/* STEP 4 - Recalculate the surface normal */

k3d/share/shaders/k3d_waterlight.sl:5:A cheap trick to simulate underwater caustics - best used for deep-sea effects
k3d/share/shaders/k3d_waterlight.sl:11:	float minimum_intensity = 0.3;
k3d/share/shaders/k3d_waterlight.sl:12:	float maximum_intensity = 1.0;
k3d/share/shaders/k3d_waterlight.sl:13:	float frequency = 1;
k3d/share/shaders/k3d_waterlight.sl:14:	float phase = 0;
k3d/share/shaders/k3d_waterlight.sl:17:	float  samples=16;
k3d/share/shaders/k3d_waterlight.sl:18:	float  blur=.01;
k3d/share/shaders/k3d_waterlight.sl:19:	float  bias=.01;
k3d/share/shaders/k3d_waterlight.sl:24:			Cl = mix(minimum_intensity, maximum_intensity, float noise(frequency * Ps)) * lightcolor;
k3d/share/shaders/k3d_waterlight.sl:27:	if(shadowname != "")
k3d/share/shaders/k3d_windowlight.sl:6: *   diverge or falloff.
k3d/share/shaders/k3d_windowlight.sl:9: *   intensity - overall intensity scaling of the light
k3d/share/shaders/k3d_windowlight.sl:10: *   lightcolor - overall color filtering for the light
k3d/share/shaders/k3d_windowlight.sl:11: *   center - the spatial position of the center of the window
k3d/share/shaders/k3d_windowlight.sl:12: *   up, in - vectors which define the orientation of the window
k3d/share/shaders/k3d_windowlight.sl:13: *   from, to - the direction that the light falls
k3d/share/shaders/k3d_windowlight.sl:14: *   hpanes, vpanes - number of horizontal and vertical panes
k3d/share/shaders/k3d_windowlight.sl:15: *   panewidth, paneheight - width/height of the individual panes
k3d/share/shaders/k3d_windowlight.sl:16: *   fuzz - controls the fading out near the edges
k3d/share/shaders/k3d_windowlight.sl:17: *   framewidth, frameheight - how thick are the window frame "bars",
k3d/share/shaders/k3d_windowlight.sl:18: *               as percentage of panewidth/paneheight
k3d/share/shaders/k3d_windowlight.sl:20: * Author:  Larry Gritz, with inspiration from [Upstill]
k3d/share/shaders/k3d_windowlight.sl:28:light k3d_windowlight(float intensity = 1;
k3d/share/shaders/k3d_windowlight.sl:31:		      point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_windowlight.sl:36:		      float hpanes = 2, vpanes = 3;
k3d/share/shaders/k3d_windowlight.sl:37:		      float panewidth = 6, paneheight = 6;
k3d/share/shaders/k3d_windowlight.sl:38:		      float framewidth = .1, frameheight = .1;
k3d/share/shaders/k3d_windowlight.sl:39:		      float fuzz = 0.25;
k3d/share/shaders/k3d_windowlight.sl:42:  uniform vector inv, right, upv;
k3d/share/shaders/k3d_windowlight.sl:43:  uniform vector path;
k3d/share/shaders/k3d_windowlight.sl:44:  float offset, modulus, yfract, xfract;
k3d/share/shaders/k3d_windowlight.sl:45:  float d;
k3d/share/shaders/k3d_windowlight.sl:48:  path = normalize(from - to);
k3d/share/shaders/k3d_windowlight.sl:60:    offset = (PL - center).upv + paneheight * (vpanes / 2);
k3d/share/shaders/k3d_windowlight.sl:61:    if(offset > 0 && (offset / paneheight) < vpanes)
k3d/share/shaders/k3d_windowlight.sl:63:	modulus = mod(offset, paneheight);
k3d/share/shaders/k3d_windowlight.sl:64:	yfract =
k3d/share/shaders/k3d_windowlight.sl:65:	  filteredpulse(frameheight / 2, paneheight - frameheight / 2,
k3d/share/shaders/k3d_windowlight.sl:66:			modulus, fuzz);
k3d/share/shaders/k3d_windowlight.sl:69:      yfract = 0;
k3d/share/shaders/k3d_windowlight.sl:71:    offset = (PL - center).right + panewidth * (hpanes / 2);
k3d/share/shaders/k3d_windowlight.sl:72:    if(offset > 0 && (offset / panewidth) < hpanes)
k3d/share/shaders/k3d_windowlight.sl:74:	modulus = mod(offset, panewidth);
k3d/share/shaders/k3d_windowlight.sl:75:	xfract =
k3d/share/shaders/k3d_windowlight.sl:76:	  filteredpulse(framewidth / 2, panewidth - framewidth / 2, modulus,
k3d/share/shaders/k3d_windowlight.sl:77:			fuzz);
k3d/share/shaders/k3d_windowlight.sl:80:      xfract = 0;
k3d/share/shaders/k3d_windowlight.sl:81:    Cl = intensity * mix(darkcolor, lightcolor, yfract * xfract);
k3d/share/shaders/k3d_windywave.sl:1:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_windywave.sl:3:displacement k3d_windywave(float Km = 0.1; float txtscale = 1;
k3d/share/shaders/k3d_windywave.sl:4:			   float windfreq = 0.5; float windamp = 1;
k3d/share/shaders/k3d_windywave.sl:5:			   float minwind = 0.3)
k3d/share/shaders/k3d_windywave.sl:7:  float offset;
k3d/share/shaders/k3d_windywave.sl:9:  float wind;
k3d/share/shaders/k3d_windywave.sl:10:  float turb, a, i;
k3d/share/shaders/k3d_windywave.sl:12:  PP = txtscale * windfreq * transform("shader", P);
k3d/share/shaders/k3d_windywave.sl:14:  offset = Km * (snoise(PP) + 0.5 * snoise(2 * PP));
k3d/share/shaders/k3d_windywave.sl:19:  for(i = 0; i < 4; i += 1)
k3d/share/shaders/k3d_windywave.sl:27:/*  P += wind * offset * normalize(N); */
k3d/share/shaders/k3d_windywave.sl:28:  N = calculatenormal(P + wind * offset * normalize(N));
k3d/share/shaders/k3d_wood2.sl:2: * wood2.sl -- another surface shader for wood.
k3d/share/shaders/k3d_wood2.sl:9: *   txtscale - overall scaling factor for the texture
k3d/share/shaders/k3d_wood2.sl:10: *   ringscale - scaling for the ring spacing
k3d/share/shaders/k3d_wood2.sl:11: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_wood2.sl:12: *   grainy - relative graininess (0 = no fine grain)
k3d/share/shaders/k3d_wood2.sl:21:surface k3d_wood2(float Ka = 1, Kd = .75, Ks = .4;
k3d/share/shaders/k3d_wood2.sl:22:		  float roughness = .1;
k3d/share/shaders/k3d_wood2.sl:24:		  float ringscale = 15;
k3d/share/shaders/k3d_wood2.sl:25:		  float txtscale = 1;
k3d/share/shaders/k3d_wood2.sl:27:		  color darkwood = color(0.35, 0.22, 0.08); float grainy = 1;)
k3d/share/shaders/k3d_wood2.sl:30:  normal Nf;			/* forward facing normal */
k3d/share/shaders/k3d_wood2.sl:31:  color Ct;			/* surface color of the wood */
k3d/share/shaders/k3d_wood2.sl:32:  float r, r2;
k3d/share/shaders/k3d_wood2.sl:33:  float my_t;
k3d/share/shaders/k3d_wood2.sl:36:  PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_wood2.sl:44:  r -= floor(r);
k3d/share/shaders/k3d_wood2.sl:47:  /* \/--  extra line added for fine grain */
k3d/share/shaders/k3d_wood2.sl:57:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_wood2.sl:60:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_wood2.sl:61:	  specularcolor * Ks * specular(Nf, -normalize(I), roughness));
k3d/share/shaders/k3d_woodcut.sl:2: surface k3d_woodcut (
k3d/share/shaders/k3d_woodcut.sl:4:float ringscale=5; 
k3d/share/shaders/k3d_woodcut.sl:5:float contrast=0.3; 
k3d/share/shaders/k3d_woodcut.sl:6:float brightness=0.75; 
k3d/share/shaders/k3d_woodcut.sl:7:float random=0; 
k3d/share/shaders/k3d_woodcut.sl:8:float nsize=5; ) { 
k3d/share/shaders/k3d_woodcut.sl:9:#define snoise(x) (2*noise(x)-1) 
k3d/share/shaders/k3d_woodcut.sl:10:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_woodcut.sl:11:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_woodcut.sl:13:color surface_color, layer_color;
k3d/share/shaders/k3d_woodcut.sl:14:color surface_opac, layer_opac, Cr;
k3d/share/shaders/k3d_woodcut.sl:15:float fuzz = 0.3;
k3d/share/shaders/k3d_woodcut.sl:16:float stripemin, stripemax, tt;
k3d/share/shaders/k3d_woodcut.sl:17:float y, z, i, n, ns;
k3d/share/shaders/k3d_woodcut.sl:18:float tfreq = 50;
k3d/share/shaders/k3d_woodcut.sl:21:float illumination = 0.0;
k3d/share/shaders/k3d_woodcut.sl:22:float Ka = 0.10;
k3d/share/shaders/k3d_woodcut.sl:23:float Kd = 0.70;
k3d/share/shaders/k3d_woodcut.sl:24:float Ks = 0.20;
k3d/share/shaders/k3d_woodcut.sl:25:vector Nf, V; 
k3d/share/shaders/k3d_woodcut.sl:27:float roughness = 0.2;
k3d/share/shaders/k3d_woodcut.sl:29:Psh = transform("shader", P);
k3d/share/shaders/k3d_woodcut.sl:31:Nf = faceforward( normalize(N), I );
k3d/share/shaders/k3d_woodcut.sl:34:if (up == "z") { 
k3d/share/shaders/k3d_woodcut.sl:45:illumcolor = (Ka*ambient() + Kd*diffuse(Nf) + Ks*specular(Nf,V,roughness));
k3d/share/shaders/k3d_woodcut.sl:50:for (i = 0; i < 6.0; i += 1.0) {
k3d/share/shaders/k3d_woodcut.sl:59:if (illumination < 0.01) {
k3d/share/shaders/k3d_woodcut.sl:60:surface_color = color (0.0, 0.0, 0.0);
k3d/share/shaders/k3d_woodcut.sl:63:else if (illumination > 0.99) {
k3d/share/shaders/k3d_woodcut.sl:64:surface_color = color (1.0, 1.0, 1.0);
k3d/share/shaders/k3d_woodcut.sl:68:surface_color = color (0.0, 0.0, 0.0);
k3d/share/shaders/k3d_woodcut.sl:71:surface_opac = 1.0;
k3d/share/shaders/k3d_woodcut.sl:76:float val = pulse(stripemin, stripemax, fuzz, tt);
k3d/share/shaders/k3d_woodcut.sl:78:surface_color = blend(surface_color, layer_color, layer_opac);
k3d/share/shaders/k3d_woodcut.sl:79:float color_val = mix(0.0, 1.0, val);
k3d/share/shaders/k3d_woodcut.sl:87: float spacescale = length(vtransform("shader", normalize(N)));
k3d/share/shaders/k3d_woodcut.sl:91: Ci = surface_opac * Cr; Oi = 1; }
