k3d/share/shaders/k3d_altitude_fog.sl:4:	color background = 0;
k3d/share/shaders/k3d_altitude_fog.sl:7:	point PP = transform("world", P);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_ambientlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_ambientlight.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_ambientlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_ambientlight.sl:11:color lightcolor = 1;
k3d/share/shaders/k3d_ambientlight.sl:14:  Cl = intensity * lightcolor;
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:6: *   look great even at only one sample per pixel.
k3d/share/shaders/k3d_antialiasedchecks.sl:9: *   Ka, Kd	    	work just like the matte shader
k3d/share/shaders/k3d_antialiasedchecks.sl:10: *   color1, color2     these are the colors which make the pattern
k3d/share/shaders/k3d_antialiasedchecks.sl:11: *   frequency		determines the frequency (in s-t space) of the checks
k3d/share/shaders/k3d_antialiasedchecks.sl:14: * AUTHOR: written by Larry Gritz
k3d/share/shaders/k3d_antialiasedchecks.sl:17: *      27 Jan 1994 -- written by lg
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:27:	   color color1 = 0, color2 = 1; 
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:35:  float Nfactor;        /* Multiplicative factor for AA due to normal */
k3d/share/shaders/k3d_antialiasedchecks.sl:38:  Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_antialiasedchecks.sl:40:  /* Determine how wide in s-t space one pixel projects to */
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:50:  /* Get the place in the pattern where we're sampling */
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:58:      checkcolor = mix (color1, color2, x*y + (1-x)*(1-y));
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:62:  else { /* otherwise, only use the average color */
k3d/share/shaders/k3d_antialiasedchecks.sl:63:      Ci = (color1 + color2) / 2;
k3d/share/shaders/k3d_antialiasedchecks.sl:66:  /* Use the matte reflectance formula */
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:9: *   intensity, lightcolor - same meanings as pointlight
k3d/share/shaders/k3d_arealight.sl:13:light k3d_arealight(
k3d/share/shaders/k3d_arealight.sl:15:color lightcolor = 1;
k3d/share/shaders/k3d_arealight.sl:21:    Cl = (intensity / (L.L)) * lightcolor;
k3d/share/shaders/k3d_arealight.sl:25:   * approximately work for a flat light source whose normal points
k3d/share/shaders/k3d_arealight.sl:26:   * toward local +z.
k3d/share/shaders/k3d_arealight.sl:28:  vector Nl = normalize(vector "shader"(0, 0, 1));
k3d/share/shaders/k3d_arealight.sl:29:  illuminate(point "shader"(0, 0, 0), Nl, PI / 2)
k3d/share/shaders/k3d_arealight.sl:31:    Cl = (intensity * (Nl.normalize(L) / (L.L)) * lightcolor);
k3d/share/shaders/k3d_background.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
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:13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
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:21:		\author Tim Shead (tshead@k-3d.com)
k3d/share/shaders/k3d_background.sl:24:/// Simplified from the original by Larry Gritz
k3d/share/shaders/k3d_background.sl:26:imager k3d_background(
k3d/share/shaders/k3d_background.sl:27:color bgcolor = color(1, 1, 1)
k3d/share/shaders/k3d_background.sl:30:  Ci += (1 - alpha) * bgcolor;
k3d/share/shaders/k3d_bluemarble.sl:1:/* I took wave's lead and renamed bluemarb to DPBlueMarble.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_bluemarble.sl:4: * bluemarb.sl
k3d/share/shaders/k3d_bluemarble.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_bluemarble.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_bluemarble.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_bluemarble.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_bluemarble.sl:14:#include "k3d_proctext.h"
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:22:color
k3d/share/shaders/k3d_bluemarble.sl:23:marble_color(float m)
k3d/share/shaders/k3d_bluemarble.sl:25:    return color spline(
k3d/share/shaders/k3d_bluemarble.sl:35:surface
k3d/share/shaders/k3d_bluemarble.sl:36:k3d_bluemarble(
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:44:    color Ct;
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:57:    Ct = marble_color(marble);
k3d/share/shaders/k3d_bluemarble.sl:60:        + Ks * specular(NN, normalize(-I), roughness));
k3d/share/shaders/k3d_bluescreen.sl:2: * bluescreen.sl
k3d/share/shaders/k3d_bluescreen.sl:3: *   puts a background color behind an image.
k3d/share/shaders/k3d_bluescreen.sl:6: *   background - the color of the background
k3d/share/shaders/k3d_bluescreen.sl:9:imager k3d_bluescreen (
k3d/share/shaders/k3d_bluescreen.sl:11:color background = color(0.0, 0.0, 1.0); 
k3d/share/shaders/k3d_bluescreen.sl:12:string texturename = ""
k3d/share/shaders/k3d_bluescreen.sl:15:float resolution[3];
k3d/share/shaders/k3d_bluescreen.sl:17:color tex;
k3d/share/shaders/k3d_bluescreen.sl:19:    if (option("Format", resolution) == 1.0) {
k3d/share/shaders/k3d_bluescreen.sl:20:       lenx = xcomp(P)/ resolution[0];
k3d/share/shaders/k3d_bluescreen.sl:21:       leny = ycomp(P)/ resolution[1];
k3d/share/shaders/k3d_bluescreen.sl:24:    if (texturename != "") {
k3d/share/shaders/k3d_bluescreen.sl:25:	tex = texture(texturename, lenx, leny);
k3d/share/shaders/k3d_bluescreen.sl:29:       Ci+=(1-alpha)*background;
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:6: *   looking staggered brick masonry.  It is especially convincing when
k3d/share/shaders/k3d_brick.sl:7: *   used in conjunction with the "brickbump" displacement shader (and
k3d/share/shaders/k3d_brick.sl:8: *   identical parameters).  Every other row of bricks is staggered.
k3d/share/shaders/k3d_brick.sl:9: *   The staggering isn't exact, however, and this variance is controlled
k3d/share/shaders/k3d_brick.sl:10: *   by the "rowvary" parameter.
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:16: *     				   brick to brick?
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:23: * AUTHOR: written by Larry Gritz, gritzl@acm.org
k3d/share/shaders/k3d_brick.sl:27:#include "k3d_patterns.h"
k3d/share/shaders/k3d_brick.sl:29:surface k3d_brick(
k3d/share/shaders/k3d_brick.sl:31:		  color brickcolor = color "rgb"(.6, .1, .1);
k3d/share/shaders/k3d_brick.sl:32:		  color mortarcolor = color "rgb"(.6, .6, .6);
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: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:43:  color bcolor, Ct;
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: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:55:  /* Determine how wide in s-t space one pixel projects to, relative
k3d/share/shaders/k3d_brick.sl:56:   * the the width and height of a brick.  Overestimate the filter
k3d/share/shaders/k3d_brick.sl:57:   * size by a bit -- it makes the transitions between brick and mortar
k3d/share/shaders/k3d_brick.sl:58:   * a bit smoother.
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:63:  basicbrick(s, t, BMWIDTH, BMHEIGHT, 0.5, 0.2, 1, jagged, sbrick, tbrick, ss,
k3d/share/shaders/k3d_brick.sl:66:  /* Make the edges ragged, but different for each brick */
k3d/share/shaders/k3d_brick.sl:67:  whichbrick = 103 * sbrick + tbrick;
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:86:      clamp(filteredpulse(MWF, 1 - MWF, ss, swidth), max(1 - MWF / swidth, 0),
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:99:      /* We're in the top horizontal groove */
k3d/share/shaders/k3d_brick.sl:100:      disp = groovedepth * (sqr((tt) / MHF) - 1);
k3d/share/shaders/k3d_brick.sl:104:      /* Bottom horizontal groove */
k3d/share/shaders/k3d_brick.sl:105:      disp = groovedepth * (sqr((1 - tt) / MHF) - 1);
k3d/share/shaders/k3d_brick.sl:109:      disp = min(disp, 0.85 * groovedepth * (sqr(ss / MWF) - 1));
k3d/share/shaders/k3d_brick.sl:113:      disp = min(disp, 0.85 * groovedepth * (sqr((1 - ss) / MWF) - 1));
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:125:  P += disp * normalize(N);
k3d/share/shaders/k3d_brick.sl:126:  N = calculatenormal(P);
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:131:  bcolor = brickcolor * (1 + (brickvary * snoise(whichbrick + 0.5)));
k3d/share/shaders/k3d_brick.sl:133:  Ct = mix(mortarcolor, bcolor, w * h);
k3d/share/shaders/k3d_brick2.sl:1:/* I took wave's lead and renamed brick to DPBrick.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brick2.sl:4: * brick.sl
k3d/share/shaders/k3d_brick2.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_brick2.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_brick2.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_brick2.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_brick2.sl:14:#include "k3d_proctext.h"
k3d/share/shaders/k3d_brick2.sl:25:surface
k3d/share/shaders/k3d_brick2.sl:26:k3d_brick2(
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:33:    color Ct;
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:41:    ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brick2.sl:42:    tt = tcoord / BMHEIGHT;
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:48:    ss -= sbrick;
k3d/share/shaders/k3d_brick2.sl:49:    tt -= tbrick;
k3d/share/shaders/k3d_brick2.sl:53:    Ct = mix(Cmortar, Cbrick, w*h);
k3d/share/shaders/k3d_brick2.sl:55:    /* diffuse reflection model */
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:6: *   looking staggered brick masonry.  It is especially convincing when
k3d/share/shaders/k3d_brick3.sl:7: *   used in conjunction with the "brickbump" displacement shader (and
k3d/share/shaders/k3d_brick3.sl:8: *   identical parameters).  Every other row of bricks is staggered.
k3d/share/shaders/k3d_brick3.sl:9: *   The staggering isn't exact, however, and this variance is controlled
k3d/share/shaders/k3d_brick3.sl:10: *   by the "rowvary" parameter.
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:16: *     				   brick to brick?
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:23: * AUTHOR: written by Larry Gritz, 1992
k3d/share/shaders/k3d_brick3.sl:24: * 	This shader is very similar to (and based upon) brick shaders
k3d/share/shaders/k3d_brick3.sl:25: *	by Darwyn Peachey.
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:30: *      12 Jan 1994 -- recoded by lg in correct shading language.
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:38:k3d_brick3 ( 
k3d/share/shaders/k3d_brick3.sl:40:	color brickcolor = color "rgb" (.6,.1,.1);
k3d/share/shaders/k3d_brick3.sl:41:	color mortarcolor = color "rgb" (.6,.6,.6);
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:55:  color bcolor, Ct;
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:60:  float Nfactor;
k3d/share/shaders/k3d_brick3.sl:62:  /* Determine how wide in s-t space one pixel projects to */
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:70:  scoord = s + jagged * xcomp (PP2);
k3d/share/shaders/k3d_brick3.sl:71:  tcoord = t + jagged * ycomp (PP2);
k3d/share/shaders/k3d_brick3.sl:73:  ss = scoord / BMWIDTH;   /* Determine which brick the point is in */
k3d/share/shaders/k3d_brick3.sl:74:  tt = tcoord / BMHEIGHT;  /*                   "                   */
k3d/share/shaders/k3d_brick3.sl:78:  /* shift alternate rows */
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:84:  ss += rowvary * (noise (tbrick+0.5) - 0.5);
k3d/share/shaders/k3d_brick3.sl:86:  sbrick = floor (ss);   /* which brick column? */
k3d/share/shaders/k3d_brick3.sl:87:  ss -= sbrick;          /* Now ss and tt are coords within the brick */
k3d/share/shaders/k3d_brick3.sl:88:  tt -= tbrick;
k3d/share/shaders/k3d_brick3.sl:90:  /* Choose a color for the surface */
k3d/share/shaders/k3d_brick3.sl:101:  /* Choose a brick color that varies from brick to brick */
k3d/share/shaders/k3d_brick3.sl:102:  bcolor = brickcolor * (1 + (brickvary * snoise (tbrick+(100*sbrick)+0.5)));
k3d/share/shaders/k3d_brick3.sl:104:  Ct = mix (mortarcolor, bcolor, w*h);
k3d/share/shaders/k3d_brickanti.sl:1:/* I took wave's lead and renamed brickant to DPBrickAnti.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brickanti.sl:4: * brickant.sl
k3d/share/shaders/k3d_brickanti.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_brickanti.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_brickanti.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_brickanti.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_brickanti.sl:15:#include "k3d_proctext.h"
k3d/share/shaders/k3d_brickanti.sl:26:surface
k3d/share/shaders/k3d_brickanti.sl:27:k3d_brickanti(
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:34:    color Ct;
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:41:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickanti.sl:43:    ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brickanti.sl:44:    tt = tcoord / BMHEIGHT;
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:56:    ss -= sbrick;
k3d/share/shaders/k3d_brickanti.sl:57:    tt -= tbrick;
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:72:    w = (sintegral(ss+swidth) - sintegral(ss))/swidth;
k3d/share/shaders/k3d_brickanti.sl:73:    h = (tintegral(tt+twidth) - tintegral(tt))/twidth;
k3d/share/shaders/k3d_brickanti.sl:76:    Ct = mix(Cmortar, Cbrick, w*h);
k3d/share/shaders/k3d_brickanti.sl:78:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickbump.sl:2: * brickbump.sl -- displacement shader for bricks.
k3d/share/shaders/k3d_brickbump.sl:4: * Description:
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:10: *   or your bricks will look very strange.
k3d/share/shaders/k3d_brickbump.sl:12: * Parameters:
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:19: *                                 the bricks.
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:27:#include "k3d_patterns.h"
k3d/share/shaders/k3d_brickbump.sl:29:displacement k3d_brickbump(
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: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:46:  basicbrick(s, t, BMWIDTH, BMHEIGHT, 0.5, 0.2, 1, jagged, sbrick, tbrick, ss,
k3d/share/shaders/k3d_brickbump.sl:53:      /* We're in the top horizontal groove */
k3d/share/shaders/k3d_brickbump.sl:54:      disp = groovedepth * (sqr((tt) / MHF) - 1);
k3d/share/shaders/k3d_brickbump.sl:58:      /* Bottom horizontal groove */
k3d/share/shaders/k3d_brickbump.sl:59:      disp = groovedepth * (sqr((1 - tt) / MHF) - 1);
k3d/share/shaders/k3d_brickbump.sl:63:      disp = min(disp, 0.85 * groovedepth * (sqr(ss / MWF) - 1));
k3d/share/shaders/k3d_brickbump.sl:67:      disp = min(disp, 0.85 * groovedepth * (sqr((1 - ss) / MWF) - 1));
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_brickbump.sl:79:  P += disp * normalize(N);
k3d/share/shaders/k3d_brickbump.sl:80:  N = calculatenormal(P);
k3d/share/shaders/k3d_brickbump2.sl:1:/* I took wave's lead and renamed brickbum to DPBrickbump.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brickbump2.sl:4: * brickbum.sl
k3d/share/shaders/k3d_brickbump2.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_brickbump2.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_brickbump2.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_brickbump2.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_brickbump2.sl:14:#include "k3d_proctext.h"
k3d/share/shaders/k3d_brickbump2.sl:25:surface
k3d/share/shaders/k3d_brickbump2.sl:26:k3d_brickbump2(
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:33:    color Ct;
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:40:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickbump2.sl:42:    ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brickbump2.sl:43:    tt = tcoord / BMHEIGHT;
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:49:    ss -= sbrick;
k3d/share/shaders/k3d_brickbump2.sl:50:    tt -= tbrick;
k3d/share/shaders/k3d_brickbump2.sl:54:    Ct = mix(Cmortar, Cbrick, w*h);
k3d/share/shaders/k3d_brickbump2.sl:56:    /* compute bump-mapping function for mortar grooves */
k3d/share/shaders/k3d_brickbump2.sl:61:    /* compute shading normal */
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_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:10: *   or your bricks will look very strange.
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:19: *                                 the bricks.
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:23: * AUTHOR: written by Larry Gritz, 1992
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:27: *      12 Jan 1994 -- recoded by lg in correct shading language.
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:34:  You may note the companion shaders "brick" and "brickbump".
k3d/share/shaders/k3d_brickbump3.sl:36:  They're meant to go together, but I like to use the brickbump
k3d/share/shaders/k3d_brickbump3.sl:37:  displacement shader with the matte surface shader.  With appropriate
k3d/share/shaders/k3d_brickbump3.sl:38:  parameters, it looks *exactly* like those painted cinderblock walls
k3d/share/shaders/k3d_brickbump3.sl:39:  (we have a wall in our lab like this).  
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:44:  Displacement "brickbump" "brickwidth" 0.5 "brickheight" 0.25 
k3d/share/shaders/k3d_brickbump3.sl:45:	       "mortarthickness" 0.02 "pitting" 0.015 "pockfrequency" 12
k3d/share/shaders/k3d_brickbump3.sl:46:   	       "groovedepth" 0.015
k3d/share/shaders/k3d_brickbump3.sl:50:k3d_brickbump3 ( 
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: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:70:  scoord = s;  tcoord = t;
k3d/share/shaders/k3d_brickbump3.sl:72:  /* Make the shapes of the bricks vary just a bit */
k3d/share/shaders/k3d_brickbump3.sl:74:  scoord = s + jagged * xcomp (PP2);
k3d/share/shaders/k3d_brickbump3.sl:75:  tcoord = t + jagged * ycomp (PP2);
k3d/share/shaders/k3d_brickbump3.sl:77:  ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brickbump3.sl:78:  tt = tcoord / BMHEIGHT;
k3d/share/shaders/k3d_brickbump3.sl:80:  /* shift alternate rows */
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:86:  ss += rowvary * (noise (tbrick+0.5) - 0.5);
k3d/share/shaders/k3d_brickbump3.sl:88:  sbrick = floor (ss);   /* which brick column? */
k3d/share/shaders/k3d_brickbump3.sl:89:  ss -= sbrick;          /* Now ss and tt are coords within the brick */
k3d/share/shaders/k3d_brickbump3.sl:90:  tt -= tbrick;
k3d/share/shaders/k3d_brickbump3.sl:95:      /* We're in the top horizontal groove */
k3d/share/shaders/k3d_brickbump3.sl:96:      disp = groovedepth * (sqr((tt)/MHF) - 1);
k3d/share/shaders/k3d_brickbump3.sl:99:      /* Bottom horizontal groove */
k3d/share/shaders/k3d_brickbump3.sl:100:      disp = groovedepth * (sqr((1-tt)/MHF) - 1);
k3d/share/shaders/k3d_brickbump3.sl:103:      disp = 0.75 * groovedepth * (sqr(ss/MWF) - 1);
k3d/share/shaders/k3d_brickbump3.sl:106:      disp = 0.75 * groovedepth * (sqr((1-ss)/MWF) - 1);
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_brickbump3.sl:115:  P += disp * normalize(N);
k3d/share/shaders/k3d_brickbump3.sl:116:  N = calculatenormal (P);
k3d/share/shaders/k3d_brickperturb.sl:1:/* I took wave's lead and renamed brickper to DPBrickperturb.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brickperturb.sl:4: * brickper.sl
k3d/share/shaders/k3d_brickperturb.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_brickperturb.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_brickperturb.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_brickperturb.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_brickperturb.sl:14:#include "k3d_proctext.h"
k3d/share/shaders/k3d_brickperturb.sl:25:surface
k3d/share/shaders/k3d_brickperturb.sl:26:k3d_brickperturb(
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:33:    color Ct;
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:41:    ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brickperturb.sl:42:    tt = tcoord / BMHEIGHT;
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:47:    ss += 0.1 * snoise(tbrick+0.5);
k3d/share/shaders/k3d_brickperturb.sl:48:    sbrick = floor(ss); /* which brick? */
k3d/share/shaders/k3d_brickperturb.sl:49:    ss -= sbrick;
k3d/share/shaders/k3d_brickperturb.sl:50:    tt -= tbrick;
k3d/share/shaders/k3d_brickperturb.sl:54:    Ct = mix(Cmortar, Cbrick, w*h);
k3d/share/shaders/k3d_brickperturb.sl:56:    /* diffuse reflection model */
k3d/share/shaders/k3d_brushedmetal.sl:2: * brushedmetal.sl
k3d/share/shaders/k3d_brushedmetal.sl:4: * Description:
k3d/share/shaders/k3d_brushedmetal.sl:5: *   Simple anisotropic metal shader.
k3d/share/shaders/k3d_brushedmetal.sl:7: * Parameters:
k3d/share/shaders/k3d_brushedmetal.sl:9: *   uroughness, vroughness - separate roughnesses for u and v directions
k3d/share/shaders/k3d_brushedmetal.sl:11: * Author: Larry Gritz (gritzl@acm.org)
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:18:#include "k3d_material.h"
k3d/share/shaders/k3d_brushedmetal.sl:20:surface k3d_brushedmetal(
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_brushedmetal.sl:28:			 vroughness);
k3d/share/shaders/k3d_brushedmetal2.sl:1:/*  IDbrushedmetal.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_brushedmetal2.sl:2: *  ivan@SpamSucks_martian-tools.com
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:6: *  yet another brushedmetal. This one computes a specular 
k3d/share/shaders/k3d_brushedmetal2.sl:7: *  highlight, and also can use a reflection map.
k3d/share/shaders/k3d_brushedmetal2.sl:8: *  stochasticly spreads the map, so it looks a little grainy.
k3d/share/shaders/k3d_brushedmetal2.sl:9: *  based somewhat on LGbrushedmetal.sl
k3d/share/shaders/k3d_brushedmetal2.sl:11: *  if you set Kr = 0 and specwidth = 10
k3d/share/shaders/k3d_brushedmetal2.sl:12: *  then assume specspread is roughness, then you have something 
k3d/share/shaders/k3d_brushedmetal2.sl:13: *  very similar to plastic.sl...
k3d/share/shaders/k3d_brushedmetal2.sl:16: *  Ks			- coefficient of specular
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:27: *			  angle in radians (i.e. PI*.5 = 90 degrees)
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:32:color
k3d/share/shaders/k3d_brushedmetal2.sl:33:anisospecular (vector VA; float specspread; float specwidth)
k3d/share/shaders/k3d_brushedmetal2.sl:36:    extern vector I;
k3d/share/shaders/k3d_brushedmetal2.sl:37:    extern normal N;
k3d/share/shaders/k3d_brushedmetal2.sl:38:    extern point P;
k3d/share/shaders/k3d_brushedmetal2.sl:41:    vector V = normalize(-I);
k3d/share/shaders/k3d_brushedmetal2.sl:42:    normal NN = normalize(N);
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:45:    point zro = 0;
k3d/share/shaders/k3d_brushedmetal2.sl:48:        extern vector L;  
k3d/share/shaders/k3d_brushedmetal2.sl:49:	extern color Cl;
k3d/share/shaders/k3d_brushedmetal2.sl:52:        lightsource ("__nonspecular", nonspec);
k3d/share/shaders/k3d_brushedmetal2.sl:54:            vector LN = normalize (L);
k3d/share/shaders/k3d_brushedmetal2.sl:55:	    vector H = normalize (V + LN);
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:61:    return C;
k3d/share/shaders/k3d_brushedmetal2.sl:64:surface
k3d/share/shaders/k3d_brushedmetal2.sl:65:k3d_brushedmetal2(
k3d/share/shaders/k3d_brushedmetal2.sl:69:		Kr		= .6,
k3d/share/shaders/k3d_brushedmetal2.sl:71:		specspread 	= .5,
k3d/share/shaders/k3d_brushedmetal2.sl:72:		mapspread 	= .3,
k3d/share/shaders/k3d_brushedmetal2.sl:74:	string	mapname 	= "";
k3d/share/shaders/k3d_brushedmetal2.sl:75:	color	specularcolor	=  1)
k3d/share/shaders/k3d_brushedmetal2.sl:77:	point Po = transform("object",P);
k3d/share/shaders/k3d_brushedmetal2.sl:78:	color ev = 0;
k3d/share/shaders/k3d_brushedmetal2.sl:79:	vector D, V= normalize(-I);
k3d/share/shaders/k3d_brushedmetal2.sl:80:	vector Nf, Ntmp;
k3d/share/shaders/k3d_brushedmetal2.sl:81:        point zro = 0;
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:85:	vector VA = rotate(normalize(dPdu), twist, zro, normalize(N));
k3d/share/shaders/k3d_brushedmetal2.sl:88:	Nf = faceforward(normalize(N), -I);
k3d/share/shaders/k3d_brushedmetal2.sl:92:	    for(i=0;i<=numsamples;i=i+1){
k3d/share/shaders/k3d_brushedmetal2.sl:93:	      jitter = (random()-.5)*Jspread;
k3d/share/shaders/k3d_brushedmetal2.sl:94:	      angle = PI*((i/numsamples)-.5)*mapspread;
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:98:	      ev += environment(mapname, D)*(.5-abs((i/numsamples)-.5))*.25;
k3d/share/shaders/k3d_brushedmetal2.sl:105:	specularcolor * Ks * anisospecular(VA, specspread*2, specwidth*.1)) +
k3d/share/shaders/k3d_brushedmetal2.sl:106:	ev * Kr;
k3d/share/shaders/k3d_brushedmetal3.sl:1:/* Renamed to LGbrushedmetal for RMR -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_brushedmetal3.sl:4: * Greg Ward Larson's anisotropic specular local illumination model.
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:15: *          tangent which is perpendicular to xdir.
k3d/share/shaders/k3d_brushedmetal3.sl:17:color
k3d/share/shaders/k3d_brushedmetal3.sl:18:LocIllumWardAnisotropic (normal N;  vector V;
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:24:    vector X = xdir / xroughness;
k3d/share/shaders/k3d_brushedmetal3.sl:25:    vector Y = (N ^ xdir) / yroughness;
k3d/share/shaders/k3d_brushedmetal3.sl:27:    color C = 0;
k3d/share/shaders/k3d_brushedmetal3.sl:28:    extern point P;
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:31:        extern vector L;  extern color Cl;
k3d/share/shaders/k3d_brushedmetal3.sl:33:        lightsource ("__nonspecular", nonspec);
k3d/share/shaders/k3d_brushedmetal3.sl:35:            vector LN = normalize (L);
k3d/share/shaders/k3d_brushedmetal3.sl:38:                vector H = normalize (V + LN);
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:40:                    / sqrt (cos_theta_i * cos_theta_r);
k3d/share/shaders/k3d_brushedmetal3.sl:41:                C += Cl * ((1-nonspec) * cos_theta_i * rho);
k3d/share/shaders/k3d_brushedmetal3.sl:45:    return C / (4 * xroughness * yroughness);
k3d/share/shaders/k3d_brushedmetal3.sl:50:surface
k3d/share/shaders/k3d_brushedmetal3.sl:51:k3d_brushedmetal3 ( 
k3d/share/shaders/k3d_brushedmetal3.sl:53:		float uroughness = 0.35, vroughness = 0.2; 
k3d/share/shaders/k3d_brushedmetal3.sl:54:		color basecolor = color (.5, .5, .5);
k3d/share/shaders/k3d_brushedmetal3.sl:57:    normal Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_brushedmetal3.sl:58:    vector xdir = normalize (dPdu);
k3d/share/shaders/k3d_brushedmetal3.sl:60:    color spec = LocIllumWardAnisotropic (Nf, -normalize(I),
k3d/share/shaders/k3d_brushedmetal3.sl:61:                                          xdir, uroughness, vroughness);
k3d/share/shaders/k3d_brushedmetal3.sl:62:    Ci = basecolor * (Ka*ambient() + Kd*diffuse(Nf) + Ks*spec);
k3d/share/shaders/k3d_bubbles.sl:4: * A simple semi-sphere carpet displacment
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:12:	float frequency = 1; /* number of bubbles per linear surface */
k3d/share/shaders/k3d_bubbles.sl:16: point myCenter = (0, 0, 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:22: distance2point = distance(myPoint, myCenter);
k3d/share/shaders/k3d_bubbles.sl:23: if (distance2point <= radius) 
k3d/share/shaders/k3d_bubbles.sl:24:    magnitud = sqrt((radius * radius) - (distance2point * distance2point));
k3d/share/shaders/k3d_bubbles.sl:26: P += Kmag * magnitud * normalize(N);
k3d/share/shaders/k3d_bubbles.sl:27: N = calculatenormal(P);
k3d/share/shaders/k3d_bubbly.sl:1:/*  bubbly.sl written a while ago by Ivan DeWolf
k3d/share/shaders/k3d_bubbly.sl:2: *  ivan@SpamSucks_martian-tools.com
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:6: *  basicly it's F1 squared as described in 
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:10: *  not as elegant, but hey, it works.
k3d/share/shaders/k3d_bubbly.sl:12: *  the "bubbles" are paraboloids diplaced along the normal. 
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:21: *	      dont go higher than two with this.
k3d/share/shaders/k3d_bubbly.sl:24: *  bubsize - basicly the radius of the bubbles. distance in rVu's.
k3d/share/shaders/k3d_bubbly.sl:34:  normal Nn = normalize(N);
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:39:  /*true cell center, surrounding cell centers, noised cell center*/
k3d/share/shaders/k3d_bubbly.sl:40:  point trucell, surrcell, nzcell;
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:47:  /*what is the shortest distance to a noised cell center?*/
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:53:	nzcell = surrcell + ((vector cellnoise(surrcell)-.5)*Nzscale);
k3d/share/shaders/k3d_bubbly.sl:55:	if(dist<shortest) shortest = dist;
k3d/share/shaders/k3d_bubbly.sl:59:  bub = clamp(shortest,0,bubsize)/bubsize; 
k3d/share/shaders/k3d_bubbly.sl:61:  N = calculatenormal(P);
k3d/share/shaders/k3d_castucco.sl:2: * castucco.sl -- dispacement shader for stucco.
k3d/share/shaders/k3d_castucco.sl:4: * Description:
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:7: *   but in CA it's truly ubiquitous.
k3d/share/shaders/k3d_castucco.sl:9: * Parameters:
k3d/share/shaders/k3d_castucco.sl:10: *   freq - basic frequency of the texture
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:26:			  float trough = -0.15, peak = 0.35
k3d/share/shaders/k3d_castucco.sl:29:  point Pshad;			/* Point to be shaded, in shader space */
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:40:  /* Threshold the fBm and scale it */
k3d/share/shaders/k3d_castucco.sl:41:  disp = Km * smoothstep(trough, peak, disp);
k3d/share/shaders/k3d_castucco.sl:43:  /* displace in shader space units */
k3d/share/shaders/k3d_castucco.sl:44:  N = Displace(normalize(N), "shader", disp, 1);
k3d/share/shaders/k3d_causticlight.sl:3:	       color lightcolor = 1;
k3d/share/shaders/k3d_causticlight.sl:4:	       point from = point "shader" (0,0,0);
k3d/share/shaders/k3d_causticlight.sl:5:	       point to = point "shader" (0,0,1);
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:9:	       string shadowname = "";
k3d/share/shaders/k3d_causticlight.sl:11:	       float  blur = 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:21:	float atten = pow (cosangle, beamdistribution) / (L . L);
k3d/share/shaders/k3d_causticlight.sl:24:	Cl = atten * intensity * lightcolor;
k3d/share/shaders/k3d_causticlight.sl:27:				    "blur", blur, "bias", bias);
k3d/share/shaders/k3d_causticlight.sl:28:	    caustic = smoothstep (threshold, 1, caustic);
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:4: * Simple displacement shader using Voronoi cell noise
k3d/share/shaders/k3d_celld.sl:5: * Uses noises.h from ARMAN
k3d/share/shaders/k3d_celld.sl:7: * Tal Lancater 12/15/01
k3d/share/shaders/k3d_celld.sl:9: * History
k3d/share/shaders/k3d_celld.sl:10: *   01/12/15  Created
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:21:				   then the result is 0. } */
k3d/share/shaders/k3d_celld.sl:22:	float voro_jitter = 0;  /* desc { Amount to perturb the voroni 
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:33:	Nn = normalize (Nn);
k3d/share/shaders/k3d_celld.sl:35:	float voro_f1 = 0, voro_f2 = 0;
k3d/share/shaders/k3d_celld.sl:36:	point voro_pos1 = 0, voro_pos2 = 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:40:			 voro_pos2);
k3d/share/shaders/k3d_celld.sl:42:	float voro_dist = 1 - step (voro_step, voro_f2 - voro_f1);
k3d/share/shaders/k3d_celld.sl:45:		voro_dist = 0;
k3d/share/shaders/k3d_celld.sl:47:	VoroVal = voro_dist;
k3d/share/shaders/k3d_celld.sl:48:	objP += Kvoro * voro_dist * Nn;
k3d/share/shaders/k3d_celld.sl:50:#pragma nolint 1
k3d/share/shaders/k3d_celld.sl:51:	P = transform (PSpace, "current", objP);
k3d/share/shaders/k3d_celld.sl:52:	N = calculatenormal (P);
k3d/share/shaders/k3d_ceramic.sl:1:/* Author & copyright unknown */
k3d/share/shaders/k3d_ceramic.sl:3:#include "k3d_material.h"
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:2: * ceramictiles.sl
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:9: *   stilespacing, ttilespacing - tile-to-tile spacing (separate controls
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:14: *     shader space units)
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:22: *   edgevary, mottling, speckly - individual scalar controls over
k3d/share/shaders/k3d_ceramictiles.sl:23: *      edge variation, mottling, and speckles.  Setting any to zero will
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:26: *      color variation (0 means don't vary in that way, larger values
k3d/share/shaders/k3d_ceramictiles.sl:27: *      cause more tile-to-tile variation).
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: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:36: *   envname, envspace, envrad - environment mapping controls
k3d/share/shaders/k3d_ceramictiles.sl:37: *   rayjitter, raysamples - ray tracing controls
k3d/share/shaders/k3d_ceramictiles.sl:41: * Author: Larry Gritz, 1999
k3d/share/shaders/k3d_ceramictiles.sl:43: * Contacts:  lg@pixar.com
k3d/share/shaders/k3d_ceramictiles.sl:50: * PRMan together.
k3d/share/shaders/k3d_ceramictiles.sl:52:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_ceramictiles.sl:54:#include "k3d_project.h"
k3d/share/shaders/k3d_ceramictiles.sl:55:#include "k3d_material.h"
k3d/share/shaders/k3d_ceramictiles.sl:58:#include "k3d_patterns.h"
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:63: * on and what coordinates (on [0,1]) within our individual 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: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:78:						     tt + grooveheight / 2,
k3d/share/shaders/k3d_ceramictiles.sl:84:/* Given coordinates (stile,ttile) and derivatives (ds,dt) *within* a
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:88: * to the color transition); (3) occasional dark specks.
k3d/share/shaders/k3d_ceramictiles.sl:90:color tiletexture(float tileindex;
k3d/share/shaders/k3d_ceramictiles.sl:92:		  float edgevary, mottling, speckly; float mottlefreq;
k3d/share/shaders/k3d_ceramictiles.sl:93:		  color Cbase, Cedge, Cmottle, Cspeck)
k3d/share/shaders/k3d_ceramictiles.sl:95:  color C = Cbase;
k3d/share/shaders/k3d_ceramictiles.sl:99:      point noisep = mottlefreq * point(stile, ttile, tileindex);
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:116:      C = mix(C, Cedge, edgevary * edgy);
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:127:  return C;
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:134: * "glossy" specular term.  We're actually blending between a purely
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:136: * depending on the variable intile.  When in the mortar area, we turn
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:140:			   color Cmortar, Ctile;
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:146:  extern vector I;
k3d/share/shaders/k3d_ceramictiles.sl:147:  extern point P;
k3d/share/shaders/k3d_ceramictiles.sl:148:  color basecolor = mix(Cmortar, Ctile, intile);
k3d/share/shaders/k3d_ceramictiles.sl:150:  float kd = mix(Kdmortar, Kdtile, intile);
k3d/share/shaders/k3d_ceramictiles.sl:151:  vector IN = normalize(I), V = -IN;
k3d/share/shaders/k3d_ceramictiles.sl:152:  float fkr, fkt;
k3d/share/shaders/k3d_ceramictiles.sl:153:  vector R, T;
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:159:			specsharpness) + SampleEnvironment(P, R, kr, blur,
k3d/share/shaders/k3d_ceramictiles.sl:165:surface k3d_ceramictiles(float Ka = 1, Ks = .75, roughness =
k3d/share/shaders/k3d_ceramictiles.sl:166:			 0.1, specsharpness = 0.5;
k3d/share/shaders/k3d_ceramictiles.sl:167:			 float Kr = 1, blur = 0, eta = 1.5;
k3d/share/shaders/k3d_ceramictiles.sl:169:			 float Kdmortar = 0.8;
k3d/share/shaders/k3d_ceramictiles.sl:170:			 color mortarcolor = color(.5, .5, .5);
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:175:			 string projection = "st";
k3d/share/shaders/k3d_ceramictiles.sl:176:			 string textureprojspace = "shader";
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:182:			 color Cbase = color(.05, .075, .6);
k3d/share/shaders/k3d_ceramictiles.sl:183:			 color Cedge = color(.025, .025, .2);
k3d/share/shaders/k3d_ceramictiles.sl:184:			 color Cmottle = color(.2, .2, .7);
k3d/share/shaders/k3d_ceramictiles.sl:185:			 color Cspeck = color(.015, .015, .015);
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:190:   * Normalize everything so that the tiles are 1x1 units
k3d/share/shaders/k3d_ceramictiles.sl:193:    ProjectTo2D (projection, P, textureprojspace, array_to_mx(mx),ss, tt, dss, dtt);
k3d/share/shaders/k3d_ceramictiles.sl:200:   * Find out where in the pattern we are: which tile we're on, and
k3d/share/shaders/k3d_ceramictiles.sl:201:   * the (stile,ttile) coordinates (both on [0,1]) within our tile.
k3d/share/shaders/k3d_ceramictiles.sl:204:  float intile = tilepattern(ss, tt, dss, dtt,
k3d/share/shaders/k3d_ceramictiles.sl:205:			     groovewidth, grooveheight,
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:216:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ceramictiles.sl:217:  normal Ntile =
k3d/share/shaders/k3d_ceramictiles.sl:218:    Displace(Nf, "shader", groovedepth * (tiledisp - 1), truedisp);
k3d/share/shaders/k3d_ceramictiles.sl:220:  Ntile += 0.05 * (vector cellnoise(tileindex + 5) - 0.5);
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:225:   * in within the tile.  Then use the tile index to vary its color
k3d/share/shaders/k3d_ceramictiles.sl:226:   * so every tile looks a little different.
k3d/share/shaders/k3d_ceramictiles.sl:228:  color Ctile = tiletexture(tileindex, stile, ttile, dss, dtt,
k3d/share/shaders/k3d_ceramictiles.sl:229:			    edgevary, mottling, speckly,
k3d/share/shaders/k3d_ceramictiles.sl:230:			    mottlefreq,
k3d/share/shaders/k3d_ceramictiles.sl:232:  Ctile = varyEach(Ctile, tileindex, varyhue, varysat, varylum);
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:238:  color Cmortar = mortarcolor;
k3d/share/shaders/k3d_ceramictiles.sl:240:  float dQ = filterwidthp(Q);
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_ceramictiles.sl:249:			 roughness, specsharpness, Kr, blur, eta, ENVPARAMS);
k3d/share/shaders/k3d_checkerboard.sl:1:#include "k3d_patterns.h"
k3d/share/shaders/k3d_checkerboard.sl:3:surface k3d_checkerboard(float Ka = 1.0;
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:8:			 color EvenColor = 0.0;)
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:15:  color checkcolor;
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:31:  // Calculate which tile we're in ...
k3d/share/shaders/k3d_checkerboard.sl:44:  checkcolor = mix(EvenColor, Cs, mixamount);
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:6:	float roughness = 0.1;
k3d/share/shaders/k3d_checkerboard_solid.sl:7:	color specularcolor = 1.0;
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:11:	color EvenColor = 0.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:12:	string shadingspace = "shader";
k3d/share/shaders/k3d_checkerboard_solid.sl:15:	color Ct;
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:28:			Ct = EvenColor;
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_clamptoalpha.sl:7:imager
k3d/share/shaders/k3d_clamptoalpha.sl:10:  Ci = clamp(Ci, color(0, 0, 0), color(alpha, alpha, alpha));
k3d/share/shaders/k3d_clay.sl:2: * clay.sl -- simple clay surface using MaterialClay
k3d/share/shaders/k3d_clay.sl:4: * Author: Larry Gritz (gritzl@acm.org)
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:11:#include "k3d_material.h"
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:1:/* I took wave's lead and renamed cloudplane to DPCloudplane.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_cloudplane.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_cloudplane.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_cloudplane.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_cloudplane.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_cloudplane.sl:14:#include "k3d_proctext.h"
k3d/share/shaders/k3d_cloudplane.sl:18:surface
k3d/share/shaders/k3d_cloudplane.sl:20:    color cloudcolor = color (1,1,1);
k3d/share/shaders/k3d_cloudplane.sl:23:    color Ct;
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:36:    xphase = 0.9; /* arbitrary */
k3d/share/shaders/k3d_cloudplane.sl:37:    yphase = 0.7; /* arbitrary */
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:42:    for (i = 0; i < NTERMS; i += 1) {
k3d/share/shaders/k3d_cloudplane.sl:44:            (offset + cos(xfreq * (x + xphase)));
k3d/share/shaders/k3d_cloudplane.sl:46:            (offset + cos(yfreq * (y + yphase)));
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: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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_constant.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_constant.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:2: *    -- tal@SpamSucks_renderman.org
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:10:** by Rob Engle and Jim Berney  
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:23:       camera space used when rendering the shadow map */  
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:28:       screen space (-1..1) used when rendering the shadow map */  
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:39:	/* point being shaded is outside the region of the depth map */  
k3d/share/shaders/k3d_contacshadow.sl:40:	Ci = color(0);  
k3d/share/shaders/k3d_contacshadow.sl:43:	/* get the distance from the shadow camera to the closest
k3d/share/shaders/k3d_contacshadow.sl:44:	   object as recorded in the shadow map */
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:49:	   camera to the ground plane */
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:54:	float distance = mapdist - zcomp(cameraP);  
k3d/share/shaders/k3d_contacshadow.sl:59:	/* convert into a color (white=shadow) */  
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:5: * Author: Peter Quint
k3d/share/shaders/k3d_corktile.sl:6: * Last Update: 16 October 2000
k3d/share/shaders/k3d_corktile.sl:8: * parameters
k3d/share/shaders/k3d_corktile.sl:10: * Ka, Kd, Ks, roughness, specularcolor - take their usual meanings
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:18: *   the groove (2.5% either side = 5% in total = 0.05)
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: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: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:35:/* Bias function - Perlin and Hoffert 1989 */
k3d/share/shaders/k3d_corktile.sl:40:	return pow(x, log(b)/log(0.5));
k3d/share/shaders/k3d_corktile.sl:43:color cork(		point PP;
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:48:		markings that characterise cork
k3d/share/shaders/k3d_corktile.sl:50:		color Ct;
k3d/share/shaders/k3d_corktile.sl:51:		point P2 = transform("shader",PP);
k3d/share/shaders/k3d_corktile.sl:60:		Ct = color spline( 	f,
k3d/share/shaders/k3d_corktile.sl:61:						color( 0, 0, 0),
k3d/share/shaders/k3d_corktile.sl:62:						color( .25, 0, 0),
k3d/share/shaders/k3d_corktile.sl:63:						color( .31, .2, 0),
k3d/share/shaders/k3d_corktile.sl:64:						color( .486, .165, .059),
k3d/share/shaders/k3d_corktile.sl:65:						color( .47, .18, .09),
k3d/share/shaders/k3d_corktile.sl:66:						color( .64, .24, .07),
k3d/share/shaders/k3d_corktile.sl:67:						color( .749, .416, .208)
k3d/share/shaders/k3d_corktile.sl:69:		/* Overlay the dark markings */
k3d/share/shaders/k3d_corktile.sl:75:		return Ct;
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:83:         		float	roughness = .05;
k3d/share/shaders/k3d_corktile.sl:87:						color specularcolor = 1;
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:96:	point PP = transform("shader",P);
k3d/share/shaders/k3d_corktile.sl:97:	float filtwidth = filterwidthp(PP),
k3d/share/shaders/k3d_corktile.sl:102:	color Cg, Ct;
k3d/share/shaders/k3d_corktile.sl:103:	normal Nf;
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: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: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:5: * Similar tricks can be used to make cork, swiss-cheese, bread, etc.
k3d/share/shaders/k3d_craters.sl:9:#include "k3d_material.h"
k3d/share/shaders/k3d_craters.sl:11:#include "k3d_patterns.h"
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:30:    color		Ct;
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:40:    /* Add craters */
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:49:	rrad1 = 0;
k3d/share/shaders/k3d_craters.sl:50:	rrad2 = 0;
k3d/share/shaders/k3d_craters.sl:51:	for (i = -1; i <= 1; i += 1) 
k3d/share/shaders/k3d_craters.sl:53:	    scell = scellctr + i;
k3d/share/shaders/k3d_craters.sl:54:	    for (j = -1; j <= 1; j += 1) 
k3d/share/shaders/k3d_craters.sl:56:		tcell = tcellctr + j;
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:61:		    sctr = cellsizescale * (scell + 0.5 + jitter * cellnoise(scell+0.5, tcell+0.5));
k3d/share/shaders/k3d_craters.sl:62:		    tctr = cellsizescale * (tcell + 0.5 + jitter * cellnoise(scell+3.5, tcell+8.5));
k3d/share/shaders/k3d_craters.sl:63:		    ss = s - sctr;
k3d/share/shaders/k3d_craters.sl:64:		    tt = t - tctr;
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:68:		      rad = rmax*ilac;
k3d/share/shaders/k3d_craters.sl:69:		      rad /= sc;
k3d/share/shaders/k3d_craters.sl:70:		      rad *= rad;
k3d/share/shaders/k3d_craters.sl:71:		      rmax2 = rmax1;
k3d/share/shaders/k3d_craters.sl:72:		      rrad2 = rrad1;
k3d/share/shaders/k3d_craters.sl:73:		      rmax1 = r;
k3d/share/shaders/k3d_craters.sl:74:		      rrad1 = rad;
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:78:		      rad = rmax*ilac;
k3d/share/shaders/k3d_craters.sl:79:		      rad /= sc;
k3d/share/shaders/k3d_craters.sl:80:		      rad *= rad;
k3d/share/shaders/k3d_craters.sl:81:		      rmax2 = r;
k3d/share/shaders/k3d_craters.sl:82:		      rrad2 = rad;
k3d/share/shaders/k3d_craters.sl:87:	/* Optional Crater Distortion... */
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:97:	    r = smoothstep(0,rrad1,rmax1);
k3d/share/shaders/k3d_craters.sl:98:	    r = r*(2*r-pow(r,3))+(1-r)*pow(r,3);
k3d/share/shaders/k3d_craters.sl:99:	    pert += sin(r*PI/2)*asc-asc;
k3d/share/shaders/k3d_craters.sl:101:	if (rrad2 > 0 && rmax2 > 0) 
k3d/share/shaders/k3d_craters.sl:103:	    r = smoothstep(0,rrad2,rmax2);
k3d/share/shaders/k3d_craters.sl:104:	    r = r*(2*r-pow(r,3))+(1-r)*pow(r,3);			
k3d/share/shaders/k3d_craters.sl:105:	    pert += sin(r*PI/2)*asc-asc;
k3d/share/shaders/k3d_craters.sl:109:    P += Km*pert*normalize(N);
k3d/share/shaders/k3d_craters.sl:110:    N = calculatenormal(P);	
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:12:	Ka, Kd, Ks, roughness, specularcolor - work as in the plastic shader
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:19:		this should vary between 0 (no topcolor) to 1, .3 would give 30% topcolor;
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:26:	Peter Quint - Revised Monday, January 10, 2000 
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:38:	   twice the micropolygon width */
k3d/share/shaders/k3d_crayon.sl:40:	/* calculate smallest integer f for which width / f < .5 */
k3d/share/shaders/k3d_crayon.sl:43:	/*(printf("f = %f, mag = %f\n",f,mag)*/;
k3d/share/shaders/k3d_crayon.sl:46:	return ns;
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:58:         	float roughness = .1;
k3d/share/shaders/k3d_crayon.sl:59:	 		color specularcolor = 1;
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:66:			color topcolor = 1;
k3d/share/shaders/k3d_crayon.sl:67:			color basecolor = 0;
k3d/share/shaders/k3d_crayon.sl:70:  color Csurf;
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:75:	/*  use a spline to read across to the appropriate noise value - this equalisation
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:77:		procedural approach */ 
k3d/share/shaders/k3d_crayon.sl:78:	normal Nf = faceforward (normalize(N),I);
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:87:	m = smoothstep(trs - .1, trs + .3, lmks);	
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:1:/* crayonToon.sl Ver. 1.0 Felipe Esquivel

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:5: * hay que escoger con cuidado ambos colores para obtener

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

k3d/share/shaders/k3d_crayontoon.sl:7: * del otro pero es mejor dejar al usuario esa eleccion. 

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

k3d/share/shaders/k3d_crayontoon.sl:10: * choose wisely both colors to obtain the crayon look. My

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:12: * better to let the user change this.

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

k3d/share/shaders/k3d_crayontoon.sl:15:                         colorSombra = color(1, .81, .37);

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: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:3:/* Use signed Perlin noise */
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:15:  float radius, dist, angle, sine, cosine, eye_weight, value;
k3d/share/shaders/k3d_cyclone.sl:16:  point Pt;			/* Point in texture space */
k3d/share/shaders/k3d_cyclone.sl:17:  point PN;			/* Normalized vector in texture space */
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:25:  PN = normalize(Pt);
k3d/share/shaders/k3d_cyclone.sl:26:  radius = sqrt(xcomp(PN) * xcomp(PN) + ycomp(PN) * ycomp(PN));
k3d/share/shaders/k3d_cyclone.sl:28:  if(radius < max_radius)
k3d/share/shaders/k3d_cyclone.sl:30:      /* invert distance from center */
k3d/share/shaders/k3d_cyclone.sl:31:      dist = pow(max_radius - radius, 3);
k3d/share/shaders/k3d_cyclone.sl:32:      angle = PI + twist * TWOPI * (max_radius - dist) / max_radius;
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:41:	  eye_weight = (.1 * max_radius - radius) * 10;	/* normalize */
k3d/share/shaders/k3d_cyclone.sl:42:	  /* invert and make nonlinear */
k3d/share/shaders/k3d_cyclone.sl:52:    {				/* if in "storm" area */
k3d/share/shaders/k3d_cyclone.sl:57:      for(i = 0; i < octaves && o >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_cyclone.sl:71:  /* Shade like matte, but with color scaled by cloud opacity */
k3d/share/shaders/k3d_cyclone.sl:73:    Oi * Cs * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_decalplastic.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
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:13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
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:21:		\author Tim Shead (tshead@k-3d.com)
k3d/share/shaders/k3d_decalplastic.sl:24:surface k3d_decalplastic(
k3d/share/shaders/k3d_decalplastic.sl:28:	float roughness = 0.1;
k3d/share/shaders/k3d_decalplastic.sl:29:	color specularcolor = 1.0;
k3d/share/shaders/k3d_decalplastic.sl:30:	string texturename = "";
k3d/share/shaders/k3d_decalplastic.sl:37:	color Ct = Cs;
k3d/share/shaders/k3d_decalplastic.sl:38:	if(texturename != "")
k3d/share/shaders/k3d_decalplastic.sl:42:			float alpha = float texture(texturename[3], ss, tt);
k3d/share/shaders/k3d_decalplastic.sl:43:			Ct = (1.0 - alpha) * Cs + (alpha * color texture(texturename, ss, tt));
k3d/share/shaders/k3d_decalplastic.sl:46:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_decalplastic.sl:47:	vector V = -normalize(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:4: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:9: *   power	   	controls the fractal dimension of the dents (1 looks
k3d/share/shaders/k3d_dented.sl:10: *                         like previously crumpled paper or cloth, 3 looks
k3d/share/shaders/k3d_dented.sl:11: *                         like worn metal).
k3d/share/shaders/k3d_dented.sl:12: *   frequency  	the frequency of the dents
k3d/share/shaders/k3d_dented.sl:15: * AUTHOR: written by Larry Gritz, based on the "dented" shader in
k3d/share/shaders/k3d_dented.sl:16: *         RenderMan Companion, but with more control parameters.
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:24: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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: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_dented.sl:44:	P = P - (Km * pow(magnitude, power)) * normalize(N);
k3d/share/shaders/k3d_dented.sl:45:	N = calculatenormal(P);
k3d/share/shaders/k3d_depthcue.sl:1:/* depthcue.sl - Standard depthcue volume shader for RenderMan Interface.
k3d/share/shaders/k3d_depthcue.sl:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_depthcue.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_depthcue.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_depthcue.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_depthcue.sl:10:		    color background = 0;)
k3d/share/shaders/k3d_depthcue.sl:15:  Ci = mix(Ci, background, 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:3: *  Author: Daniel S. Matthews dan@3-e.net
k3d/share/shaders/k3d_depthcue_surf.sl:6:surface k3d_depthcue_surf(
k3d/share/shaders/k3d_depthcue_surf.sl:9:string 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:2:				 float ZeroPoint = 0.0;
k3d/share/shaders/k3d_displacementmap.sl:3:				 string texturename = "";)
k3d/share/shaders/k3d_displacementmap.sl:9:  Ct = (texturename != "") ? float texture(texturename) : 0;
k3d/share/shaders/k3d_displacementmap.sl:11:  N1 = calculatenormal(P);
k3d/share/shaders/k3d_displacementmap.sl:12:  P = P - (Km * (Ct - ZeroPoint)) * normalize(N);
k3d/share/shaders/k3d_displacementmap.sl:13:  N2 = calculatenormal(P);
k3d/share/shaders/k3d_displacementmap.sl:14:  N = normalize(N) + normalize(N2) - normalize(N1);
k3d/share/shaders/k3d_distant_shadow.sl:3:	color  lightcolor=1 ;
k3d/share/shaders/k3d_distant_shadow.sl:4:	point from = point "shader" (0,0,0) ;
k3d/share/shaders/k3d_distant_shadow.sl:5:	point to   = point "shader" (0,0,1) ;
k3d/share/shaders/k3d_distant_shadow.sl:6:	string shadowname="";
k3d/share/shaders/k3d_distant_shadow.sl:8:	float  blur=.01;
k3d/share/shaders/k3d_distant_shadow.sl:12:		solar( to - from, 0.0 ) {
k3d/share/shaders/k3d_distant_shadow.sl:13:			Cl = intensity * lightcolor;
k3d/share/shaders/k3d_distant_shadow.sl:17:					"blur", blur, "bias", bias);
k3d/share/shaders/k3d_distantlight.sl:1:/* distantlight.sl - Standard distant light source for RenderMan Interface.
k3d/share/shaders/k3d_distantlight.sl:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_distantlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_distantlight.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_distantlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_distantlight.sl:10:		       color lightcolor = 1;
k3d/share/shaders/k3d_distantlight.sl:11:		       point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_distantlight.sl:12:		       point to = point "shader"(0, 0, 1);)
k3d/share/shaders/k3d_distantlight.sl:14:  solar(to - from, 0) Cl = intensity * lightcolor;
k3d/share/shaders/k3d_droop.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_droop.sl:2:/* From the RenderMan Companion p.370 */
k3d/share/shaders/k3d_droop.sl:3:/* Listing 16.27  Displacement shader with catenary droop in y*/
k3d/share/shaders/k3d_droop.sl:6: * droop(): a displacement shader for making a surface "sag" along t.
k3d/share/shaders/k3d_droop.sl:11:k3d_droop ( 
k3d/share/shaders/k3d_droop.sl:14:	float droop, yDel;
k3d/share/shaders/k3d_droop.sl:16:	droop = (t-.5)*2;	/* t in [0,1] goes to droop in [-1,1] */
k3d/share/shaders/k3d_droop.sl:18:	yDel = -Km * ( M_E + (1/M_E) - (exp(droop)+exp(-droop)) );
k3d/share/shaders/k3d_droop.sl:20:	N = calculatenormal(P);
k3d/share/shaders/k3d_dturb.sl:1:/* dturb.sl
k3d/share/shaders/k3d_dturb.sl:3: * turbulence displacement
k3d/share/shaders/k3d_dturb.sl:6:#include "k3d_rmannotes.h"
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:14:  /* compute turbulence */
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:21:  turb = 0;
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: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_dturb.sl:33:  P += Km * magnitude * normalize(N);
k3d/share/shaders/k3d_dturb.sl:34:  N = calculatenormal(P);
k3d/share/shaders/k3d_easysurface.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_easysurface.sl:2:/* From the RenderMan Companion p.363 */
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:15:	point II = normalize(I);
k3d/share/shaders/k3d_easysurface.sl:16:	point NN = normalize(N);
k3d/share/shaders/k3d_ember.sl:1:/* Glowing ember shader 2002 Graeme Nattress & NOITAMINANIMATION Inc.
k3d/share/shaders/k3d_ember.sl:3: * email: graeme@noitaminanimation.com
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: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: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: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:28:	vector V;
k3d/share/shaders/k3d_ember.sl:29:	normal NN, NI;
k3d/share/shaders/k3d_ember.sl:31:	NN = normalize(N);
k3d/share/shaders/k3d_ember.sl:32:	NI = normalize(I);
k3d/share/shaders/k3d_ember.sl:33:	Nf = faceforward(NN,I);
k3d/share/shaders/k3d_ember.sl:34:	V = vector -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:43:	Ci = color spline (spcol * size, 
k3d/share/shaders/k3d_ember.sl:44:		color (0, 0, 0), color (0, 0, 0),
k3d/share/shaders/k3d_ember.sl:45:		color (27, 0, 0),
k3d/share/shaders/k3d_ember.sl:46:		color (54, 0, 0),
k3d/share/shaders/k3d_ember.sl:47:		color (81, 0, 0),
k3d/share/shaders/k3d_ember.sl:48:		color (109, 0, 0),
k3d/share/shaders/k3d_ember.sl:49:		color (136, 0, 0),
k3d/share/shaders/k3d_ember.sl:50:		color (166, 5, 0),
k3d/share/shaders/k3d_ember.sl:51:		color (189, 30, 0),
k3d/share/shaders/k3d_ember.sl:52:		color (211, 60, 0),
k3d/share/shaders/k3d_ember.sl:53:		color (231, 91, 0),
k3d/share/shaders/k3d_ember.sl:54:		color (238, 128, 0),
k3d/share/shaders/k3d_ember.sl:55:		color (244, 162, 12),
k3d/share/shaders/k3d_ember.sl:56:		color (248, 187, 58),
k3d/share/shaders/k3d_ember.sl:57:		color (251, 209, 115),
k3d/share/shaders/k3d_ember.sl:58:		color (254, 236, 210),
k3d/share/shaders/k3d_ember.sl:59:		color (255, 241, 230),
k3d/share/shaders/k3d_ember.sl:60:		color (255, 241, 230)) / 255;
k3d/share/shaders/k3d_ember.sl:61:	// the colours for the fire effect from F. Kenton Musgrave's KMFlame.sl
k3d/share/shaders/k3d_emboss.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_emboss.sl:2:/* From the RenderMan Companion p.383 */
k3d/share/shaders/k3d_emboss.sl:3:/* Listing 16.36  Displacement shader embossing a surface using a texture */
k3d/share/shaders/k3d_emboss.sl:6: * emboss(): emboss a pencil with lettering.  It uses the same texture
k3d/share/shaders/k3d_emboss.sl:7: * 	map as sdixon() to define the lettering.
k3d/share/shaders/k3d_emboss.sl:12:	string	texturename	= "")
k3d/share/shaders/k3d_emboss.sl:14:	if( texturename != "") {
k3d/share/shaders/k3d_emboss.sl:15:		P -= Km * texture(texturename, s, t) * normalize(N);
k3d/share/shaders/k3d_emboss.sl:16:		N = calculatenormal(P);
k3d/share/shaders/k3d_envsurf.sl:1:surface k3d_envsurf (string envname = "", envspace = "world")
k3d/share/shaders/k3d_envsurf.sl:4:	Ci = environment (envname, normalize(vtransform(envspace, I)));
k3d/share/shaders/k3d_eroded.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_eroded.sl:2:/* From the RenderMan Companion p.353 */
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:9:k3d_eroded (
k3d/share/shaders/k3d_eroded.sl:13:		  roughness = 0.25)
k3d/share/shaders/k3d_eroded.sl:19:	      W = transform ("object", P);
k3d/share/shaders/k3d_eroded.sl:21:	point V = normalize(-I);
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:29:	/* sharpen peaks */
k3d/share/shaders/k3d_eroded.sl:32:	N = calculatenormal (P - magnitude * normalize(N));
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:8: *   part (eyeball), and blood vessels can be set individually.  Fractal
k3d/share/shaders/k3d_eyeball.sl:9: *   functions are used for the veining and the iris mottling.
k3d/share/shaders/k3d_eyeball.sl:12: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader
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:18: *   irissize - size of iris (in "t" space), must be larger than pupilsize
k3d/share/shaders/k3d_eyeball.sl:19: *   bloodshot - controls how bloodshot the eye is (0=no blood, 1=very ugly)
k3d/share/shaders/k3d_eyeball.sl:20: *   veinfreq, veinlevel - control the formation of the blood vessels
k3d/share/shaders/k3d_eyeball.sl:21: *   index - set between 0 and 1, lets you use this shader to generate
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:27: * AUTHOR: written by Larry Gritz
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:31: *                 "Graphic Violence".  Original version hard coded in C.
k3d/share/shaders/k3d_eyeball.sl:33: *      10 Jan 1994 - recoded by lg in correct shading language.
k3d/share/shaders/k3d_eyeball.sl:34: *      28 Jun 94 (lg) - revamped to add veins and iris mottling, renamed
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: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:47:	 color specularcolor = 1;
k3d/share/shaders/k3d_eyeball.sl:48:	 color iriscolor = color (.135289, .084323, .372417);
k3d/share/shaders/k3d_eyeball.sl:49:	 color irisoutercolor = color (.403882, .343944, .68276);
k3d/share/shaders/k3d_eyeball.sl:50:	 color irisinnercolor = color (.065142, .040605, .179311);
k3d/share/shaders/k3d_eyeball.sl:51:	 color eyeballcolor = color(1,1,1);
k3d/share/shaders/k3d_eyeball.sl:52:	 color bloodcolor = color(.8,.05,.05);
k3d/share/shaders/k3d_eyeball.sl:53:	 color pupilcolor = 0;
k3d/share/shaders/k3d_eyeball.sl:54:	 float pupilsize = 0.05, irissize = 0.12;
k3d/share/shaders/k3d_eyeball.sl:56:	 float veinfreq = 8, veinlevel = 4;
k3d/share/shaders/k3d_eyeball.sl:62:  color Ct;
k3d/share/shaders/k3d_eyeball.sl:65:  float i, turb, newturb, freq, f2;
k3d/share/shaders/k3d_eyeball.sl:67:  color Cball, Ciris;
k3d/share/shaders/k3d_eyeball.sl:68:  float irisstat, pupilstat;
k3d/share/shaders/k3d_eyeball.sl:70:  float ks, rough;
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:78:   * irisstat: 0 inside the iris/white boundary, 1 outside
k3d/share/shaders/k3d_eyeball.sl:79:   * pupilstat: 0 inside the pupil/iris boundary, 1 outside
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:83:  irisstat = smoothstep (irissize, irissize+twidth, tt);
k3d/share/shaders/k3d_eyeball.sl:85:  bloody = bloodshot * (smoothstep (-irissize, 2.5*irissize, tt));
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:88:   * then calculate the veining pattern.  Otherwise, just use the color
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:91:   * just right.
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:98:	  newdisp = pow (smoothstep (.85, 1, newturb), 10);
k3d/share/shaders/k3d_eyeball.sl:99:	  displayed += (1-displayed) * newdisp * smoothstep (.1, .85, turb * turb);
k3d/share/shaders/k3d_eyeball.sl:100:	  turb *= newturb;
k3d/share/shaders/k3d_eyeball.sl:101:	  freq *= 2;
k3d/share/shaders/k3d_eyeball.sl:103:      Cball = mix (eyeballcolor, bloodcolor, smoothstep(0,.75,displayed));
k3d/share/shaders/k3d_eyeball.sl:105:  else Cball = eyeballcolor;
k3d/share/shaders/k3d_eyeball.sl:107:  Ciris = mix (iriscolor, irisoutercolor, smoothstep (irissize*.8, irissize, tt));
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:117:      Ciris *= (1-clamp(turb/2,0,1));
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:121:   * and what patterns we calculated.
k3d/share/shaders/k3d_eyeball.sl:123:  Ct = mix (Ciris, Cball, irisstat);
k3d/share/shaders/k3d_eyeball.sl:124:  Ct = mix (pupilcolor, Ct, pupilstat);
k3d/share/shaders/k3d_eyeball.sl:126:  /* Make the eye a little glossier on the iris and pupil */
k3d/share/shaders/k3d_eyeball.sl:127:  ks = Ks * (1+2*(1-irisstat));
k3d/share/shaders/k3d_eyeball.sl:128:  rough = roughness * (1-.75*(1-irisstat));
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:136:	      specularcolor * ks*specular(Nf,-normalize(I),rough));
k3d/share/shaders/k3d_ez.sl:1:surface
k3d/share/shaders/k3d_ez.sl:3:Ci = abs(normalize(N).normalize(I));
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:5: * sphere, with color varying a bit by altitude, in an attempt to mimic the

k3d/share/shaders/k3d_fakesky.sl:6: * clear sky.

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

k3d/share/shaders/k3d_fakesky.sl:11:    Ci = Os * (.5 + .5 * max(0., (up . normalize(N)))) * 1.8 * skycolor;

k3d/share/shaders/k3d_filament.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_filament.sl:2:/* From the RenderMan Companion p.368 */
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: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_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:3: *compare this to plastic.sl
k3d/share/shaders/k3d_fill.sl:5:surface 
k3d/share/shaders/k3d_fill.sl:12:	normal Nf = faceforward(normalize(N), I );
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:7:#include "k3d_rmannotes.h"
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:16:  color red = color (1, .3, .1);
k3d/share/shaders/k3d_fire.sl:17:  color orange = color (.95, .7, .05);
k3d/share/shaders/k3d_fire.sl:18:  color yellow = color (.95, .95, .1);
k3d/share/shaders/k3d_fire.sl:19:  color hot = color (1, 1, .8);
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:29:  /* compute turbulence */
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:34:  turb = 0;
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:38:  turb += fade * abs(snoise2(ss * f, tt * f)) / f;
k3d/share/shaders/k3d_fire.sl:39:  turb *= 0.5;
k3d/share/shaders/k3d_fire.sl:41:  /* index into color spline using turbulence */
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:8: *    distortion - 
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:17: *    C language version by F. Kenton Musgrave
k3d/share/shaders/k3d_flame.sl:18: *    Translation to RenderMan Shading Language by Larry Gritz.
k3d/share/shaders/k3d_flame.sl:21: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_flame.sl:22: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_flame.sl:23: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_flame.sl:26: *    ??? - original C language version by Ken Musgrave
k3d/share/shaders/k3d_flame.sl:27: *    Apr 94 - translation to Shading Language by L. Gritz
k3d/share/shaders/k3d_flame.sl:29: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_flame.sl:36:surface k3d_flame(float distortion = 0;
k3d/share/shaders/k3d_flame.sl:42:  float freq;
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:59:    Cs * color spline(cmap, color(0, 0, 0), color(0, 0, 0), color(27, 0, 0),
k3d/share/shaders/k3d_flame.sl:60:		      color(54, 0, 0), color(81, 0, 0), color(109, 0, 0),
k3d/share/shaders/k3d_flame.sl:61:		      color(136, 0, 0), color(166, 5, 0), color(189, 30, 0),
k3d/share/shaders/k3d_flame.sl:62:		      color(211, 60, 0), color(231, 91, 0), color(238, 128,
k3d/share/shaders/k3d_flame.sl:64:		      color(244, 162, 12), color(248, 187, 58), color(251,
k3d/share/shaders/k3d_flame.sl:67:		      color(254, 236, 210), color(255, 241, 230), color(255,
k3d/share/shaders/k3d_fog.sl:1:/* fog.sl - Standard fog volume shader for RenderMan Interface.
k3d/share/shaders/k3d_fog.sl:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_fog.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_fog.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:12:  Ci = mix(Ci, background, d);
k3d/share/shaders/k3d_fog.sl:13:  Oi = mix(Oi, color(1, 1, 1), d);
k3d/share/shaders/k3d_fractal.sl:2: *AUTHOR: Ken Musgrave.

k3d/share/shaders/k3d_fractal.sl:3: *    Conversion to Shading Language and minor modifications by Fredrik Brnnbacka.

k3d/share/shaders/k3d_fractal.sl:7: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,

k3d/share/shaders/k3d_fractal.sl:8: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.

k3d/share/shaders/k3d_fractal.sl:9: *    Academic Press, 1998.  ISBN 0-12-228730-4.

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:19:	normal Nn = normalize(N);	

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

k3d/share/shaders/k3d_fractal.sl:21:       		/* First octaves */

k3d/share/shaders/k3d_fractal.sl:27:          		signal = pow( signal, sharpness );

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:30:                             original one -- signal *= signal;*/

k3d/share/shaders/k3d_fractal.sl:31:          		result = signal;

k3d/share/shaders/k3d_fractal.sl:35:          		exponent = pow( lacunarity, (-i*H) );

k3d/share/shaders/k3d_fractal.sl:37:          		PP.x *= lacunarity;

k3d/share/shaders/k3d_fractal.sl:38:          		PP.y *= lacunarity;

k3d/share/shaders/k3d_fractal.sl:39:          		PP.z *= lacunarity;

k3d/share/shaders/k3d_fractal.sl:41:			PP = PP * lacunarity;

k3d/share/shaders/k3d_fractal.sl:42:          		/* weigh successive contributions by previous signal */

k3d/share/shaders/k3d_fractal.sl:43:          		weight = signal * threshold;

k3d/share/shaders/k3d_fractal.sl:50:          		/* invert and translate*/

k3d/share/shaders/k3d_fractal.sl:53:          		/* sharpen the ridge*/

k3d/share/shaders/k3d_fractal.sl:54:          		signal = pow( signal, sharpness ); /* Or signal *= signal;*/

k3d/share/shaders/k3d_fractal.sl:56:          		/* weight the contribution*/

k3d/share/shaders/k3d_fractal.sl:58:          		result += signal * exponent;

k3d/share/shaders/k3d_fractal.sl:62:	P+= Nn*result*Kt;

k3d/share/shaders/k3d_fractal.sl:63:  	N = calculatenormal(P);	

k3d/share/shaders/k3d_fresnelplastic.sl:2: * TLFresnelPlastic.sl -- simple shader illustrating fresnel().
k3d/share/shaders/k3d_fresnelplastic.sl:5: *    Simple Fresnel shader using plastic illuminance.
k3d/share/shaders/k3d_fresnelplastic.sl:9: * AUTHOR: Tal Lancaster  tal@SpamSucks_renderman.org
k3d/share/shaders/k3d_fresnelplastic.sl:12: *    Jan 26 2002  Created
k3d/share/shaders/k3d_fresnelplastic.sl:15:/* From Advanced RenderMan */
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: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:28:			 not over-written by "colorMap } */
k3d/share/shaders/k3d_fresnelplastic.sl:29:   string colorMap = ""; /* cat Color
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:35:      gt 1.0 and lt 2.2}  range {1.01 2.2 .01} */
k3d/share/shaders/k3d_fresnelplastic.sl:39:   float roughness= 0.1;  /* desc {Specular roughness} */
k3d/share/shaders/k3d_fresnelplastic.sl:40:   color Cspec = 1;       /* desc {Specular color} */
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: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:55:			  desc {Swap S/T access to overcome Maya/MtoR
k3d/share/shaders/k3d_fresnelplastic.sl:56:			  NURBs differences.} */
k3d/share/shaders/k3d_fresnelplastic.sl:60:    float fKt, fKr;
k3d/share/shaders/k3d_fresnelplastic.sl:61:    color Ct;
k3d/share/shaders/k3d_fresnelplastic.sl:63:    normal Nf = normalize (faceforward( normalize(N), I ));
k3d/share/shaders/k3d_fresnelplastic.sl:64:    vector V = -normalize(I);
k3d/share/shaders/k3d_fresnelplastic.sl:65:    vector R = normalize (reflect (I, Nf));
k3d/share/shaders/k3d_fresnelplastic.sl:67:    /* Parametric space adjustments */
k3d/share/shaders/k3d_fresnelplastic.sl:68:    if (MtorFlip == 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:93:    /* base color */
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:96:      Ct = texture (colorMap, ss, tt);
k3d/share/shaders/k3d_fresnelplastic.sl:98:      Ct = Csurf;
k3d/share/shaders/k3d_fresnelplastic.sl:100:    /* Environment */
k3d/share/shaders/k3d_fresnelplastic.sl:101:    color Cr = 0;
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: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:2: * (c) Copyright 1994, Larry Gritz
k3d/share/shaders/k3d_funkyglass.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_funkyglass.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:11:		       color specularcolor = 1;)
k3d/share/shaders/k3d_funkyglass.sl:14:  normal Nf;
k3d/share/shaders/k3d_funkyglass.sl:15:  vector V;
k3d/share/shaders/k3d_funkyglass.sl:16:  color Ct, Ot;
k3d/share/shaders/k3d_funkyglass.sl:18:  V = normalize(I);
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:21:  Ct = 2 * (color noise(PP) - .5) + .5;
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:3: *   - Simple algorithm: checkerboard

k3d/share/shaders/k3d_fur1.sl:5: *     by Lawrence D. Chin, cs184-bo

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

k3d/share/shaders/k3d_fur1.sl:31:  N = calculatenormal(P);

k3d/share/shaders/k3d_fur2.sl:1:/* Renamed to SIG2k_srf_fur to be consistent with the RMR 
k3d/share/shaders/k3d_fur2.sl:2:   -- tal@SpamSucks_renderman.org
k3d/share/shaders/k3d_fur2.sl:5:/* fur surface shader
k3d/share/shaders/k3d_fur2.sl:7:   with clumping and specular model
k3d/share/shaders/k3d_fur2.sl:9:   by Clint Hanson and Armin Bruderlin
k3d/share/shaders/k3d_fur2.sl:12:color 
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:18:    color Cout = Cin;
k3d/share/shaders/k3d_fur2.sl:19:    vector LN, NN;
k3d/share/shaders/k3d_fur2.sl:22:    /* normalize the stuff */
k3d/share/shaders/k3d_fur2.sl:23:    LN = normalize(vector(Lin));
k3d/share/shaders/k3d_fur2.sl:24:    NN = normalize(vector(Nin));
k3d/share/shaders/k3d_fur2.sl:31:    return (Cout);
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:43:	 float roughness1  = 0.008;
k3d/share/shaders/k3d_fur2.sl:45:	 float roughness2  = 0.016;
k3d/share/shaders/k3d_fur2.sl:47:	 float   start_spec = 0.3;
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:55:	 /* Hair Color */
k3d/share/shaders/k3d_fur2.sl:56:	 color rootcolor  = color (.9714, .9714, .9714);
k3d/share/shaders/k3d_fur2.sl:57:	 color tipcolor = color (.519, .325, .125);
k3d/share/shaders/k3d_fur2.sl:58:	 color specularcolor  = (color(1) + tipcolor) / 2;
k3d/share/shaders/k3d_fur2.sl:59:	 color static_ambient  = color (0.057,0.057,0.057);
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:65:	 varying vector clump_vect  = vector 0;
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:71:    vector V = -normalize(I);    /* V is the view vector */
k3d/share/shaders/k3d_fur2.sl:72:    color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
k3d/share/shaders/k3d_fur2.sl:74:    vector nL;
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:78:    vector norm_hair;
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: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:98:    norm_hair = (l * nSN) + ( (1-l) * N_hair);
k3d/share/shaders/k3d_fur2.sl:99:    norm_hair = normalize(norm_hair);
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: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:111:       James T. Kajiya and Timothy L.  Kay (1989) "Rendering Fur with Three 
k3d/share/shaders/k3d_fur2.sl:112:       Dimensional Textures", Computer Graphics 23,3, 271-280  
k3d/share/shaders/k3d_fur2.sl:115:    illuminance (P, norm_hair, radians(illum_width)) {
k3d/share/shaders/k3d_fur2.sl:116:	nL = normalize(L);
k3d/share/shaders/k3d_fur2.sl:126:	if ( clump_dark_strength > 0.0 ) {
k3d/share/shaders/k3d_fur2.sl:127:	    clump_darkening = 1 - ( clump_dark_strength * 
k3d/share/shaders/k3d_fur2.sl:128:                                    abs(clamp(nL.normalize(-1*clump_vect), -1, 0)));
k3d/share/shaders/k3d_fur2.sl:130:	    clump_darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:133:	/* get light source parameters */
k3d/share/shaders/k3d_fur2.sl:134:	if ( lightsource("__nonspecular",nonspecular) == 0)
k3d/share/shaders/k3d_fur2.sl:135:	    nonspecular = 0;
k3d/share/shaders/k3d_fur2.sl:136:	if ( lightsource("__SpecularColor",SpecularColor) == 0)
k3d/share/shaders/k3d_fur2.sl:137:	    SpecularColor = color 1;
k3d/share/shaders/k3d_fur2.sl:139:	Cspec += (1-nonspecular) * SpecularColor * clump_darkening * 
k3d/share/shaders/k3d_fur2.sl:140:	    ((SPEC1*Cl*pow(Kajiya, 1/roughness1)) + 
k3d/share/shaders/k3d_fur2.sl:141:	     (SPEC2*Cl*pow(Kajiya, 1/roughness2)));
k3d/share/shaders/k3d_fur2.sl:143:	Cdiff += clump_darkening * fnc_diffuselgt(Cl, L, norm_hair);
k3d/share/shaders/k3d_fur2.sl:146:    darkening = clamp(hair_col_var, 0, 1);
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:154:	   + ((v) * Kspec * Cspec * specularcolor));
k3d/share/shaders/k3d_fur2.sl:156:    Ci = clamp(Ci, color 0, color 1 );
k3d/share/shaders/k3d_glass.sl:2: * glass.sl -- Shiny reflective & refractive glass, using ray tracing.
k3d/share/shaders/k3d_glass.sl:4: * Description:
k3d/share/shaders/k3d_glass.sl:5: *   Makes semi-transparent glass, using ray tracing to calculate
k3d/share/shaders/k3d_glass.sl:6: *   reflections and refractions of the environment.
k3d/share/shaders/k3d_glass.sl:8: * Parameters:
k3d/share/shaders/k3d_glass.sl:9: *    Ka, Kd, Ks, roughness, specularcolor - The usual meaning
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:22: * Author: Larry Gritz, 1999  (lg@bmrt.org)
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:32:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_glass.sl:33:#include "k3d_material.h"
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:36:		  color specularcolor = 1;
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:40:		  color transmitcolor = 1;
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:3: *  ivan@SpamSucks_martian-labs.com
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:7: * Written as an explanation to the talk I gave at
k3d/share/shaders/k3d_gloop.sl:8: * the "stupid renderman tricks" section of the 1998
k3d/share/shaders/k3d_gloop.sl:9: * Renderman Users Group meeting at siggraph.
k3d/share/shaders/k3d_gloop.sl:11: * freq - the frequency of the noise. Lower values
k3d/share/shaders/k3d_gloop.sl:12: *        will cause a larger displacement so you will 
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: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:28:  vector overdist = .1;
k3d/share/shaders/k3d_gloop.sl:29:  vector stepsize = magnitude/freq;
k3d/share/shaders/k3d_gloop.sl:31:  point  Psh = transform("object",P)*freq;
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:37:  point  Pou = Psh + (dPduN*overdist);/*P Over a distance in U*/
k3d/share/shaders/k3d_gloop.sl:38:  point  Pov = Psh + (dPdvN*overdist);
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:48:  /*init deflected derivatives*/
k3d/share/shaders/k3d_gloop.sl:49:  vector DdPdu = dPduN;
k3d/share/shaders/k3d_gloop.sl:50:  vector DdPdv = dPdvN;
k3d/share/shaders/k3d_gloop.sl:52:  vector step = DdPdu^DdPdv;
k3d/share/shaders/k3d_gloop.sl:54:  /*where it all happens*/
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:57:    DdPdu = normalize(DdPdu+(step*chu));
k3d/share/shaders/k3d_gloop.sl:58:    DdPdv = normalize(DdPdv+(step*chv));
k3d/share/shaders/k3d_gloop.sl:62:  /* wash your hands after displacing P*/
k3d/share/shaders/k3d_gloop.sl:63:  N = normalize(calculatenormal(P));
k3d/share/shaders/k3d_glow.sl:1:surface k3d_glow(float attenuation = 2.0;
k3d/share/shaders/k3d_glow.sl:2:		 color centercolor = 1.0;
k3d/share/shaders/k3d_glow.sl:3:		 color edgecolor = color(1.0, 1.0, 0.0))
k3d/share/shaders/k3d_glow.sl:5:  float incidence, strength;
k3d/share/shaders/k3d_glow.sl:6:  color C;
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:11:      // Normalize incidence
k3d/share/shaders/k3d_glow.sl:14:      // Calculate a "strength" function based on incidence
k3d/share/shaders/k3d_glow.sl:15:      strength = pow(incidence, attenuation);
k3d/share/shaders/k3d_glow.sl:17:      C = mix(edgecolor, centercolor, strength);
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_glow.sl:21:      Ci = C * strength * Os;
k3d/share/shaders/k3d_gmarbtile_polish.sl:2: * gmarbtile_polish.sl -- polished green marble tiles
k3d/share/shaders/k3d_gmarbtile_polish.sl:5: *   Makes the same marble texture as greenmarble, but polished (with ray
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:9: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic
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:15: *   sharpness - how sharp the veins appear
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:20: * AUTHOR: written by Larry Gritz
k3d/share/shaders/k3d_gmarbtile_polish.sl:24:#include "k3d_rayserver.h"
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:30:			     color specularcolor = 1;
k3d/share/shaders/k3d_gmarbtile_polish.sl:32:			     color darkcolor = color(0.01, 0.12, 0.004);
k3d/share/shaders/k3d_gmarbtile_polish.sl:33:			     color lightcolor = color(0.06, 0.18, 0.02);
k3d/share/shaders/k3d_gmarbtile_polish.sl:34:			     color veincolor = color(0.47, 0.57, 0.03);
k3d/share/shaders/k3d_gmarbtile_polish.sl:35:			     color groovecolor = color(.02, .02, .02);
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:39:			     float groovewidth = 0.015;
k3d/share/shaders/k3d_gmarbtile_polish.sl:40:			     string envname = "", envspace = "NDC";
k3d/share/shaders/k3d_gmarbtile_polish.sl:41:			     uniform float envrad = 100, rayjitter =
k3d/share/shaders/k3d_gmarbtile_polish.sl:42:			     0, raysamples = 1;
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:48:  color Ct, env;
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: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:57:  float dss = filterwidth(ss);
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:68:   * First calculate the underlying color of the substrate
k3d/share/shaders/k3d_gmarbtile_polish.sl:70:  turb = 0.5 * turbulence(PP, dPP, 5, 2, 0.5);
k3d/share/shaders/k3d_gmarbtile_polish.sl:71:  Ct = mix(darkcolor, lightcolor, smoothstep(0.1, .35, turb));
k3d/share/shaders/k3d_gmarbtile_polish.sl:74:   * Now we layer on the veins
k3d/share/shaders/k3d_gmarbtile_polish.sl:77:  /* perturb the lookup */
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:81:  turbsum = 0;
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:89:      turbsum += (1 - turbsum) * turb;
k3d/share/shaders/k3d_gmarbtile_polish.sl:90:      freq *= 2;
k3d/share/shaders/k3d_gmarbtile_polish.sl:92:  turbsum *=
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:96:  Ct = mix(Ct, veincolor, turbsum);
k3d/share/shaders/k3d_gmarbtile_polish.sl:98:  Ct = mix(groovecolor, Ct, groovy);
k3d/share/shaders/k3d_gmarbtile_polish.sl:100:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_gmarbtile_polish.sl:101:  vector V = normalize(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:105:  env *= groovy * specularcolor;
k3d/share/shaders/k3d_gooch.sl:1:/* Renamed to MKgooch.sl for RMR -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_gooch.sl:4: *              non-photorealistic lighting model
k3d/share/shaders/k3d_gooch.sl:6: * DESCRIPTION   : This model is described in "A Non-Photorealistc
k3d/share/shaders/k3d_gooch.sl:7: *                 Lighting Model For Automatic Technical 
k3d/share/shaders/k3d_gooch.sl:8: *                 Illustration" in the Siggraph 1998 Proceedings.
k3d/share/shaders/k3d_gooch.sl:9: *                 http://www.cs.utah.edu/~gooch/SIG98/abstract.html
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:17: *  b            : used to construct the cool color
k3d/share/shaders/k3d_gooch.sl:18: *  y            : used to construct the warm color
k3d/share/shaders/k3d_gooch.sl:19: *  roughness    : specular roughness
k3d/share/shaders/k3d_gooch.sl:20: *  specularcolor: specular hilight color
k3d/share/shaders/k3d_gooch.sl:22: * AUTHOR: written by Mike King
k3d/share/shaders/k3d_gooch.sl:26:surface
k3d/share/shaders/k3d_gooch.sl:34:         float roughness = .1;
k3d/share/shaders/k3d_gooch.sl:35:         color specularcolor = 1;)
k3d/share/shaders/k3d_gooch.sl:37:    normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_gooch.sl:38:    color blue = color(0,0,b);
k3d/share/shaders/k3d_gooch.sl:39:    color yellow = color(y,y,0);
k3d/share/shaders/k3d_gooch.sl:41:    color Cgooch = color(0,0,0); 
k3d/share/shaders/k3d_gooch.sl:43:    color kcool,kwarm;
k3d/share/shaders/k3d_gooch.sl:46:    kwarm = yellow + (Cs * beta);
k3d/share/shaders/k3d_gooch.sl:48:        ldotn = (normalize(L)).Nf;
k3d/share/shaders/k3d_gooch.sl:50:        Cgooch += mix(kcool,kwarm,blendval); 
k3d/share/shaders/k3d_gooch.sl:56:                specularcolor*Ks*specular(Nf,-normalize(I),roughness)));
k3d/share/shaders/k3d_gouge.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_gouge.sl:2:/* From the RenderMan Companion p.379 */
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:11:		spin	= 0.0;		/* each pin gets its texture spun */
k3d/share/shaders/k3d_gouge.sl:12:	string	texturename = "")
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_gouge.sl:23:   {  P += (-Km * texture(texturename,s+spin,y/15.0)) * normalize(N);
k3d/share/shaders/k3d_gouge.sl:24:      N = calculatenormal(P);
k3d/share/shaders/k3d_gradient_t.sl:1:surface k3d_gradient_t(
k3d/share/shaders/k3d_gradient_t.sl:2:	color start_color = color(1, 0, 0);
k3d/share/shaders/k3d_gradient_t.sl:3:	color end_color = color(1, 1, 0);
k3d/share/shaders/k3d_gradient_t.sl:7:	color C = mix(start_color, end_color, t);
k3d/share/shaders/k3d_granite.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_granite.sl:2:/* From the RenderMan Companion p.352 */
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:9:k3d_granite(
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:6:        float roughness=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:8:        float paint_trans=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:10:        float ink_thresh=0.10;
k3d/share/shaders/k3d_graphic_lines.sl:12:				float line_scale_master=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:14:        string up_highlight="z";
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:20:        color color_curve_highlight_color1=(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:21:        color color_curve_highlight_color2=(0.1,0.05,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:22:        color color_curve_highlight_color3=(0.8,0.6,0.4);
k3d/share/shaders/k3d_graphic_lines.sl:23:        color color_curve_highlight_color4=(1.0,1.0,0.8);
k3d/share/shaders/k3d_graphic_lines.sl:24:        color color_curve_highlight_color5=(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:25:        color color_curve_highlight_color6=(1.0,1.0,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:29:				float tfreq_highlight=50;
k3d/share/shaders/k3d_graphic_lines.sl:30:				color illumcolor_highlight=(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:35:				float roughness_highlight=0.2;
k3d/share/shaders/k3d_graphic_lines.sl:37:        string up_paint="y";
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:43:        color color_curve_paint_color1=(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:44:        color color_curve_paint_color2=(0.1,0.05,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:45:        color color_curve_paint_color3=(0.8,0.6,0.4);
k3d/share/shaders/k3d_graphic_lines.sl:46:        color color_curve_paint_color4=(1.0,1.0,0.8);
k3d/share/shaders/k3d_graphic_lines.sl:47:        color color_curve_paint_color5=(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:48:        color color_curve_paint_color6=(1.0,1.0,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:52:				float tfreq_paint=50;
k3d/share/shaders/k3d_graphic_lines.sl:53:				color illumcolor_paint=(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:58:				float roughness_paint=0.2;
k3d/share/shaders/k3d_graphic_lines.sl:60:        string up_ink="x";
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:66:        color color_curve_ink_color1=(0.0,0.0,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:67:        color color_curve_ink_color2=(0.1,0.05,0.0);
k3d/share/shaders/k3d_graphic_lines.sl:68:        color color_curve_ink_color3=(0.8,0.6,0.4);
k3d/share/shaders/k3d_graphic_lines.sl:69:        color color_curve_ink_color4=(1.0,1.0,0.8);
k3d/share/shaders/k3d_graphic_lines.sl:70:        color color_curve_ink_color5=(1.0,1.0,1.0);
k3d/share/shaders/k3d_graphic_lines.sl:71:        color color_curve_ink_color6=(1.0,1.0,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:75:				float tfreq_ink=50;
k3d/share/shaders/k3d_graphic_lines.sl:76:				color illumcolor_ink=(0.0,0.0,0.0);
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:89:	normal N_highlight = N;
k3d/share/shaders/k3d_graphic_lines.sl:90:	color Ci_highlight = Ci;
k3d/share/shaders/k3d_graphic_lines.sl:91:	color Oi_highlight = Oi;
k3d/share/shaders/k3d_graphic_lines.sl:93:	color surface_color_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:94:	color layer_color_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:95:	color color_curve_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:96:	color layer_opac_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:106:	vector Nf_highlight;
k3d/share/shaders/k3d_graphic_lines.sl:107:	vector V_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:111:	V_highlight=-normalize(I);
k3d/share/shaders/k3d_graphic_lines.sl:116:		z_highlight*=line_scale_highlight*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:121:		y_highlight*=line_scale_highlight*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:125:		x_highlight*=line_scale_highlight*line_scale_master;
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:129:	illumination_highlight=max(max(comp(illumcolor_highlight,0),comp(illumcolor_highlight,1)),comp(illumcolor_highlight,2));
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:137:	illumination_highlight=(illumination_highlight*contrast_highlight)+(1.0-contrast_highlight)/2.0+(brightness_highlight-1.0)+n_highlight*randomness_highlight;
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:140:		layer_color_highlight=0.0;
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:144:		layer_color_highlight=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:147:		layer_color_highlight=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:149:	stripemin_highlight=0.5-smoothstep(0.0,1.0,illumination_highlight)/2.0;
k3d/share/shaders/k3d_graphic_lines.sl:150:	stripemax_highlight=0.5+smoothstep(0.0,1.0,illumination_highlight)/2.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:152:	layer_opac_highlight=color(val_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:155:	color_curve_highlight=spline(color_val_highlight,color_curve_highlight_color1,color_curve_highlight_color2,color_curve_highlight_color3,color_curve_highlight_color4,color_curve_highlight_color5,color_curve_highlight_color6);
k3d/share/shaders/k3d_graphic_lines.sl:156:	float spacescale_highlight=length(vtransform("shader",normalize(N_highlight)));
k3d/share/shaders/k3d_graphic_lines.sl:157:	vector Ndisp_highlight=normalize(N_highlight)*(0/max(spacescale_highlight,1e-6));
k3d/share/shaders/k3d_graphic_lines.sl:160:	N_highlight=normalize(calculatenormal(P_highlight+(1-0)*Ndisp_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:167:	normal N_paint = N;
k3d/share/shaders/k3d_graphic_lines.sl:168:	color Ci_paint = Ci;
k3d/share/shaders/k3d_graphic_lines.sl:169:	color Oi_paint = Oi;
k3d/share/shaders/k3d_graphic_lines.sl:171:	color surface_color_paint;
k3d/share/shaders/k3d_graphic_lines.sl:172:	color layer_color_paint;
k3d/share/shaders/k3d_graphic_lines.sl:173:	color color_curve_paint;
k3d/share/shaders/k3d_graphic_lines.sl:174:	color layer_opac_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:184:	vector Nf_paint;
k3d/share/shaders/k3d_graphic_lines.sl:185:	vector V_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:189:	V_paint=-normalize(I);
k3d/share/shaders/k3d_graphic_lines.sl:192:		z_paint*=line_scale_paint*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:197:		y_paint*=line_scale_paint*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:201:		x_paint*=line_scale_paint*line_scale_master;
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:204:	illumination_paint=max(max(comp(illumcolor_paint,0),comp(illumcolor_paint,1)),comp(illumcolor_paint,2));
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:211:	illumination_paint=(illumination_paint*contrast_paint)+(1.0-contrast_paint)/2.0+(brightness_paint-1.0)+n_paint*randomness_paint;
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:214:		layer_color_paint=0.0;
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:218:		layer_color_paint=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:221:		layer_color_paint=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:222:	}stripemin_paint=0.5-smoothstep(0.0,1.0,illumination_paint)/2.0;
k3d/share/shaders/k3d_graphic_lines.sl:223:	stripemax_paint=0.5+smoothstep(0.0,1.0,illumination_paint)/2.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:225:	layer_opac_paint=color(val1);
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:228:	color_curve_paint=spline(color_val1,color_curve_paint_color1,color_curve_paint_color2,color_curve_paint_color3,color_curve_paint_color4,color_curve_paint_color5,color_curve_paint_color6);
k3d/share/shaders/k3d_graphic_lines.sl:229:	float spacescale1=length(vtransform("shader",normalize(N_paint)));
k3d/share/shaders/k3d_graphic_lines.sl:230:	vector Ndisp1=normalize(N_paint)*(0/max(spacescale1,1e-6));
k3d/share/shaders/k3d_graphic_lines.sl:232:	N_paint=normalize(calculatenormal(P_paint+(1-0)*Ndisp1));
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:239:	normal N_ink = N;
k3d/share/shaders/k3d_graphic_lines.sl:240:	color Ci_ink = Ci;
k3d/share/shaders/k3d_graphic_lines.sl:241:	color Oi_ink = Oi;
k3d/share/shaders/k3d_graphic_lines.sl:243:	color surface_color_ink;
k3d/share/shaders/k3d_graphic_lines.sl:244:	color layer_color_ink;
k3d/share/shaders/k3d_graphic_lines.sl:245:	color color_curve_ink;
k3d/share/shaders/k3d_graphic_lines.sl:246:	color layer_opac_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:256:	vector Nf_ink;
k3d/share/shaders/k3d_graphic_lines.sl:257:	vector V_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:261:	V_ink=-normalize(I);
k3d/share/shaders/k3d_graphic_lines.sl:264:		z_ink*=line_scale_ink*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:269:		y_ink*=line_scale_ink*line_scale_master;
k3d/share/shaders/k3d_graphic_lines.sl:273:		x_ink*=line_scale_ink*line_scale_master;
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:276:	illumination_ink=max(max(comp(illumcolor_ink,0),comp(illumcolor_ink,1)),comp(illumcolor_ink,2));
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:283:	illumination_ink=(illumination_ink*contrast_ink)+(1.0-contrast_ink)/2.0+(brightness_ink-1.0)+n_ink*randomness_ink;
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:286:		layer_color_ink=0.0;
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:290:		layer_color_ink=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:293:		layer_color_ink=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:294:	}stripemin_ink=0.5-smoothstep(0.0,1.0,illumination_ink)/2.0;
k3d/share/shaders/k3d_graphic_lines.sl:295:	stripemax_ink=0.5+smoothstep(0.0,1.0,illumination_ink)/2.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:297:	layer_opac_ink=color(val2);
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:300:	color_curve_ink=spline(color_val2,color_curve_ink_color1,color_curve_ink_color2,color_curve_ink_color3,color_curve_ink_color4,color_curve_ink_color5,color_curve_ink_color6);
k3d/share/shaders/k3d_graphic_lines.sl:301:	float spacescale2=length(vtransform("shader",normalize(N_ink)));
k3d/share/shaders/k3d_graphic_lines.sl:302:	vector Ndisp2=normalize(N_ink)*(0/max(spacescale2,1e-6));
k3d/share/shaders/k3d_graphic_lines.sl:304:	N_ink=normalize(calculatenormal(P_ink+(1-0)*Ndisp2));
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:308:	/** blend 3 layers **/
k3d/share/shaders/k3d_graphic_lines.sl:314:	glinespec(vector N, V; float roughness)
k3d/share/shaders/k3d_graphic_lines.sl:317:		vector H;
k3d/share/shaders/k3d_graphic_lines.sl:320:			H = normalize(normalize(L)+V);
k3d/share/shaders/k3d_graphic_lines.sl:321:			C += pow(N.H, 1/roughness);
k3d/share/shaders/k3d_graphic_lines.sl:323:		return C;
k3d/share/shaders/k3d_graphic_lines.sl:326:	float cos_here;
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:331:	color gline_color, layer_color;
k3d/share/shaders/k3d_graphic_lines.sl:332:	color gline_opac, layer_opac;
k3d/share/shaders/k3d_graphic_lines.sl:334:	Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_graphic_lines.sl:335:	normI = normalize(I);
k3d/share/shaders/k3d_graphic_lines.sl:337:	/* background layer  */
k3d/share/shaders/k3d_graphic_lines.sl:338:	gline_color = color (0, 0, 0);
k3d/share/shaders/k3d_graphic_lines.sl:341:	/* gline paint layer ) */
k3d/share/shaders/k3d_graphic_lines.sl:343:	/* only care about percentage illumination */
k3d/share/shaders/k3d_graphic_lines.sl:346:	diff += normalize(L).Nf;
k3d/share/shaders/k3d_graphic_lines.sl:348:	/* antialias the transition */
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:351:	/* specular -- transition also antialiased */
k3d/share/shaders/k3d_graphic_lines.sl:352:	spec = glinespec(Nf, -normalize(I), roughness);
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:356:	layer_opac = Oi_paint;
k3d/share/shaders/k3d_graphic_lines.sl:358:	gline_color = blend(gline_color, layer_color, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:359:	gline_opac = union(gline_opac, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:361:	/* gline ink layer ) */
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:369:		layer_color = Ci_ink;
k3d/share/shaders/k3d_graphic_lines.sl:371:		layer_color = 0;
k3d/share/shaders/k3d_graphic_lines.sl:373:	gline_color = blend(gline_color, layer_color, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:374:	gline_opac = union(gline_opac, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:376:	color glineOi = gline_opac;
k3d/share/shaders/k3d_graphic_lines.sl:377:	color glineCi = gline_opac * gline_color;
k3d/share/shaders/k3d_graphic_lines.sl:379:	/** Surface main-code end **/
k3d/share/shaders/k3d_grass_displace.sl:2: * grass.sl

k3d/share/shaders/k3d_grass_displace.sl:5: * creating a random look on the grass texture.

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:8: * pattern.  The displacements are circular.

k3d/share/shaders/k3d_grass_displace.sl:10: *   by Lawrence D. Chin, cs184-bo

k3d/share/shaders/k3d_grass_displace.sl:13:#include "k3d_rmannotes.h"

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

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

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

k3d/share/shaders/k3d_grass_displace.sl:42:      z = sqrt(pow(x,2) + pow(y,2));

k3d/share/shaders/k3d_grass_displace.sl:54:      z = sqrt(pow(x,2) + pow(y,2));

k3d/share/shaders/k3d_grass_displace.sl:63:  N = calculatenormal(P);

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

k3d/share/shaders/k3d_grass_surface.sl:4: *  by Lawrence D. Chin, cs184-bo

k3d/share/shaders/k3d_grass_surface.sl:7:#include "k3d_rmannotes.h"

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:16:  color color1 = color(0,1,0), color2 = color(0.5,0.5,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:23:  float noi = noise(s * noifreq, t * noifreq);

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:35:      d = distance(center,(s,t,0));

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

k3d/share/shaders/k3d_grass_surface.sl:37:      Ci = blend(color1, color2, layer_opac);

k3d/share/shaders/k3d_grass_surface.sl:39:      Ci = color1;

k3d/share/shaders/k3d_grass_surface.sl:42:    Ci = color1;

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:8: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic
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:13: *   sharpness - how sharp the veins appear
k3d/share/shaders/k3d_greenmarble.sl:16: * AUTHOR: Larry Gritz, 1994
k3d/share/shaders/k3d_greenmarble.sl:21:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_greenmarble.sl:22:#include "k3d_material.h"
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:26:			color specularcolor = 1;
k3d/share/shaders/k3d_greenmarble.sl:27:			color darkcolor = color(0.01, 0.12, 0.004);
k3d/share/shaders/k3d_greenmarble.sl:28:			color lightcolor = color(0.06, 0.18, 0.02);
k3d/share/shaders/k3d_greenmarble.sl:29:			color veincolor = color(0.47, 0.57, 0.03);
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:34:  color Ct;
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:45:  turb = 0.5 * turbulence(PP, dPP, 5, 2, 0.5);
k3d/share/shaders/k3d_greenmarble.sl:46:  Ct = mix(darkcolor, lightcolor, smoothstep(0.1, .35, turb));
k3d/share/shaders/k3d_greenmarble.sl:49:   * Now we layer on the veins
k3d/share/shaders/k3d_greenmarble.sl:52:  /* perturb the lookup */
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:56:  turbsum = 0;
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:63:      turbsum += (1 - turbsum) * turb;
k3d/share/shaders/k3d_greenmarble.sl:64:      freq *= 2;
k3d/share/shaders/k3d_greenmarble.sl:66:  turbsum *=
k3d/share/shaders/k3d_greenmarble.sl:67:    smoothstep(-0.1, 0.05, snoise(2 * (PP + vector(-4.4, 8.34, 27.1))));
k3d/share/shaders/k3d_greenmarble.sl:69:  Ct = mix(Ct, veincolor, turbsum);
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:1:/** Grid shader copyright 2005 Daniel Scott Matthews dan@3-e.net **/
k3d/share/shaders/k3d_grids.sl:3:surface k3d_grids (
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:9:color specularcolor=color(1, 1, 1); 
k3d/share/shaders/k3d_grids.sl:10:color ambientcolor=color(0.5,0.5,0.5); 
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:17:color G1L1_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:18:color G1L1_GridColor=color(0,0,0); 
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:25:color G1L2_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:26:color G1L2_GridColor=color(0,0,0); 
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:33:color G2L1_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:34:color G2L1_GridColor=color(0,0,0); 
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:41:color G2L2_SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids.sl:42:color G2L2_GridColor=color(0,0,0); 
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: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:59:/** Grid 1 Color **/
k3d/share/shaders/k3d_grids.sl:61:rotate2d(s, t, radians(G1L1_rotation), 0.5, 0.5, G1L1_ss, G1L1_tt);
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:69:rotate2d(s, t, radians(G1L2_rotation), 0.5, 0.5, G1L2_ss, G1L2_tt);
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:76:vector G1_V = -normalize(I);
k3d/share/shaders/k3d_grids.sl:78:/** Grid 2 Opacity **/
k3d/share/shaders/k3d_grids.sl:80:rotate2d(s, t, radians(G2L1_rotation), 0.5, 0.5, G2L1_ss, G2L1_tt);
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:88:rotate2d(s, t, radians(G2L2_rotation), 0.5, 0.5, G2L2_ss, G2L2_tt);
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:3: normal
k3d/share/shaders/k3d_grids_disp.sl:4: Displace (normal dir; float amp; float truedisp;)
k3d/share/shaders/k3d_grids_disp.sl:6: extern point P;
k3d/share/shaders/k3d_grids_disp.sl:7: float spacescale = length(vtransform("shader", dir));
k3d/share/shaders/k3d_grids_disp.sl:8: vector Ndisp = dir * (amp / max(spacescale,1e-6));
k3d/share/shaders/k3d_grids_disp.sl:9: P += truedisp * Ndisp;
k3d/share/shaders/k3d_grids_disp.sl:10: return normalize (calculatenormal (P + (1-truedisp)*Ndisp));
k3d/share/shaders/k3d_grids_disp.sl:13: displacement k3d_grids_disp (
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:18:color SurfaceColor=color(1,1,1); 
k3d/share/shaders/k3d_grids_disp.sl:19:color GridColor=color(0,0,0); 
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:26:#define repeat(x,freq) (mod((x) * (freq), 1.0))
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:33:rotate2d(s, t, radians(rotation0), 0.5, 0.5, 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: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:46:rotate2d(s, t, radians(rotation1), 0.5, 0.5, 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:53:/** ColorToFloat_Brick_2 **/
k3d/share/shaders/k3d_grids_disp.sl:55: N = Displace(normalize(N),0.05*temp_f_2,0);
k3d/share/shaders/k3d_hair.sl:1:/** From RenderMan AppNote #19 */
k3d/share/shaders/k3d_hair.sl:3:surface k3d_hair(
k3d/share/shaders/k3d_hair.sl:7:	float roughness = .15;
k3d/share/shaders/k3d_hair.sl:8:	color rootcolor = color (.109, .037, .007);
k3d/share/shaders/k3d_hair.sl:9:	color tipcolor = color (.519, .325, .125);
k3d/share/shaders/k3d_hair.sl:10:	color specularcolor = (color(1) + tipcolor) / 2;
k3d/share/shaders/k3d_hair.sl:13:	vector T = normalize (dPdv); /* tangent along length of hair */
k3d/share/shaders/k3d_hair.sl:14:	vector V = -normalize(I);    /* V is the view vector */
k3d/share/shaders/k3d_hair.sl:15:	color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
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:21:			cosang = cos (abs (acos (T.normalize(L)) - acos (-T.V)));
k3d/share/shaders/k3d_hair.sl:22:			Cspec += Cl * v * pow (cosang, 1/roughness);
k3d/share/shaders/k3d_hair.sl:25:			/* We multipled by v to make it darker at the roots.  This assumes v=0 at the root, v=1 at the tip.  */
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:1:/*Environment Light to project an environment map onto 3D geometry - designed

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:3:* dynamic range and more realistic colours.

k3d/share/shaders/k3d_hdr_light.sl:5:*Created by Simon Bunker 27th September 2001

k3d/share/shaders/k3d_hdr_light.sl:6:*simon@rendermania.com http://www.rendermania.com/HDRI/

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:9:*notice remain intact and that I am acknowledged as the original author. Please

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:11:*or bug reports related to this shader 

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

k3d/share/shaders/k3d_hdr_light.sl:18:	color hdrtex;

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

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:33:		hdrtex = texture(envname,ss,tt,"blur",blur);

k3d/share/shaders/k3d_hdr_light.sl:36:	return hdrtex;

k3d/share/shaders/k3d_hdr_light.sl:40:light k3d_hdr_light (

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

k3d/share/shaders/k3d_hdr_light.sl:43:	string envname = "";

k3d/share/shaders/k3d_hdr_light.sl:44:	string envspace = "shader";

k3d/share/shaders/k3d_hdr_light.sl:45:	string mappingtype = "probe";

k3d/share/shaders/k3d_hdr_light.sl:46:	point origin = (0,0,0);

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

k3d/share/shaders/k3d_hdr_light.sl:49:	string shadowname = "";

k3d/share/shaders/k3d_hdr_light.sl:51:	float shadowblur = 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:58:vector axis = normalize(N);

k3d/share/shaders/k3d_hdr_light.sl:60:vector axis = normalize(vector "shader" (0,0,1));

k3d/share/shaders/k3d_hdr_light.sl:63:	solar (-axis, 1.570796327) {

k3d/share/shaders/k3d_hdr_light.sl:64:		color Ct;

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:71:			Ct = color (1,0,0);

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:77:				Ct = hdrenv(envname,R,blur);

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

k3d/share/shaders/k3d_hdr_light.sl:82:				Ct = environment(envname,R,"blur",blur);

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

k3d/share/shaders/k3d_hdr_light.sl:87:				Ct = texture(envname,s,t,"blur",blur);

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

k3d/share/shaders/k3d_hdr_light.sl:95:		            Cl *= 1 - shadow(shadowname, Ps, "samples", shadowsamples, "blur", shadowblur, "bias", shadowbias);

k3d/share/shaders/k3d_hdr_light.sl:99:		Cl = Ct * intensity * exposure;

k3d/share/shaders/k3d_hdr_surface.sl:1:/*Environment Light to project an environment map onto 3D geometry - designed

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:3:* dynamic range 

k3d/share/shaders/k3d_hdr_surface.sl:5:*Created by Simon Bunker 27th September 2001

k3d/share/shaders/k3d_hdr_surface.sl:6:*simon@rendermania.com http://www.rendermania.com/HDRI/

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:9:*notice remain intact and that I am acknowledged as the original author. Please

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:11:*or bug reports related to this shader 

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

k3d/share/shaders/k3d_hdr_surface.sl:17:	color hdrtex;

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

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:32:		hdrtex = texture(envname,ss,tt,"blur",blur);

k3d/share/shaders/k3d_hdr_surface.sl:35:	return hdrtex;

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

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

k3d/share/shaders/k3d_hdr_surface.sl:42:	string envname = "";

k3d/share/shaders/k3d_hdr_surface.sl:43:	string envspace = "shader";

k3d/share/shaders/k3d_hdr_surface.sl:44:	string mappingtype = "probe";

k3d/share/shaders/k3d_hdr_surface.sl:45:	point origin = (0,0,0);

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

k3d/share/shaders/k3d_hdr_surface.sl:50:	color Ct;

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:56:			Ct = hdrenv(envname,R,blur);

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

k3d/share/shaders/k3d_hdr_surface.sl:61:			Ct = environment(envname,R,"blur",blur);

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

k3d/share/shaders/k3d_hdr_surface.sl:66:			Ct = texture(envname,s,t,"blur",blur);

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

k3d/share/shaders/k3d_hdr_surface.sl:73:	Ci = Cs * Oi * Ct * intensity * exposure;

k3d/share/shaders/k3d_hdri1.sl:1:light k3d_hdri1 (string envname = "")
k3d/share/shaders/k3d_hdri1.sl:3:    solar () {
k3d/share/shaders/k3d_hdri1.sl:5:	    Cl = environment (envname, -L, "blur", 0.5);
k3d/share/shaders/k3d_hdri2.sl:2:k3d_hdri2 (float intensity = 1;
k3d/share/shaders/k3d_hdri2.sl:3:       color lightcolor = 1;
k3d/share/shaders/k3d_hdri2.sl:4:       string envname = "";
k3d/share/shaders/k3d_hdri2.sl:5:       string envspace = "world";
k3d/share/shaders/k3d_hdri2.sl:6:       float envblur = 0.5;
k3d/share/shaders/k3d_hdri2.sl:7:       string shadowname = "";
k3d/share/shaders/k3d_hdri2.sl:8:       float shadowblur = 0.001;
k3d/share/shaders/k3d_hdri2.sl:12:    vector Lenv = vtransform (envspace, P-Ps);
k3d/share/shaders/k3d_hdri2.sl:15:	    Cl = environment (envname, Lenv, "blur", envblur);
k3d/share/shaders/k3d_hdri2.sl:18:            Cl *= 1 - color shadow (shadowname, Ps, "samples", shadowsamples,
k3d/share/shaders/k3d_hdri2.sl:19:				    "blur", shadowblur, "bias", shadowbias);
k3d/share/shaders/k3d_hexatile_bump.sl:2:* FGHexaTile_bump.sl -- "Simple shader to do "Hexagon" displacement"
k3d/share/shaders/k3d_hexatile_bump.sl:4:* Description:
k3d/share/shaders/k3d_hexatile_bump.sl:5:* A simple bump shader that tile a "Hexagon" pattern
k3d/share/shaders/k3d_hexatile_bump.sl:8:* Parameters:
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: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:17:*	string Projection = "planar" 		---	Projection "preoject.h"
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: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:31:* Larry Gritz "noises.h", "project.h", "patterns.h"
k3d/share/shaders/k3d_hexatile_bump.sl:32:* Arman "Advanced Renderman-"Creating CGI for Motion Picture.
k3d/share/shaders/k3d_hexatile_bump.sl:38:#include "k3d_project.h"
k3d/share/shaders/k3d_hexatile_bump.sl:39:#include "k3d_patterns.h"
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:46:float sthiscell = floor(ss)+0.5, tthiscell = floor(tt)+0.5;
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:53:			for (j = -1; j <= 1; j += 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:79:	string Name 	= "FGHexaTile_bump";
k3d/share/shaders/k3d_hexatile_bump.sl:87:	string Projection = "planar"; 
k3d/share/shaders/k3d_hexatile_bump.sl:88:	string Space	  = "shader"; 
k3d/share/shaders/k3d_hexatile_bump.sl:93:	float Truedisp	= 1; ) 
k3d/share/shaders/k3d_hexatile_bump.sl:97:ProjectTo2D (Projection,rotate(P,radians(Rotate),P1,P2),Space,array_to_mx(mx),SS,TT,Ds,Dt);
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:111:/*** ----- SmoothPulse macro ----- ***/
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:117:/*** ----- SmoothPulse macro ----- ***/
k3d/share/shaders/k3d_hexatile_bump.sl:120:/*** ----- True Displacement and bump ----- ***/
k3d/share/shaders/k3d_hexatile_bump.sl:121:normal 
k3d/share/shaders/k3d_hexatile_bump.sl:122:Displace (normal dir; vector space; float amp; float truedisp;)
k3d/share/shaders/k3d_hexatile_bump.sl:124:	extern point P;
k3d/share/shaders/k3d_hexatile_bump.sl:126:	vector Ndisp = dir * (amp / max(spacescale,1e-6));
k3d/share/shaders/k3d_hexatile_bump.sl:127:P += truedisp * Ndisp;
k3d/share/shaders/k3d_hexatile_bump.sl:128:return normalize (calculatenormal (P + (1-truedisp)*Ndisp));
k3d/share/shaders/k3d_hexatile_bump.sl:131:vector VShd = vtransform("shader", vector(normalize(N)));
k3d/share/shaders/k3d_hexatile_bump.sl:135:N = Displace(normalize(N),VShd,Km*disp,Truedisp); 
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:10: *    (presumably due to water or something), which darkens the tile or
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:16: *    Ka, Kd, Ks, roughness, specularcolor - work just like plastic
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:25: *    tile and mortar.
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:31: * AUTHOR: written by Larry Gritz, 1994
k3d/share/shaders/k3d_hextile.sl:34: *    15 Feb 1994 -- written by lg
k3d/share/shaders/k3d_hextile.sl:36: * last modified 15 Feb 94 by Larry Gritz
k3d/share/shaders/k3d_hextile.sl:44:surface
k3d/share/shaders/k3d_hextile.sl:48:         float roughness = .1;
k3d/share/shaders/k3d_hextile.sl:49:	 color specularcolor = 1;
k3d/share/shaders/k3d_hextile.sl:50:	 color tilecolor = color(.55,0,0);
k3d/share/shaders/k3d_hextile.sl:51:	 color mortarcolor = color(.5,.5,.5);
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: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:62:  color Ct, Ctile;
k3d/share/shaders/k3d_hextile.sl:67:  float mortar;
k3d/share/shaders/k3d_hextile.sl:74:  /* Determine how wide in s-t space one pixel projects to */
k3d/share/shaders/k3d_hextile.sl:81:  tilewidth = tileradius * 1.7320508;  /* sqrt(3) */
k3d/share/shaders/k3d_hextile.sl:82:  tt = mod (t, 1.5*tileradius);
k3d/share/shaders/k3d_hextile.sl:83:  ttile = floor (t/(1.5*tileradius));
k3d/share/shaders/k3d_hextile.sl:87:  stile = floor (ss / tilewidth);
k3d/share/shaders/k3d_hextile.sl:89:  mortar = 0;
k3d/share/shaders/k3d_hextile.sl:90:  mw2 = mortarwidth/2;
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:97:      y = 1.7320508 * (tt - tileradius);
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:110:  Ctile = tilecolor * (1 + tilevary * snoise(tileindex+0.5));
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: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:122:	      specularcolor * ks*specular(Nf,-normalize(I),roughness));
k3d/share/shaders/k3d_imagelayerclouds.sl:1:// Use signed Perlin noise
k3d/share/shaders/k3d_imagelayerclouds.sl:5:surface k3d_imagelayerclouds(float txtscale = 1;
k3d/share/shaders/k3d_imagelayerclouds.sl:6:			     color skycolor = color(.15, .15, .6);
k3d/share/shaders/k3d_imagelayerclouds.sl:7:			     color cloudcolor = color(1, 1, 1);
k3d/share/shaders/k3d_imagelayerclouds.sl:9:			     float threshold = 0.5;)
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: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:25:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_imagelayerclouds.sl:33:  Ct = mix(skycolor, cloudcolor, smoothstep(threshold, 1, value));
k3d/share/shaders/k3d_imagelayerclouds.sl:35:  /* Shade like matte, but use color Ct */
k3d/share/shaders/k3d_imagelayerclouds.sl:37:  Ci = Ct;			/* This makes the color disregard the lighting */
k3d/share/shaders/k3d_imagelayergradient.sl:1:surface k3d_imagelayergradient(color zenith = color(0, 0, 1);
k3d/share/shaders/k3d_imagelayergradient.sl:2:			       color sky = color(.5, .5, 1);
k3d/share/shaders/k3d_imagelayergradient.sl:3:			       color ground = color(.6, .6, .1);
k3d/share/shaders/k3d_imagelayergradient.sl:4:			       color nadir = color(0, 0, 0);)
k3d/share/shaders/k3d_imagelayergradient.sl:14:      Ci = Cs * mix(ground, nadir, (v - 0.5) * 2.0);
k3d/share/shaders/k3d_incandplastic.sl:1:/* incandPlastic.sl   version 1.0, Jan. 2002

k3d/share/shaders/k3d_incandplastic.sl:2: * Felipe Esquivel <felipe@siggraph.org.mx>

k3d/share/shaders/k3d_incandplastic.sl:4: * Este es un shader plastico con componente de

k3d/share/shaders/k3d_incandplastic.sl:7: * This is a normal plastic shader and includes an

k3d/share/shaders/k3d_incandplastic.sl:8: * incandescence value like the blinn shader.

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:17:	      color SpecularColor = 1;

k3d/share/shaders/k3d_incandplastic.sl:18:	      color Incandescence = color(0, 0, 0.3);)

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

k3d/share/shaders/k3d_incandplastic.sl:21:  vector NI;

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

k3d/share/shaders/k3d_incandplastic.sl:24:  NI = -normalize(I);

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:4: * is built into the renderer.
k3d/share/shaders/k3d_indirect.sl:6: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_indirect.sl:7: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_indirect.sl:8: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_indirect.sl:11:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_indirect.sl:14:light k3d_indirect(output float __nonspecular = 1;)
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:25:  vector axis = normalize(N);
k3d/share/shaders/k3d_indirect.sl:26:  solar(-axis, 0)
k3d/share/shaders/k3d_indirect.sl:28:    Cl = rs_indirect(Ps, axis);
k3d/share/shaders/k3d_leather.sl:4: * I have done this shader from JMredapple.sl for RMR

k3d/share/shaders/k3d_leather.sl:6: * add some parameter, change many thing

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:13: * 	old-autor jmerritt@warpax.com   :-)

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

k3d/share/shaders/k3d_leather.sl:18:k3d_leather (

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: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:24:	color red   = color(0.8,0.6,0.4);

k3d/share/shaders/k3d_leather.sl:25:	color dred  = color(0.5,0.3,0.10);

k3d/share/shaders/k3d_leather.sl:26:	color green = color(0.8,0.6,0.4);

k3d/share/shaders/k3d_leather.sl:27:	color brown = color(0.5,0.3,0.10);

k3d/share/shaders/k3d_leather.sl:28:	color black = color(0.5,0.3,0.10);

k3d/share/shaders/k3d_leather.sl:30:	/*BLOTCH sont les zebrure*/

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

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

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

k3d/share/shaders/k3d_leather.sl:43:	 * Shader variables

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:49:	color cs, small_speckle, base_color, reflect;

k3d/share/shaders/k3d_leather.sl:56:	 * Standard settings

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

k3d/share/shaders/k3d_leather.sl:59:	V = normalize(-I);

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:68:	 * goes to 1 or 0) are colored more and more green.

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: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:84:	                                /* t > T4 is pure green            */

k3d/share/shaders/k3d_leather.sl:85:	base_turb = noise(BASE_SF*sin(2*PI*s) + PI + label,

k3d/share/shaders/k3d_leather.sl:87:	base_turb = pow(base_turb, (1/redness));

k3d/share/shaders/k3d_leather.sl:89:	small_speckle = mix(red, green, BASE_GRC+

k3d/share/shaders/k3d_leather.sl:92:		base_turb = 0;

k3d/share/shaders/k3d_leather.sl:94:		base_turb *= (t-T1)/(T2-T1);

k3d/share/shaders/k3d_leather.sl:96:		base_turb *= (T4-t)/(T4-T3);

k3d/share/shaders/k3d_leather.sl:98:		base_turb = 0;

k3d/share/shaders/k3d_leather.sl:99:	base_color = spline(base_turb, green, green,

k3d/share/shaders/k3d_leather.sl:105:	 * Pick the blotch color.

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

k3d/share/shaders/k3d_leather.sl:110:	 * really simple noise routine.

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:117:	blotch_turb = noise(BLOTCH_SF*sin(2*PI*(s+.1234)) + PI + label,

k3d/share/shaders/k3d_leather.sl:119:	blotch = pow(blotch_turb, 1.3) * BLOTCH_TCF * 

k3d/share/shaders/k3d_leather.sl:120:	         pow(base_turb, 2);

k3d/share/shaders/k3d_leather.sl:127:	 * Set the brown specking.

k3d/share/shaders/k3d_leather.sl:129:	 * The apple has brown speckles on it, set by mixing

k3d/share/shaders/k3d_leather.sl:131:	 * specks are very dot-like in nature, and this

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

k3d/share/shaders/k3d_leather.sl:133:	 * shader.

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:141:	 * Determine where the apple goes black at the poles.

k3d/share/shaders/k3d_leather.sl:142:	 * This simulates the spots where the stalk would be

k3d/share/shaders/k3d_leather.sl:143:	 * attached, and where the wierd bit at the very bottom

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

k3d/share/shaders/k3d_leather.sl:154:	 * color.

k3d/share/shaders/k3d_leather.sl:156:	cs = mix(base_color, dred, blotch);

k3d/share/shaders/k3d_leather.sl:157:	cs = mix(cs, brown, speck);

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:165:	 * highlights. We'd like them perturbed by the small

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:179:	disp = paramdisp * disp;

k3d/share/shaders/k3d_leather.sl:180:	newP = calculatenormal(P + disp * normalize(N));

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: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:207:	 * Combine everything to get Ci, in the standard form.

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:9: *   pretty plain looking and uninteresting; this shader takes some
k3d/share/shaders/k3d_lensflare.sl:10: *   liberties but looks pretty good.
k3d/share/shaders/k3d_lensflare.sl:12: * Parameters:
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:25: *          image center with the light position
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:37: * Author: Larry Gritz & Tony Apodaca, 1999
k3d/share/shaders/k3d_lensflare.sl:39: * Contacts:  lg@pixar.com
k3d/share/shaders/k3d_lensflare.sl:45:#include "k3d_patterns.h"
k3d/share/shaders/k3d_lensflare.sl:48:/* Helper function: compute the aspect ratio of the frame */
k3d/share/shaders/k3d_lensflare.sl:50:aspectratio()
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:54:  return (xcomp(Pcorner1) - xcomp(Pcorner0)) / (ycomp(Pcorner1) -
k3d/share/shaders/k3d_lensflare.sl:55:						ycomp(Pcorner0));
k3d/share/shaders/k3d_lensflare.sl:59:/* Helper function: compute the camera's diagonal field of view */
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:69:color
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:86:		      float bloomradius = 0.5;
k3d/share/shaders/k3d_lensflare.sl:87:		      float bloomstarry = 0.75;
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: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:106:    nrand += 1;
k3d/share/shaders/k3d_lensflare.sl:107:    return cellnoise(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:118:  Pndc *= vector(aspect, 1, 0);
k3d/share/shaders/k3d_lensflare.sl:119:  float dPndc = filterwidthp(Pndc);
k3d/share/shaders/k3d_lensflare.sl:121:  illuminance(P, vector "camera"(0, 0, 1), PI / 2)
k3d/share/shaders/k3d_lensflare.sl:123:    float atten = acos(zcomp(normalize(vector transform("camera", P + L))));
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:131:    nrand = 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:133:    Plight *= vector(aspect, 1, 0);
k3d/share/shaders/k3d_lensflare.sl:135:    vector Lvec = Plight - Pndc;
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:146:	float radius = sqrt(brightness) * 5 * mix(.2, bloomradius, urand());
k3d/share/shaders/k3d_lensflare.sl:148:	bloom = mix(0.5, bloom, bloomstarry);
k3d/share/shaders/k3d_lensflare.sl:149:	bloom = mix(1, bloom, smoothstep(0, 0.5, dist / radius));
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:154:    /* Starburst */
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:158:	  sqrt(brightness) * 5 * mix(.2, starburstradius, urand());
k3d/share/shaders/k3d_lensflare.sl:159:	float star = float pnoise(starburstnpoints * angle / (2 * PI),
k3d/share/shaders/k3d_lensflare.sl:160:				  starburstnpoints);
k3d/share/shaders/k3d_lensflare.sl:161:	star =
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:170:	  brightness * (rainbowintensity / intensity) *
k3d/share/shaders/k3d_lensflare.sl:171:	  rainbow((dist / rainbowradius - 1) / rainbowwidth,
k3d/share/shaders/k3d_lensflare.sl:172:		  (dPndc / rainbowradius) / rainbowwidth);
k3d/share/shaders/k3d_lensflare.sl:176:     * Now emit the random rings themselves
k3d/share/shaders/k3d_lensflare.sl:178:    vector axis = normalize(vector Plight);
k3d/share/shaders/k3d_lensflare.sl:179:    uniform float i;
k3d/share/shaders/k3d_lensflare.sl:180:    nrand = 20;			/* Reset on purpose! */
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:184:	point cntr = point(mix(-1.7, 1.7, alongaxis) * axis);
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:187:			   pow(urand(), 2)) * distance(cntr, Plight);
k3d/share/shaders/k3d_lensflare.sl:188:	color clr = Cl;
k3d/share/shaders/k3d_lensflare.sl:189:	clr *= 1 + spotvarycolor * (color cellnoise(i) - 0.5);
k3d/share/shaders/k3d_lensflare.sl:190:	float bright = 1 - (2 * radius);
k3d/share/shaders/k3d_lensflare.sl:191:	bright *= bright;
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: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:210:	    int = 1 - smoothstep(0, radius, axisdist);
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:10: *    C language version by F. Kenton Musgrave
k3d/share/shaders/k3d_luna.sl:11: *    Translation to Shading Language by Larry Gritz.
k3d/share/shaders/k3d_luna.sl:14: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_luna.sl:15: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_luna.sl:16: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_luna.sl:19: *    ??? - original C language version by Ken Musgrave
k3d/share/shaders/k3d_luna.sl:20: *    Apr 94 - translation to Shading Language by L. Gritz
k3d/share/shaders/k3d_luna.sl:22: * this file last updated 18 Apr 1994
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:37:		 color highland_color = .7;
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:52:  color Ct;
k3d/share/shaders/k3d_luna.sl:55:  float uu, ht, freq, scale;
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:63:  NN = normalize(N);
k3d/share/shaders/k3d_luna.sl:64:  radial_dist = sqrt(xcomp(PP) * xcomp(PP) + ycomp(PP) * ycomp(PP));
k3d/share/shaders/k3d_luna.sl:65:  omega = pow(lacunarity, (-.5) - H);
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:74:      l *= lacunarity;
k3d/share/shaders/k3d_luna.sl:81:  /* Insure that the crater is in one of the maria */
k3d/share/shaders/k3d_luna.sl:82:  temp1 = radial_dist * arg22;
k3d/share/shaders/k3d_luna.sl:84:    chaos -= arg23 * (1 - smoothstep(0, 1, temp1));
k3d/share/shaders/k3d_luna.sl:86:  if(chaos > highland_threshold)
k3d/share/shaders/k3d_luna.sl:89:      Ct += highland_color * chaos;
k3d/share/shaders/k3d_luna.sl:93:      PQ += chaos * maria_altitude * NN;
k3d/share/shaders/k3d_luna.sl:94:      Ct *= maria_basecolor + maria_color * chaos;
k3d/share/shaders/k3d_luna.sl:99:  /* Add crater */
k3d/share/shaders/k3d_luna.sl:100:  /* get normalized vector "v" */
k3d/share/shaders/k3d_luna.sl:102:  vv = point(xcomp(PP) / radial_dist, 0, zcomp(PP) / radial_dist);
k3d/share/shaders/k3d_luna.sl:104:  if(pd < peak_rad)
k3d/share/shaders/k3d_luna.sl:105:    {				/* central peak */
k3d/share/shaders/k3d_luna.sl:106:      uu = 1 - 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:115:    {				/* inner rim */
k3d/share/shaders/k3d_luna.sl:116:      uu = (pd - inner_rad) / (rim_rad - inner_rad);
k3d/share/shaders/k3d_luna.sl:118:      ht = rim_ht * smoothstep(0, 1, uu);
k3d/share/shaders/k3d_luna.sl:120:  else if(pd < outer_rad)
k3d/share/shaders/k3d_luna.sl:121:    {				/* outer rim */
k3d/share/shaders/k3d_luna.sl:122:      uu = 1 - (pd - rim_rad) / (outer_rad - rim_rad);
k3d/share/shaders/k3d_luna.sl:124:      ht = rim_ht * smoothstep(0, 1, uu * uu);
k3d/share/shaders/k3d_luna.sl:130:  Ct += color(lighten, lighten, lighten);
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:147:/*	  ht = wrinkled (vv, 2, .833, 4); */
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:162:/*	  ht = wrinkled (vv, 2, .833, 4); */
k3d/share/shaders/k3d_luna.sl:163:	  if(radial_dist > rim_rad)
k3d/share/shaders/k3d_luna.sl:170:  /* Make crater rays (PP, arg10, arg11, arg12, arg15, arg24, arg25, radial_dist);, yielding temp1 */
k3d/share/shaders/k3d_luna.sl:172:  if(pd >= rim_rad && pd < 0.4)
k3d/share/shaders/k3d_luna.sl:175:      raydist = 0.2 + 0.2 * snoise(20 * mod(u + 0.022, 1));
k3d/share/shaders/k3d_luna.sl:176:      lighten *= (1 - smoothstep(raydist - .2, raydist, pd));
k3d/share/shaders/k3d_luna.sl:179:  Ct += color(lighten, lighten, lighten);
k3d/share/shaders/k3d_luna.sl:182:  /* Recalc normal since we changed P a whole bunch. */
k3d/share/shaders/k3d_luna.sl:183:/*  N = normalize (calculatenormal (PQ)); */
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:6: * Description:
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:9: *   colors are a bland pastel blue and yellow, which should complement many
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:12: *   which I believe has something to do with spectacles in French.  Hence the
k3d/share/shaders/k3d_lunette.sl:13: *   name, anyway.  The pattern is calculated in 2D u,v coordinates.
k3d/share/shaders/k3d_lunette.sl:15: * Parameters:
k3d/share/shaders/k3d_lunette.sl:16: *   Ka, Kd, Ks, roughness, specularcolor - work like the plastic shader
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:21: *   colorBenhance - amount to enhance colorB's presence over colorA
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:31: * Author: written by Jonathan Merritt (jmerritt@warpax.com), 5th October 2002
k3d/share/shaders/k3d_lunette.sl:33: * License: This shader is distributed under the GNU General Public License.
k3d/share/shaders/k3d_lunette.sl:37:#include "k3d_patterns.h"
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:44: * coordinates.
k3d/share/shaders/k3d_lunette.sl:46: * Parameters:
k3d/share/shaders/k3d_lunette.sl:47: *   ss, tt - 2D pattern coordinates.
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:49: *                           and tt directions.  Also scales the noise in both
k3d/share/shaders/k3d_lunette.sl:50: *                           directions appropriately.
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:53: *                              cell over which the grid repeat occurs.
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:57: *                noise; decreasing it makes a broader noise.
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: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:65: *                   colorA and colorB are present in equal amounts.
k3d/share/shaders/k3d_lunette.sl:66: *                   Increasing this value puts more colorB in the output.
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:71:color lunetteColor (
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:79:	color colorB;		/* second 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:92:	 * the grid.  pulsegrid = 0 means that there is no grid at the point
k3d/share/shaders/k3d_lunette.sl:93:	 * whereas pulsegrid = 1 means that there IS a grid at the point.
k3d/share/shaders/k3d_lunette.sl:94:	 * pulsegrid varies smoothly between the two values to cope with
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:107:	 * between colorA and colorB, created using noise and other mixing
k3d/share/shaders/k3d_lunette.sl:108:	 * parameters.
k3d/share/shaders/k3d_lunette.sl:111:		point(ss*ssrepeats, tt*ttrepeats, noiseRandom);
k3d/share/shaders/k3d_lunette.sl:112:	float noisefilterwidth = filterwidthp(noisePt);
k3d/share/shaders/k3d_lunette.sl:114:		noisePt, noisefilterwidth, maxOctaves, lunacrity, gain
k3d/share/shaders/k3d_lunette.sl:116:	noiseamt = pow(noiseamt, colorBenhance);
k3d/share/shaders/k3d_lunette.sl:117:	color basecolor = mix(colorB, colorA, noiseamt);
k3d/share/shaders/k3d_lunette.sl:120:	 * find the base line color for the grid pattern
k3d/share/shaders/k3d_lunette.sl:122:	color linecolor = mix(basecolor, baselinecolor, gridDensity);
k3d/share/shaders/k3d_lunette.sl:125:	 * return the mix between the base grid and the colorful noise
k3d/share/shaders/k3d_lunette.sl:127:	return mix(basecolor, linecolor, pulsegrid);
k3d/share/shaders/k3d_lunette.sl:131:surface k3d_lunette (
k3d/share/shaders/k3d_lunette.sl:132:	/* Plastic illumination model parameters. */
k3d/share/shaders/k3d_lunette.sl:136:	float roughness = .1;
k3d/share/shaders/k3d_lunette.sl:137:	color specularcolor = 1;
k3d/share/shaders/k3d_lunette.sl:138:	/* Grid pattern parameters. */	
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:143:	/* Colors used. */
k3d/share/shaders/k3d_lunette.sl:144:	color colorA = color(.36, .58, .67);
k3d/share/shaders/k3d_lunette.sl:145:	color colorB = color(.88, .88, .71);
k3d/share/shaders/k3d_lunette.sl:146:	color baselinecolor = color(.51, .48, .52);
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:153:	float lunacrity = 1.3;
k3d/share/shaders/k3d_lunette.sl:157:	 * fetch the lunette color
k3d/share/shaders/k3d_lunette.sl:159:	color cc = lunetteColor(
k3d/share/shaders/k3d_lunette.sl:160:		u, v, urepeats, vrepeats, ulinewidth, vlinewidth,
k3d/share/shaders/k3d_lunette.sl:161:		colorA, colorB, noiseScale, noiseRandom, maxOctaves,
k3d/share/shaders/k3d_lunette.sl:162:		lunacrity, gain, colorBenhance, gridDensity, baselinecolor
k3d/share/shaders/k3d_lunette.sl:168:	normal Nf = faceforward (normalize(N),I);
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:2:string map1=""; 
k3d/share/shaders/k3d_map_pattern_1.sl:10:color lightwood=color(0.69,0.44,0.25); 
k3d/share/shaders/k3d_map_pattern_1.sl:11:color darkwood=color(0.35,0.22,0.08); 
k3d/share/shaders/k3d_map_pattern_1.sl:12:float grainy=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:16:float roughness = .1;
k3d/share/shaders/k3d_map_pattern_1.sl:17:color specularcolor = 1;
k3d/share/shaders/k3d_map_pattern_1.sl:20:/** Surface main-code start **/
k3d/share/shaders/k3d_map_pattern_1.sl:22:/** Texture_Brick_1 **/
k3d/share/shaders/k3d_map_pattern_1.sl:23:color temt_c1;
k3d/share/shaders/k3d_map_pattern_1.sl:36:temt_c1=texture(map1,temp_ss1,temp_tt1,"swidth",swidth1,"twidth",twidth1,"samples",samples1);
k3d/share/shaders/k3d_map_pattern_1.sl:40:temt_c1=texture(map1[channel1],temp_ss1,temp_tt1,"swidth",swidth1,"twidth",twidth1,"samples",samples1);
k3d/share/shaders/k3d_map_pattern_1.sl:43:/** ColorToFloat_Brick_3 **/
k3d/share/shaders/k3d_map_pattern_1.sl:46:color Ct; 
k3d/share/shaders/k3d_map_pattern_1.sl:47:float r, r2;
k3d/share/shaders/k3d_map_pattern_1.sl:49:color C_temp1;
k3d/share/shaders/k3d_map_pattern_1.sl:51:PP = txtscale * transform ("shader", P);
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:60:r = 0.2 + 0.8 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, r));
k3d/share/shaders/k3d_map_pattern_1.sl:63:r2 = grainy * (1.3 - noise (PQ)) + (1-grainy);
k3d/share/shaders/k3d_map_pattern_1.sl:65:Ct = mix (lightwood, darkwood, r*r2*r2);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_matte.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_matte.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:12:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_metal.sl:1:/* metal.sl - Standard metal surface for RenderMan Interface.
k3d/share/shaders/k3d_metal.sl:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_metal.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_metal.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:11:		  float roughness = .1;)
k3d/share/shaders/k3d_metal.sl:13:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_metal.sl:14:  vector V = -normalize(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:6: * Version ampliada de Mondo.sl. Recibe un archivo B/N como mate, donde

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

k3d/share/shaders/k3d_mondometal.sl:8: * se comporta igual que mondo simple.

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

k3d/share/shaders/k3d_mondometal.sl:13:    string abColorMap = "";

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: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:20:    string abSpecularMap = "";

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

k3d/share/shaders/k3d_mondometal.sl:22:    color abSpecularColor = color(1,1,1);

k3d/share/shaders/k3d_mondometal.sl:23:    string abSpecularColorMap = "";

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

k3d/share/shaders/k3d_mondometal.sl:26:    string abRoughnessMap = "";

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

k3d/share/shaders/k3d_mondometal.sl:28:    string abTransparencyMap = "";

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:31:    color abIncandescence = color(0,0,0);

k3d/share/shaders/k3d_mondometal.sl:32:    string abIncandescenseMap = "";

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:37:    float abReflectionMapBlur = 1;

k3d/share/shaders/k3d_mondometal.sl:38:    string abBumpMap = "";

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

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

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

k3d/share/shaders/k3d_mondometal.sl:47:    color Cmetal = color(0.0,0.76,0.79);

k3d/share/shaders/k3d_mondometal.sl:48:    string metalMatte = "";

k3d/share/shaders/k3d_mondometal.sl:49:    point STMatrix0 = point "shader" (1,0,0);

k3d/share/shaders/k3d_mondometal.sl:50:    point STMatrix1 = point "shader" (0,1,0);

k3d/share/shaders/k3d_mondometal.sl:57:    extern vector I;

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

k3d/share/shaders/k3d_mondometal.sl:60:    vector V, D;

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

k3d/share/shaders/k3d_mondometal.sl:63:    color Cmatte = 0;

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

k3d/share/shaders/k3d_mondometal.sl:66:    /* apply STMatrix to texture coordinates **/

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:70:    /* determine color **/

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:74:                            "swidth", abColorMapBlur,

k3d/share/shaders/k3d_mondometal.sl:75:                            "twidth", abColorMapBlur );

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:79:                            "swidth", abColorMapBlur,

k3d/share/shaders/k3d_mondometal.sl:80:                            "twidth", abColorMapBlur );

k3d/share/shaders/k3d_mondometal.sl:81:            /* need to un-premultiply the color in this case */

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

k3d/share/shaders/k3d_mondometal.sl:86:            Copac = color(1, 1, 1);

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

k3d/share/shaders/k3d_mondometal.sl:92:        Copac = color(1);

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

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:107:    /* determine specular */

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:111:                            "swidth", abSpecularMapBlur,

k3d/share/shaders/k3d_mondometal.sl:112:                            "twidth", abSpecularMapBlur );

k3d/share/shaders/k3d_mondometal.sl:117:        spec = abSpecular;

k3d/share/shaders/k3d_mondometal.sl:120:    /* determine specular color */

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

k3d/share/shaders/k3d_mondometal.sl:123:        Cspec = abSpecularColor * color texture(abSpecularColorMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:124:                      "swidth", abSpecularColorMapBlur, 

k3d/share/shaders/k3d_mondometal.sl:125:                      "twidth", abSpecularColorMapBlur );

k3d/share/shaders/k3d_mondometal.sl:129:        Cspec = abSpecularColor;

k3d/share/shaders/k3d_mondometal.sl:131:    /* determine roughness */

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

k3d/share/shaders/k3d_mondometal.sl:135:                            "swidth", abRoughnessMapBlur, 

k3d/share/shaders/k3d_mondometal.sl:136:                            "twidth", abRoughnessMapBlur );

k3d/share/shaders/k3d_mondometal.sl:140:        roughness = abRoughness;

k3d/share/shaders/k3d_mondometal.sl:143:    /* determine opacity */

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:148:            Copac = Copac * color texture(abTransparencyMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:149:                            "swidth", abTransparencyMapBlur, 

k3d/share/shaders/k3d_mondometal.sl:150:                            "twidth", abTransparencyMapBlur );

k3d/share/shaders/k3d_mondometal.sl:154:            Copac = Copac * (color(1) - color texture(abTransparencyMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:155:                            "swidth", abTransparencyMapBlur, 

k3d/share/shaders/k3d_mondometal.sl:156:                            "twidth", abTransparencyMapBlur ));

k3d/share/shaders/k3d_mondometal.sl:160:    /* determine incandescence */

k3d/share/shaders/k3d_mondometal.sl:163:        Cincand = abIncandescence * color texture(abIncandescenseMap, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:164:                            "swidth", abIncandescenseMapBlur, 

k3d/share/shaders/k3d_mondometal.sl:165:                            "twidth", abIncandescenseMapBlur );

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

k3d/share/shaders/k3d_mondometal.sl:177:                            "swidth", abBumpMapBlur,

k3d/share/shaders/k3d_mondometal.sl:178:                            "twidth", abBumpMapBlur );

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: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:186:	    normal deltaN = normalize(N) - normalize(Ng);

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

k3d/share/shaders/k3d_mondometal.sl:191:            P = PP; /* usually it's better to do displacments in displacement shader */

k3d/share/shaders/k3d_mondometal.sl:198:    /* compute shading variables **/

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

k3d/share/shaders/k3d_mondometal.sl:200:    V = -normalize(I);

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

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:209:            D = vector(-zcomp(D), xcomp(D), ycomp(D));

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:219:    /* Averiguamos si la textura es metlica o no */

k3d/share/shaders/k3d_mondometal.sl:222:        Cmatte = color texture(metalMatte, ss, tt,

k3d/share/shaders/k3d_mondometal.sl:223:                            "swidth", abColorMapBlur,

k3d/share/shaders/k3d_mondometal.sl:224:                            "twidth", abColorMapBlur);

k3d/share/shaders/k3d_mondometal.sl:229:    /* now add it all together */

k3d/share/shaders/k3d_mondometal.sl:232:    /* Textura normal de Mondo*/

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:237:    /* Textura metlica */

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:5: * Original name below 

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:12: *    this texture is generally used as a backdrop, it does not take

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:19: *    skycolor, cloudcolor - the obvious meanings

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:28: *    C language version by F. Kenton Musgrave

k3d/share/shaders/k3d_mysky.sl:29: *    Translation to RenderMan Shading Language by Larry Gritz.

k3d/share/shaders/k3d_mysky.sl:32: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,

k3d/share/shaders/k3d_mysky.sl:33: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.

k3d/share/shaders/k3d_mysky.sl:34: *    Academic Press, 1994.  ISBN 0-12-228760-6.

k3d/share/shaders/k3d_mysky.sl:37: *    ??? - original C language version by Ken Musgrave

k3d/share/shaders/k3d_mysky.sl:38: *    Apr 94 - translation to Shading Language by L. Gritz

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

k3d/share/shaders/k3d_mysky.sl:46:/* Use signed Perlin noise */

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

k3d/share/shaders/k3d_mysky.sl:53:	     color skycolor = color(.15, .15, .6);

k3d/share/shaders/k3d_mysky.sl:54:	     color cloudcolor = color(1,1,1);

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

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: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:70:  for (i = 0;  i < octaves;  i += 1) {

k3d/share/shaders/k3d_mysky.sl:76:  Ct = mix (skycolor, cloudcolor, smoothstep (threshold, 1, value));

k3d/share/shaders/k3d_mysky.sl:78:  /* Shade like matte, but use color Ct */

k3d/share/shaders/k3d_noisysmoke.sl:4:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_noisysmoke.sl:11:             Psmoke = PP*freq;                                              \
k3d/share/shaders/k3d_noisysmoke.sl:16:                 for (i=1;  i<octaves;  i+=1) {                             \
k3d/share/shaders/k3d_noisysmoke.sl:21:             g = density * smoothstep(-1,1,smokevary*smoke);                \
k3d/share/shaders/k3d_noisysmoke.sl:31:		      float integstart = 0, integend = 100;
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:40:  /* PRMan and BMRT used to have I reverse of each other, conflict in spec */
k3d/share/shaders/k3d_noisysmoke.sl:41:  point Worigin = P + I;
k3d/share/shaders/k3d_noisysmoke.sl:42:  vector incident = vtransform("shader", -I);
k3d/share/shaders/k3d_noisysmoke.sl:44:  /* But with BMRT 2.3.6 and later, they're the same... */
k3d/share/shaders/k3d_noisysmoke.sl:45:  point Worigin = P - I;
k3d/share/shaders/k3d_noisysmoke.sl:46:  vector incident = vtransform("shader", I);
k3d/share/shaders/k3d_noisysmoke.sl:48:  point origin = transform("shader", Worigin);
k3d/share/shaders/k3d_noisysmoke.sl:49:  vector IN, WIN;
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:54:  float nsteps = 0;		/* record number of integration steps */
k3d/share/shaders/k3d_noisysmoke.sl:55:  color li, last_li, lighttau;
k3d/share/shaders/k3d_noisysmoke.sl:57:  color scat;
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:64:  d = integstart + random() * stepsize;
k3d/share/shaders/k3d_noisysmoke.sl:67:      IN = normalize(incident);
k3d/share/shaders/k3d_noisysmoke.sl:68:      WIN = vtransform("shader", "current", IN);
k3d/share/shaders/k3d_noisysmoke.sl:69:      PP = origin + d * IN;
k3d/share/shaders/k3d_noisysmoke.sl:70:      PW = Worigin + d * WIN;
k3d/share/shaders/k3d_noisysmoke.sl:79:	  PP = origin + d * IN;
k3d/share/shaders/k3d_noisysmoke.sl:80:	  PW = Worigin + d * WIN;
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:88:	  scat = -tau * scatter;
k3d/share/shaders/k3d_noisysmoke.sl:90:	    1 - color(exp(comp(scat, 0)), exp(comp(scat, 1)),
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:105:   * the background element.
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:108:   * which makes it through the volume.
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:4: * Note: we include dummy Ka and Kd arguments to appease the radiosity
k3d/share/shaders/k3d_null.sl:8:surface
k3d/share/shaders/k3d_oak.sl:4: * Description: makes procedural solid texture that looks very much like
k3d/share/shaders/k3d_oak.sl:5: *    wood grain.  The rings surround the z axis, so to position the
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:8: *    very much like oak.
k3d/share/shaders/k3d_oak.sl:10: * Parameters for the coordinate mapping: 
k3d/share/shaders/k3d_oak.sl:11: *   shadingspace - space in which the pattern is laid out
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:16: *   Clightwood - the light, "background" wood color
k3d/share/shaders/k3d_oak.sl:17: *   Cdarkwood - the darker color in the ring/grain
k3d/share/shaders/k3d_oak.sl:18: *   ringfreq - mean frequency of ring spacing
k3d/share/shaders/k3d_oak.sl:19: *   ringunevenness - 0=equally spaced rings, larger is unequally spaced
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:26: *   ringy, grainy - overall scale on the degree to which rings and
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:29: *       ring or grain.
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:33: *   Ka, Kd, Ks, roughness - the usual meaning
k3d/share/shaders/k3d_oak.sl:37: * Author: Larry Gritz, 1999
k3d/share/shaders/k3d_oak.sl:39: * Contacts:  lg@pixar.com
k3d/share/shaders/k3d_oak.sl:45:#include "k3d_project.h"
k3d/share/shaders/k3d_oak.sl:47:#include "k3d_material.h"
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:62:		color Clightwood = color(.5, .2, .067);	/* light wood color */
k3d/share/shaders/k3d_oak.sl:63:		color Cdarkwood = color(0.15, 0.077, 0.028);
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: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:76:  color Cwood = mix(Clightwood, Cdarkwood, wood);
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:4: * Description: makes procedural varnished wood planks.  The planks
k3d/share/shaders/k3d_oakplank.sl:5: *    are projected onto the x-y plane, with the length aligned with
k3d/share/shaders/k3d_oakplank.sl:6: *    the y axis.  The subpattern within each individual plank is just
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:10: *   shadingspace - space in which the pattern is laid out
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: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:19: *   edgewidth - how close to the plank border does the wood start to curl?
k3d/share/shaders/k3d_oakplank.sl:20: *   varyhue, varysat, varylum - control plank-to-plank color variation
k3d/share/shaders/k3d_oakplank.sl:22: * Parameters for the color and pattern of the wood grain: 
k3d/share/shaders/k3d_oakplank.sl:23: *   Clightwood - the light, "background" wood color
k3d/share/shaders/k3d_oakplank.sl:24: *   Cdarkwood - the darker color in the ring/grain
k3d/share/shaders/k3d_oakplank.sl:25: *   ringfreq - mean frequency of ring spacing
k3d/share/shaders/k3d_oakplank.sl:26: *   ringunevenness - 0=equally spaced rings, larger is unequally spaced
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:33: *   ringy, grainy - overall scale on the degree to which rings and
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:36: *       ring or grain.
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:40: *   Ka, Kd, Ks, roughness - the usual meaning
k3d/share/shaders/k3d_oakplank.sl:41: *   Kr, blur, eta - reflection parameters for the tile
k3d/share/shaders/k3d_oakplank.sl:42: *   envname, envspace, envrad - environment mapping controls
k3d/share/shaders/k3d_oakplank.sl:43: *   rayjitter, raysamples - ray tracing controls
k3d/share/shaders/k3d_oakplank.sl:44: *   varnishlump, arnishlumpfreq - amp & freq of lumpiness in the varnish
k3d/share/shaders/k3d_oakplank.sl:48: * Author: Larry Gritz, 1999
k3d/share/shaders/k3d_oakplank.sl:50: * Contacts:  lg@pixar.com
k3d/share/shaders/k3d_oakplank.sl:57: * PRMan together.
k3d/share/shaders/k3d_oakplank.sl:59:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_oakplank.sl:61:#include "k3d_project.h"
k3d/share/shaders/k3d_oakplank.sl:63:#include "k3d_material.h"
k3d/share/shaders/k3d_oakplank.sl:66:#include "k3d_patterns.h"
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:73: * (integer indexed) plank we are on and what coordinates within our
k3d/share/shaders/k3d_oakplank.sl:74: * individual plank we are shading.
k3d/share/shaders/k3d_oakplank.sl:76:float plankpattern(float ss, tt, ds, dt;
k3d/share/shaders/k3d_oakplank.sl:78:		   float groovewidth, grooveheight;
k3d/share/shaders/k3d_oakplank.sl:82:  /* Find which s plank we're on and our s coordinate within it */
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:87:  /* Find which t plank we're on and our t coordinate within it */
k3d/share/shaders/k3d_oakplank.sl:88:  twhichplank = floor(newt / planklength);
k3d/share/shaders/k3d_oakplank.sl:90:  /* Calculate our "in-plank" value by multiplying two perpendicular
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:96:						     newt + grooveheight / 2,
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:112:		     color Clightwood = color(.5, .2, .067);	/* light wood color */
k3d/share/shaders/k3d_oakplank.sl:113:		     color Cdarkwood = color(0.15, 0.077, 0.028);
k3d/share/shaders/k3d_oakplank.sl:114:		     color Cgroove = color(0.02, 0.02, 0.02);
k3d/share/shaders/k3d_oakplank.sl:115:		     float ringy = 1, grainy = 1;
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:125:  float dss = filterwidth(ss), dtt = filterwidth(tt);
k3d/share/shaders/k3d_oakplank.sl:128:   * Find out where in the pattern we are: which plank we're on, and
k3d/share/shaders/k3d_oakplank.sl:129:   * the (splank,tplank) coordinates (both on [0,1]) within our tile.
k3d/share/shaders/k3d_oakplank.sl:132:  float inplank = plankpattern(ss, tt, dss, dtt, plankwidth, planklength,
k3d/share/shaders/k3d_oakplank.sl:133:			       groovewidth, grooveheight,
k3d/share/shaders/k3d_oakplank.sl:137:    point(splank - 0.5, height - 0.01 * tplank, tplank) + vector(1, 5,
k3d/share/shaders/k3d_oakplank.sl:139:    (vector cellnoise(swhichplank, twhichplank) - 0.5);
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:145:  color Cwood = mix(Clightwood, Cdarkwood, wood);
k3d/share/shaders/k3d_oakplank.sl:147:  Cwood = varyEach(Cwood, plankindex, varyhue, varysat, varylum);
k3d/share/shaders/k3d_oakplank.sl:148:  Cwood = mix(Cgroove, Cwood, inplank);
k3d/share/shaders/k3d_oakplank.sl:151:   * the grooves between planks. 
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:165:   * Less specular in the grooves, more specular in the dark wood. 
k3d/share/shaders/k3d_oakplank.sl:169:    MaterialShinyPlastic(Nf, Cwood, Ka, Kd, specadjusted * Ks, roughness,
k3d/share/shaders/k3d_oakplank.sl:170:			 specadjusted * Kr, blur, eta, 1, ENVPARAMS);
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:6: * TLOrange.sl -- create an orange
k3d/share/shaders/k3d_orange.sl:9: *	Creates an stippled orange surface.
k3d/share/shaders/k3d_orange.sl:12: *	Ka, Kd, Ks, roughness - the usual
k3d/share/shaders/k3d_orange.sl:16: * AUTHOR: Tal Lancaster
k3d/share/shaders/k3d_orange.sl:19: * History:
k3d/share/shaders/k3d_orange.sl:20: *	Created: 9/4/96
k3d/share/shaders/k3d_orange.sl:26:surface k3d_orange (
k3d/share/shaders/k3d_orange.sl:30:	float roughness = .2;
k3d/share/shaders/k3d_orange.sl:34:	point turb, p2;
k3d/share/shaders/k3d_orange.sl:43:	turb = noise (BUMP_FREQUENCY * p2) * BUMP_AMPLITUDE;
k3d/share/shaders/k3d_orange.sl:44:	newP = calculatenormal (P + turb * normalize (N));
k3d/share/shaders/k3d_orange.sl:45:	Nf = faceforward (normalize (newP), I);
k3d/share/shaders/k3d_orange.sl:46:	V = -normalize (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:1:/* renamed LG_orennayar.sl -- tal@SpamSucks_cs.caltech.edu */
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:9: *   Lambert.  Based on Oren & Nayar's model (see Proc. SIGGRAPH 94).
k3d/share/shaders/k3d_orennayar.sl:11: *   Lambertian (isotropic) BRDF is a simple approximation, but not
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:17: *   sigma - roughness (0 is lambertian, larger values are rougher)
k3d/share/shaders/k3d_orennayar.sl:19: * AUTHOR:  Larry Gritz
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:27: *   1. Note that this is really just an illuminance loop that gathers
k3d/share/shaders/k3d_orennayar.sl:28: *      light from the sources and applies Oren & Nayar's local reflectance
k3d/share/shaders/k3d_orennayar.sl:29: *      model to the result.  It could easily be packaged up as a macro
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:35: *   14 June 1994 -- written by Larry Gritz
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:46:    color lightC = 0;
k3d/share/shaders/k3d_orennayar.sl:47:    color L1, L2;
k3d/share/shaders/k3d_orennayar.sl:49:    float theta_r, theta_i, cos_theta_i;
k3d/share/shaders/k3d_orennayar.sl:52:    Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_orennayar.sl:53:    IN = normalize (I);
k3d/share/shaders/k3d_orennayar.sl:55:    theta_r = acos (Eye . Nf);
k3d/share/shaders/k3d_orennayar.sl:59:	LN = normalize(L);
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:63:	alpha = max (theta_i, theta_r);
k3d/share/shaders/k3d_orennayar.sl:64:	beta = min (theta_i, theta_r);
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:6: *   patch to make a wall more interesting.  The patch should be
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:9: *   I should probably add some bump mapping or other variation, but
k3d/share/shaders/k3d_outlet.sl:13: *   Ka, Kd 	   	work just like the matte shader
k3d/share/shaders/k3d_outlet.sl:14: *   screwKs            Ks parameter for the screw
k3d/share/shaders/k3d_outlet.sl:17: * AUTHOR: written by Larry Gritz
k3d/share/shaders/k3d_outlet.sl:20: *      June 1992 -- first written by lg for the Kitchen image
k3d/share/shaders/k3d_outlet.sl:21: *      17 Jan 1994 -- recoded by lg in correct shading language.
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:30:	 float screwKs = 0.5; )
k3d/share/shaders/k3d_outlet.sl:32:  color Ct;
k3d/share/shaders/k3d_outlet.sl:34:  float ks, kd, roughness;
k3d/share/shaders/k3d_outlet.sl:40:  roughness = 0.25;
k3d/share/shaders/k3d_outlet.sl:48:      ks = screwKs;
k3d/share/shaders/k3d_outlet.sl:68:  Nf = faceforward (normalize(N),I);
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:2: * it's the valdez algorithm. short and sweet.
k3d/share/shaders/k3d_outline.sl:5:surface
k3d/share/shaders/k3d_outline.sl:9:  normal Nn = normalize (-N);
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:2:	string texturename = "";
k3d/share/shaders/k3d_painted_constant.sl:9:	color Ct = color(1, 1, 1);
k3d/share/shaders/k3d_painted_constant.sl:12:	if(texturename != "")
k3d/share/shaders/k3d_painted_constant.sl:17:			Ct = color texture(texturename, ss, tt);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_paintedplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_paintedplastic.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:13: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
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:22:	float roughness = 0.1;
k3d/share/shaders/k3d_paintedplastic.sl:23:	color specularcolor = 1.0;
k3d/share/shaders/k3d_paintedplastic.sl:24:	string texturename = "";
k3d/share/shaders/k3d_paintedplastic.sl:31:	color Ct = color(1, 1, 1);
k3d/share/shaders/k3d_paintedplastic.sl:34:	if(texturename != "")
k3d/share/shaders/k3d_paintedplastic.sl:39:			Ct = color texture(texturename, ss, tt);
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:44:	vector V = -normalize(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:8: *   units are both the same size in world space.
k3d/share/shaders/k3d_parquet_plank.sl:11: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
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:27: * AUTHOR: Larry Gritz, email: lg@bmrt.org
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:32:			  color specularcolor = 1;
k3d/share/shaders/k3d_parquet_plank.sl:33:			  float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_parquet_plank.sl:35:			  float plankspertile = 4;
k3d/share/shaders/k3d_parquet_plank.sl:36:			  color lightwood = color(0.57, 0.292, 0.125);
k3d/share/shaders/k3d_parquet_plank.sl:37:			  color darkwood = color(0.275, 0.15, 0.06);
k3d/share/shaders/k3d_parquet_plank.sl:38:			  color groovecolor = color(.05, .04, .015);
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: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:51:  color Ct, woodcolor;
k3d/share/shaders/k3d_parquet_plank.sl:52:  float groovy;
k3d/share/shaders/k3d_parquet_plank.sl:56:  PGWIDTH = plankwidth + groovewidth;
k3d/share/shaders/k3d_parquet_plank.sl:57:  planklength = PGWIDTH * plankspertile - groovewidth;
k3d/share/shaders/k3d_parquet_plank.sl:58:  PGHEIGHT = planklength + groovewidth;
k3d/share/shaders/k3d_parquet_plank.sl:59:  GWF = groovewidth * 0.5 / PGWIDTH;
k3d/share/shaders/k3d_parquet_plank.sl:60:  GHF = groovewidth * 0.5 / PGHEIGHT;
k3d/share/shaders/k3d_parquet_plank.sl:62:  /* Determine how wide in s-t space one pixel projects to */
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:87:  ss -= whichrow;
k3d/share/shaders/k3d_parquet_plank.sl:89:  whichplank += 20 * (whichrow + 10);
k3d/share/shaders/k3d_parquet_plank.sl:92:   * Figure out where the grooves are.  The value groovy is 0 where there
k3d/share/shaders/k3d_parquet_plank.sl:93:   * are grooves, 1 where the wood grain is visible.  Do some simple
k3d/share/shaders/k3d_parquet_plank.sl:110:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_parquet_plank.sl:114:  groovy = w * h;
k3d/share/shaders/k3d_parquet_plank.sl:118:   * Add the ring patterns
k3d/share/shaders/k3d_parquet_plank.sl:120:  fade = smoothstep(1 / ringscale, 8 / ringscale, fwidth);
k3d/share/shaders/k3d_parquet_plank.sl:124:      r = ringscale * noise(ss - whichplank, ttt);
k3d/share/shaders/k3d_parquet_plank.sl:125:      r -= floor(r);
k3d/share/shaders/k3d_parquet_plank.sl:126:      r =
k3d/share/shaders/k3d_parquet_plank.sl:127:	0.3 + 0.7 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, 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:136:	  r2 = 1.3 - noise(ss * grainscale, (tt * grainscale / 4));
k3d/share/shaders/k3d_parquet_plank.sl:137:	  r2 = grainy * r2 * r2 + (1 - grainy);
k3d/share/shaders/k3d_parquet_plank.sl:138:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_parquet_plank.sl:141:	r *= 0.75;
k3d/share/shaders/k3d_parquet_plank.sl:144:    r = 0.4875;
k3d/share/shaders/k3d_parquet_plank.sl:147:  /* Mix the light and dark wood according to the grain pattern */
k3d/share/shaders/k3d_parquet_plank.sl:148:  woodcolor = mix(lightwood, darkwood, r);
k3d/share/shaders/k3d_parquet_plank.sl:150:  /* Add plank-to-plank variation in overall color */
k3d/share/shaders/k3d_parquet_plank.sl:151:  woodcolor *=
k3d/share/shaders/k3d_parquet_plank.sl:152:    (1 - plankvary / 2 + plankvary * (float noise(whichplank + 0.5)));
k3d/share/shaders/k3d_parquet_plank.sl:154:  Ct = mix(groovecolor, woodcolor, groovy);
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:9: *   units are both the same size in world space.
k3d/share/shaders/k3d_parquet_plank2.sl:12: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
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:28: * AUTHOR: written by Larry Gritz, the George Washington University
k3d/share/shaders/k3d_parquet_plank2.sl:29: *         email: gritz@SpamSucks_seas.gwu.edu
k3d/share/shaders/k3d_parquet_plank2.sl:35: *    10 Feb 1995 - written by Larry Gritz, based on my "plank" shader.
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:46:	       color specularcolor = 1;
k3d/share/shaders/k3d_parquet_plank2.sl:47:	       float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_parquet_plank2.sl:49:	       float plankspertile = 4;
k3d/share/shaders/k3d_parquet_plank2.sl:50:	       color lightwood = color (0.57, 0.292, 0.125);
k3d/share/shaders/k3d_parquet_plank2.sl:51:	       color darkwood  = color (0.275, 0.15, 0.06);
k3d/share/shaders/k3d_parquet_plank2.sl:52:	       color groovecolor  = color (.05, .04, .015);
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:61:  float r, r2;
k3d/share/shaders/k3d_parquet_plank2.sl:63:  float whichrow, whichplank;
k3d/share/shaders/k3d_parquet_plank2.sl:65:  color Ct, woodcolor;
k3d/share/shaders/k3d_parquet_plank2.sl:66:  float groovy;
k3d/share/shaders/k3d_parquet_plank2.sl:70:  PGWIDTH = plankwidth+groovewidth;
k3d/share/shaders/k3d_parquet_plank2.sl:71:  planklength = PGWIDTH * plankspertile - groovewidth;
k3d/share/shaders/k3d_parquet_plank2.sl:72:  PGHEIGHT = planklength+groovewidth;
k3d/share/shaders/k3d_parquet_plank2.sl:73:  GWF = groovewidth*0.5/PGWIDTH;
k3d/share/shaders/k3d_parquet_plank2.sl:74:  GHF = groovewidth*0.5/PGHEIGHT;
k3d/share/shaders/k3d_parquet_plank2.sl:76:  /* Determine how wide in s-t space one pixel projects to */
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:94:  ss -= whichrow;
k3d/share/shaders/k3d_parquet_plank2.sl:96:  whichplank += 20*(whichrow+10);
k3d/share/shaders/k3d_parquet_plank2.sl:99:   * Figure out where the grooves are.  The value groovy is 0 where there
k3d/share/shaders/k3d_parquet_plank2.sl:100:   * are grooves, 1 where the wood grain is visible.  Do some simple
k3d/share/shaders/k3d_parquet_plank2.sl:111:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_parquet_plank2.sl:115:  groovy = w*h;
k3d/share/shaders/k3d_parquet_plank2.sl:119:   * Add the ring patterns
k3d/share/shaders/k3d_parquet_plank2.sl:121:  fade = smoothstep (1/ringscale, 8/ringscale, fwidth);
k3d/share/shaders/k3d_parquet_plank2.sl:124:      r = ringscale * noise (ss-whichplank, ttt);
k3d/share/shaders/k3d_parquet_plank2.sl:125:      r -= floor (r);
k3d/share/shaders/k3d_parquet_plank2.sl:126:      r = 0.3 + 0.7 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, 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:134:	  r2 = 1.3 - noise (ss*grainscale, (tt*grainscale/4));
k3d/share/shaders/k3d_parquet_plank2.sl:135:	  r2 = grainy * r2*r2 + (1-grainy);
k3d/share/shaders/k3d_parquet_plank2.sl:136:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_plank2.sl:138:      else r *= 0.75;
k3d/share/shaders/k3d_parquet_plank2.sl:140:  else r = 0.4875;
k3d/share/shaders/k3d_parquet_plank2.sl:143:  /* Mix the light and dark wood according to the grain pattern */
k3d/share/shaders/k3d_parquet_plank2.sl:144:  woodcolor = mix (lightwood, darkwood, r);
k3d/share/shaders/k3d_parquet_plank2.sl:146:  /* Add plank-to-plank variation in overall color */
k3d/share/shaders/k3d_parquet_plank2.sl:147:  woodcolor *= (1-plankvary/2 + plankvary * noise (whichplank+0.5));
k3d/share/shaders/k3d_parquet_plank2.sl:149:  Ct = mix (groovecolor, woodcolor, groovy);
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:10: *   units are both the same size in world space.
k3d/share/shaders/k3d_parquet_tile.sl:13: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
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:29: * AUTHOR: written by Larry Gritz, the George Washington University
k3d/share/shaders/k3d_parquet_tile.sl:30: *         email: gritz@SpamSucks_seas.gwu.edu
k3d/share/shaders/k3d_parquet_tile.sl:36: *    10 Feb 1995 - written by Larry Gritz, based on my "plank" shader.
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:44: *   - comments appear where changes are made
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:61:	       color specularcolor = 1;
k3d/share/shaders/k3d_parquet_tile.sl:62:	       float ringscale = 25, grainscale = 55;
k3d/share/shaders/k3d_parquet_tile.sl:64:	       float plankspertile = 1;
k3d/share/shaders/k3d_parquet_tile.sl:65:	       color lightwood = color (0.57, 0.292, 0.125);
k3d/share/shaders/k3d_parquet_tile.sl:66:	       color darkwood  = color (0.275, 0.15, 0.06);
k3d/share/shaders/k3d_parquet_tile.sl:67:	       color groovecolor  = color (.05, .04, .015);
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:76:  float r, r2;
k3d/share/shaders/k3d_parquet_tile.sl:78:  float whichrow, whichplank;
k3d/share/shaders/k3d_parquet_tile.sl:80:  color Ct, woodcolor;
k3d/share/shaders/k3d_parquet_tile.sl:81:  float groovy;
k3d/share/shaders/k3d_parquet_tile.sl:85:  PGWIDTH = plankwidth+groovewidth;
k3d/share/shaders/k3d_parquet_tile.sl:86:  planklength = PGWIDTH * plankspertile - groovewidth;
k3d/share/shaders/k3d_parquet_tile.sl:87:  PGHEIGHT = planklength+groovewidth;
k3d/share/shaders/k3d_parquet_tile.sl:88:  GWF = groovewidth*0.5/PGWIDTH;
k3d/share/shaders/k3d_parquet_tile.sl:89:  GHF = groovewidth*0.5/PGHEIGHT;
k3d/share/shaders/k3d_parquet_tile.sl:91:  /* Determine how wide in s-t space one pixel projects to */
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:109:  ss -= whichrow;
k3d/share/shaders/k3d_parquet_tile.sl:111:  whichplank += 20*(whichrow+10);
k3d/share/shaders/k3d_parquet_tile.sl:114:   * Figure out where the grooves are.  The value groovy is 0 where there
k3d/share/shaders/k3d_parquet_tile.sl:115:   * are grooves, 1 where the wood grain is visible.  Do some simple
k3d/share/shaders/k3d_parquet_tile.sl:126:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_parquet_tile.sl:130:  groovy = w*h;
k3d/share/shaders/k3d_parquet_tile.sl:134:   * Add the ring patterns
k3d/share/shaders/k3d_parquet_tile.sl:136:  fade = smoothstep (1/ringscale, 8/ringscale, fwidth);
k3d/share/shaders/k3d_parquet_tile.sl:139:      r = ringscale * noise (ss-whichplank, ttt);
k3d/share/shaders/k3d_parquet_tile.sl:140:      r -= floor (r);
k3d/share/shaders/k3d_parquet_tile.sl:141:      r = 0.3 + 0.7 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, 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:149:	  r2 = 1.3 - noise (ss*grainscale, (tt*grainscale/4));
k3d/share/shaders/k3d_parquet_tile.sl:150:	  r2 = grainy * r2*r2 + (1-grainy);
k3d/share/shaders/k3d_parquet_tile.sl:151:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_tile.sl:153:      else r *= 0.75;
k3d/share/shaders/k3d_parquet_tile.sl:155:  else r = 0.4875;
k3d/share/shaders/k3d_parquet_tile.sl:158:  /* Mix the light and dark wood according to the grain pattern */
k3d/share/shaders/k3d_parquet_tile.sl:159:  woodcolor = mix (lightwood, darkwood, r);
k3d/share/shaders/k3d_parquet_tile.sl:161:  /* Add plank-to-plank variation in overall color */
k3d/share/shaders/k3d_parquet_tile.sl:162:  woodcolor *= (1-plankvary/2 + plankvary * noise (whichplank+0.5));
k3d/share/shaders/k3d_parquet_tile.sl:164:  Ct = mix (groovecolor, woodcolor, groovy);
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:3: *                   an earth-like planetary model.
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:7: *   make it look like the clouds surrounding an Earth-like planet.
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:10: *   a way that looks like clouds on a planetary scale.
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:22: *   1. The way this shader is typically used is to have two concentric
k3d/share/shaders/k3d_planetclouds.sl:23: *      spheres represent a planet.  The inner one is colored like the
k3d/share/shaders/k3d_planetclouds.sl:24: *      surface of a planet (perhaps using the "terran" shader), and the
k3d/share/shaders/k3d_planetclouds.sl:25: *      outer one uses the "planetclouds" shader.
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:28: *      with the Blue Moon Renderer is to let the light cast shadows,
k3d/share/shaders/k3d_planetclouds.sl:29: *      then declare the cloud sphere as follows:
k3d/share/shaders/k3d_planetclouds.sl:30: *           AttributeBegin
k3d/share/shaders/k3d_planetclouds.sl:31: *             Attribute "render" "casts_shadows" "shade"
k3d/share/shaders/k3d_planetclouds.sl:32: *             Surface "planetclouds"
k3d/share/shaders/k3d_planetclouds.sl:33: *             Sphere 1 -1 1 360
k3d/share/shaders/k3d_planetclouds.sl:34: *           AttributeEnd
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:36: *      represented by a unit sphere.  The texture space and/or parameters
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:41: * AUTHOR: Ken Musgrave
k3d/share/shaders/k3d_planetclouds.sl:42: *    Conversion to Shading Language and other minor changes by Larry Gritz.
k3d/share/shaders/k3d_planetclouds.sl:45: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_planetclouds.sl:46: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_planetclouds.sl:47: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_planetclouds.sl:50: *    ???? - original texture developed by Ken Musgrave.
k3d/share/shaders/k3d_planetclouds.sl:51: *    Feb 1994 - Conversion to Shading Language by L. Gritz
k3d/share/shaders/k3d_planetclouds.sl:53: * last modified 1 March 1994 by lg
k3d/share/shaders/k3d_planetclouds.sl:58:/* Use signed Perlin noise */
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:71:  point Pdistortion;		/* "distortion" vector */
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:79:  /* Add in "distortion" vector */
k3d/share/shaders/k3d_planetclouds.sl:80:  Pdistortion = distortionscale * DNoise(PP);
k3d/share/shaders/k3d_planetclouds.sl:81:  /* Second cirrus: replace DNoise with vector fBm */
k3d/share/shaders/k3d_planetclouds.sl:82:  PP = PP + Pdistortion;
k3d/share/shaders/k3d_planetclouds.sl:88:  for(i = 0; i < octaves && o >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_planetclouds.sl:94:  result = a;
k3d/share/shaders/k3d_planetclouds.sl:96:  /* Adjust zero crossing (where the clouds disappear) */
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:100:    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:106:  Oi = result * Os;
k3d/share/shaders/k3d_planetclouds.sl:108:  /* Shade like matte, but with color scaled by cloud opacity */
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:9: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
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:25: * AUTHOR: Larry Gritz, lg@bmrt.org
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:30:		  color specularcolor = 1;
k3d/share/shaders/k3d_plank.sl:31:		  float ringscale = 15, grainscale = 60;
k3d/share/shaders/k3d_plank.sl:33:		  color lightwood = color(0.57, 0.292, 0.125);
k3d/share/shaders/k3d_plank.sl:34:		  color darkwood = color(0.275, 0.15, 0.06);
k3d/share/shaders/k3d_plank.sl:35:		  color groovecolor = color(.05, .04, .015);
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: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:48:  color Ct, woodcolor;
k3d/share/shaders/k3d_plank.sl:49:  float groovy;
k3d/share/shaders/k3d_plank.sl:52:  PGWIDTH = plankwidth + groovewidth;
k3d/share/shaders/k3d_plank.sl:53:  PGHEIGHT = planklength + groovewidth;
k3d/share/shaders/k3d_plank.sl:54:  GWF = groovewidth * 0.5 / PGWIDTH;
k3d/share/shaders/k3d_plank.sl:55:  GHF = groovewidth * 0.5 / PGHEIGHT;
k3d/share/shaders/k3d_plank.sl:57:  /* Determine how wide in s-t space one pixel projects to */
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:70:  ss -= whichrow;
k3d/share/shaders/k3d_plank.sl:71:  /* Jiggle each row */
k3d/share/shaders/k3d_plank.sl:72:  tt = (txtscale * t / PGHEIGHT) + 10 * snoise(0.5 + whichrow);
k3d/share/shaders/k3d_plank.sl:73:  whichplank = floor(tt);
k3d/share/shaders/k3d_plank.sl:75:  whichplank += 20 * whichrow;
k3d/share/shaders/k3d_plank.sl:78:   * Figure out where the grooves are.  The value groovy is 0 where there
k3d/share/shaders/k3d_plank.sl:79:   * are grooves, 1 where the wood grain is visible.  Do some simple
k3d/share/shaders/k3d_plank.sl:96:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_plank.sl:100:  groovy = w * h;
k3d/share/shaders/k3d_plank.sl:104:   * Add the ring patterns
k3d/share/shaders/k3d_plank.sl:106:  fade = smoothstep(1 / ringscale, 8 / ringscale, fwidth);
k3d/share/shaders/k3d_plank.sl:110:      r = ringscale * noise(ss - whichplank, ttt);
k3d/share/shaders/k3d_plank.sl:111:      r -= floor(r);
k3d/share/shaders/k3d_plank.sl:112:      r =
k3d/share/shaders/k3d_plank.sl:113:	0.3 + 0.7 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, 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:122:	  r2 = 1.3 - noise(ss * grainscale, (tt * grainscale));
k3d/share/shaders/k3d_plank.sl:123:	  r2 = grainy * r2 * r2 + (1 - grainy);
k3d/share/shaders/k3d_plank.sl:124:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_plank.sl:127:	r *= 0.75;
k3d/share/shaders/k3d_plank.sl:130:    r = 0.4875;
k3d/share/shaders/k3d_plank.sl:133:  /* Mix the light and dark wood according to the grain pattern */
k3d/share/shaders/k3d_plank.sl:134:  woodcolor = mix(lightwood, darkwood, r);
k3d/share/shaders/k3d_plank.sl:136:  /* Add plank-to-plank variation in overall color */
k3d/share/shaders/k3d_plank.sl:137:  woodcolor *=
k3d/share/shaders/k3d_plank.sl:138:    (1 - plankvary / 2 + plankvary * (float noise(whichplank + 0.5)));
k3d/share/shaders/k3d_plank.sl:140:  Ct = mix(groovecolor, woodcolor, groovy);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_plastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_plastic.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:11:		    color specularcolor = 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:1:/* I took wave's lead and renamed plastic to DPPlastic.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_plastic2.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_plastic2.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_plastic2.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_plastic2.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_plastic2.sl:14:surface
k3d/share/shaders/k3d_plastic2.sl:16:        float roughness = 0.1;
k3d/share/shaders/k3d_plastic2.sl:17:        color specularcolor = color (1,1,1))
k3d/share/shaders/k3d_plastic2.sl:19:    point Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plastic2.sl:20:    point V = normalize(-I);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_pointlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_pointlight.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_pointlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_pointlight.sl:10:		     color lightcolor = 1;
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:2:// Copyright (c) 1995-2004, Timothy M. Shead
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:13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
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:21:		\author Tim Shead (tshead@k-3d.com)
k3d/share/shaders/k3d_projectionmap_plastic.sl:24:surface k3d_projectionmap_plastic(
k3d/share/shaders/k3d_projectionmap_plastic.sl:28:	float roughness = 0.1;
k3d/share/shaders/k3d_projectionmap_plastic.sl:29:	color specularcolor = 1.0;
k3d/share/shaders/k3d_projectionmap_plastic.sl:30:	string texturename = "";
k3d/share/shaders/k3d_projectionmap_plastic.sl:35:	vector axis = vector(0, 0, 1);
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:42:	color Ct = color(1, 1, 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:55:			Ct = color texture(texturename, ss, tt);
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:60:	vector V = -normalize(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:10: *    this texture is generally used as a backdrop, it does not take
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:17: *    skycolor, cloudcolor - the obvious meanings
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:26: *    C language version by F. Kenton Musgrave
k3d/share/shaders/k3d_puffyclouds.sl:27: *    Translation to RenderMan Shading Language by Larry Gritz.
k3d/share/shaders/k3d_puffyclouds.sl:30: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_puffyclouds.sl:31: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_puffyclouds.sl:32: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_puffyclouds.sl:35: *    ??? - original C language version by Ken Musgrave
k3d/share/shaders/k3d_puffyclouds.sl:36: *    Apr 94 - translation to Shading Language by L. Gritz
k3d/share/shaders/k3d_puffyclouds.sl:38: * this file last updated 18 Apr 1994
k3d/share/shaders/k3d_puffyclouds.sl:43:/* Use signed Perlin noise */
k3d/share/shaders/k3d_puffyclouds.sl:47:surface
k3d/share/shaders/k3d_puffyclouds.sl:50:	     color skycolor = color(.15, .15, .6);
k3d/share/shaders/k3d_puffyclouds.sl:51:	     color cloudcolor = color(1,1,1);
k3d/share/shaders/k3d_puffyclouds.sl:53:	     float threshold = 0;
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: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:67:  for (i = 0;  i < octaves;  i += 1) {
k3d/share/shaders/k3d_puffyclouds.sl:73:  Ct = mix (skycolor, cloudcolor, smoothstep (threshold, 1, value));
k3d/share/shaders/k3d_puffyclouds.sl:75:  /* Shade like matte, but use color Ct */
k3d/share/shaders/k3d_puffyclouds.sl:77:  Ci = Ct;   /* This makes the color disregard the lighting */
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:6: * Copyright (C) Jonathan Merritt, 1999.
k3d/share/shaders/k3d_redapple.sl:7: * Feel free to use this shader to create apples anywhere and
k3d/share/shaders/k3d_redapple.sl:8: * everywhere.
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:12: * apple you care to lay it on. Apples are requred to have the "s"
k3d/share/shaders/k3d_redapple.sl:13: * texture parameter running equatorialy around them (like latitude
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:34:#include "rayserver.h"
k3d/share/shaders/k3d_redapple.sl:35:#include "raytrace.h"
k3d/share/shaders/k3d_redapple.sl:44:surface
k3d/share/shaders/k3d_redapple.sl:45:k3d_redapple (
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: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:53:	                          /*  values give redder apples.   */
k3d/share/shaders/k3d_redapple.sl:54:	                          /*  2 = almost complete red.     */
k3d/share/shaders/k3d_redapple.sl:56:	color specularcolor = 1;  /* Specular reflection color     */
k3d/share/shaders/k3d_redapple.sl:60:	 * Shader variables
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: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:72:	color red   = color(0.52,0.00,0.00);
k3d/share/shaders/k3d_redapple.sl:73:	color dred  = color(0.40,0.00,0.00);
k3d/share/shaders/k3d_redapple.sl:74:	color green = color(0.76,0.80,0.37);
k3d/share/shaders/k3d_redapple.sl:75:	color brown = color(0.70,0.78,0.34);
k3d/share/shaders/k3d_redapple.sl:76:	color black = color(0.00,0.00,0.00);
k3d/share/shaders/k3d_redapple.sl:80:	 * Standard settings
k3d/share/shaders/k3d_redapple.sl:82:	PP = transform("shader", P);
k3d/share/shaders/k3d_redapple.sl:83:	V = normalize(-I);
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:92:	 * goes to 1 or 0) are colored more and more green.
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: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:108:	                                /* t > T4 is pure green            */
k3d/share/shaders/k3d_redapple.sl:109:	base_turb = noise(BASE_SF*sin(2*PI*s) + PI + label,
k3d/share/shaders/k3d_redapple.sl:111:	base_turb = pow(base_turb, (1/redness));
k3d/share/shaders/k3d_redapple.sl:113:	small_speckle = mix(red, green, BASE_GRC+
k3d/share/shaders/k3d_redapple.sl:116:		base_turb = 0;
k3d/share/shaders/k3d_redapple.sl:118:		base_turb *= (t-T1)/(T2-T1);
k3d/share/shaders/k3d_redapple.sl:120:		base_turb *= (T4-t)/(T4-T3);
k3d/share/shaders/k3d_redapple.sl:122:		base_turb = 0;
k3d/share/shaders/k3d_redapple.sl:123:	base_color = spline(base_turb, green, green,
k3d/share/shaders/k3d_redapple.sl:129:	 * Pick the blotch color.
k3d/share/shaders/k3d_redapple.sl:131:	 * The blotch color is finally determined by mixing,
k3d/share/shaders/k3d_redapple.sl:134:	 * really simple noise routine.
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:139:	#define BLOTCH_DELTA       0.1  /* 'nother scaling kludge */
k3d/share/shaders/k3d_redapple.sl:141:	blotch_turb = noise(BLOTCH_SF*sin(2*PI*(s+.1234)) + PI + label,
k3d/share/shaders/k3d_redapple.sl:143:	blotch = pow(blotch_turb, 1.3) * BLOTCH_TCF * 
k3d/share/shaders/k3d_redapple.sl:144:	         pow(base_turb, 2);
k3d/share/shaders/k3d_redapple.sl:151:	 * Set the brown specking.
k3d/share/shaders/k3d_redapple.sl:153:	 * The apple has brown speckles on it, set by mixing
k3d/share/shaders/k3d_redapple.sl:155:	 * specks are very dot-like in nature, and this
k3d/share/shaders/k3d_redapple.sl:156:	 * dottiness technique is stolen from LG's starfield 
k3d/share/shaders/k3d_redapple.sl:157:	 * shader.
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:165:	 * Determine where the apple goes black at the poles.
k3d/share/shaders/k3d_redapple.sl:166:	 * This simulates the spots where the stalk would be
k3d/share/shaders/k3d_redapple.sl:167:	 * attached, and where the wierd bit at the very bottom
k3d/share/shaders/k3d_redapple.sl:177:	 * Combine what we have so far to set the surface
k3d/share/shaders/k3d_redapple.sl:178:	 * color.
k3d/share/shaders/k3d_redapple.sl:180:	cs = mix(base_color, dred, blotch);
k3d/share/shaders/k3d_redapple.sl:181:	cs = mix(cs, brown, speck);
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:189:	 * highlights. We'd like them perturbed by the small
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:203:	newP = calculatenormal(P + disp * normalize(N));
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: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:230:	 * Combine everything to get Ci, in the standard form.
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:2: *AUTHOR: Ken Musgrave.

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:7: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,

k3d/share/shaders/k3d_ridged_multifractal.sl:8: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.

k3d/share/shaders/k3d_ridged_multifractal.sl:9: *    Academic Press, 1998.  ISBN 0-12-228730-4.

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:19:	normal Nn = normalize(N);	

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

k3d/share/shaders/k3d_ridged_multifractal.sl:21:       		/* First octaves */

k3d/share/shaders/k3d_ridged_multifractal.sl:27:          		signal = pow( signal, sharpness );

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:30:                             original one -- signal *= signal;*/

k3d/share/shaders/k3d_ridged_multifractal.sl:31:          		result = signal;

k3d/share/shaders/k3d_ridged_multifractal.sl:35:          		exponent = pow( lacunarity, (-i*H) );

k3d/share/shaders/k3d_ridged_multifractal.sl:37:          		PP.x *= lacunarity;

k3d/share/shaders/k3d_ridged_multifractal.sl:38:          		PP.y *= lacunarity;

k3d/share/shaders/k3d_ridged_multifractal.sl:39:          		PP.z *= lacunarity;

k3d/share/shaders/k3d_ridged_multifractal.sl:41:			PP = PP * lacunarity;

k3d/share/shaders/k3d_ridged_multifractal.sl:42:          		/* weigh successive contributions by previous signal */

k3d/share/shaders/k3d_ridged_multifractal.sl:43:          		weight = signal * threshold;

k3d/share/shaders/k3d_ridged_multifractal.sl:50:          		/* invert and translate*/

k3d/share/shaders/k3d_ridged_multifractal.sl:53:          		/* sharpen the ridge*/

k3d/share/shaders/k3d_ridged_multifractal.sl:54:          		signal = pow( signal, sharpness ); /* Or signal *= signal;*/

k3d/share/shaders/k3d_ridged_multifractal.sl:56:          		/* weight the contribution*/

k3d/share/shaders/k3d_ridged_multifractal.sl:58:          		result += signal * exponent;

k3d/share/shaders/k3d_ridged_multifractal.sl:62:	P+= Nn*result*Kt;

k3d/share/shaders/k3d_ridged_multifractal.sl:63:  	N = calculatenormal(P);	

k3d/share/shaders/k3d_ripple.sl:1:/*  ripple3.sl

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:7: *    by Lawrence D. Chin, cs184-bo

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

k3d/share/shaders/k3d_ripple.sl:21:  N = calculatenormal(P);

k3d/share/shaders/k3d_roughmetal.sl:2: * roughmetal.sl
k3d/share/shaders/k3d_roughmetal.sl:4: * Description:
k3d/share/shaders/k3d_roughmetal.sl:5: *   Rough metal without coherent reflections
k3d/share/shaders/k3d_roughmetal.sl:7: * Parameters:
k3d/share/shaders/k3d_roughmetal.sl:8: *   Ka, Kd, Ks - ambient, diffuse, specular weights
k3d/share/shaders/k3d_roughmetal.sl:9: *   roughness - highlight width
k3d/share/shaders/k3d_roughmetal.sl:11: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_roughmetal.sl:12: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_roughmetal.sl:13: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_roughmetal.sl:16:#include "k3d_material.h"
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:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_round.sl:2:/* From the RenderMan Companion p.364 */
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:7: * next to another patch at a right angle, the edge will be rounded.
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:13:		 vv,	/* distance in v to the nearest "horizontal" edge */
k3d/share/shaders/k3d_round.sl:14:		 lu,	/* "real" distance to the nearest "vertical" edge */
k3d/share/shaders/k3d_round.sl:15:		 lv;	/* "real" distance to the nearest "horizontal" edge */
k3d/share/shaders/k3d_round.sl:16:	point	 center,/* point toward which the surface is displaced 	*/
k3d/share/shaders/k3d_round.sl:17:		 dpdu,	/* dPdu pointed toward patch center line 	*/
k3d/share/shaders/k3d_round.sl:18:		 dpdv;	/* dPdv pointed toward patch center line 	*/
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: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:48:	 *  edge along u and/or v.
k3d/share/shaders/k3d_round.sl:50:		center = point(0,0,0);
k3d/share/shaders/k3d_round.sl:51:		if (lu < radius)
k3d/share/shaders/k3d_round.sl:52:			center = (radius-lu) * normalize(dpdu);
k3d/share/shaders/k3d_round.sl:53:		if (lv < radius)
k3d/share/shaders/k3d_round.sl:54:			center += (radius-lv) * normalize(dpdv);
k3d/share/shaders/k3d_round.sl:55:		/* Move center perpendicular to the surface */
k3d/share/shaders/k3d_round.sl:56:		center += P - radius*normalize(N);
k3d/share/shaders/k3d_round.sl:57:		/* Make P be distance 'radius' along the line 
k3d/share/shaders/k3d_round.sl:58:                 * from 'center' to P */
k3d/share/shaders/k3d_round.sl:59:		P = center + radius*normalize( P-center );
k3d/share/shaders/k3d_round.sl:61:	N = calculatenormal(P);
k3d/share/shaders/k3d_rubber.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_rubber.sl:2:/* From the RenderMan Companion p.385 */
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:7: * adds in a little white dust to mimic the dust on a new eraser.
k3d/share/shaders/k3d_rubber.sl:9:surface
k3d/share/shaders/k3d_rubber.sl:10:k3d_rubber( 
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:17:	color	cout, white=1;
k3d/share/shaders/k3d_rubber.sl:22:	/* Compute a matte surface. */
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:6: *   the margin, binder holes and writing (as an image texture).
k3d/share/shaders/k3d_ruledpaper.sl:7: *   Works in s/t space.
k3d/share/shaders/k3d_ruledpaper.sl:10: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
k3d/share/shaders/k3d_ruledpaper.sl:11: *   linestr - how strongly do the lines show up (0.0 to 1.0)
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:15: *               thin lines on the paper.
k3d/share/shaders/k3d_ruledpaper.sl:17: * AUTHOR: written by Emil Mikulic
k3d/share/shaders/k3d_ruledpaper.sl:18: *         email: darkmoon@SpamSucks_connexus.apana.org.au
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:23: *   15 Nov 1997 - translated to Renderman SL in Linux
k3d/share/shaders/k3d_ruledpaper.sl:28: *   Don't worry about the paper anatomy settings. I moved them to
k3d/share/shaders/k3d_ruledpaper.sl:29: *   the paper(...) block so that they get calculated on initialisation
k3d/share/shaders/k3d_ruledpaper.sl:30: *   (initcode) instead of being re-calced for every sample.
k3d/share/shaders/k3d_ruledpaper.sl:32: *   I don't know how many holes there were in paper when _YOU_ were a kid
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:34: *   and got all the measurements with a ruler. This is the real thing!!
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:37: *   patch 21x29.7 units or at least with an approximate aspect ratio. 
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:44:	color specularcolor = 1;
k3d/share/shaders/k3d_ruledpaper.sl:45:	float linestr = 1;
k3d/share/shaders/k3d_ruledpaper.sl:46:	string texturename = "";
k3d/share/shaders/k3d_ruledpaper.sl:48:	/* Paper anatomy settings */
k3d/share/shaders/k3d_ruledpaper.sl:49:	// Paper width
k3d/share/shaders/k3d_ruledpaper.sl:51:	// Paper height 
k3d/share/shaders/k3d_ruledpaper.sl:53:	// Width of plastic strip
k3d/share/shaders/k3d_ruledpaper.sl:59:	// How far into the page do the lines start
k3d/share/shaders/k3d_ruledpaper.sl:61:	// Top and bottom margins for lines
k3d/share/shaders/k3d_ruledpaper.sl:62:		margt = 2 / ph,
k3d/share/shaders/k3d_ruledpaper.sl:63:		margb = 1 - (1.35 / ph),
k3d/share/shaders/k3d_ruledpaper.sl:64:	// Where does the vertical line (margin) start and end?
k3d/share/shaders/k3d_ruledpaper.sl:65:		verts = 2.75 / pw,
k3d/share/shaders/k3d_ruledpaper.sl:66:		verte = 2.85 / pw,
k3d/share/shaders/k3d_ruledpaper.sl:67:	// Settings for binder holes (circles)
k3d/share/shaders/k3d_ruledpaper.sl:68:	// Circle center along page (ss coordinate system)
k3d/share/shaders/k3d_ruledpaper.sl:69:		circms = 1.25,
k3d/share/shaders/k3d_ruledpaper.sl:70:	// Circle radius in ss/tt coord. system
k3d/share/shaders/k3d_ruledpaper.sl:71:		circr = 0.3,
k3d/share/shaders/k3d_ruledpaper.sl:72:	// Bounding box for circles
k3d/share/shaders/k3d_ruledpaper.sl:73:		boundl = (circms-circr)/pw,
k3d/share/shaders/k3d_ruledpaper.sl:74:		boundr = (circms+circr)/pw;	)
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:85:			Oi = color(0,0,0);		\
k3d/share/shaders/k3d_ruledpaper.sl:90:    color tex;
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:95:    V = normalize(-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:99:	// there's writing on the paper.
k3d/share/shaders/k3d_ruledpaper.sl:100:	if (texturename != "")
k3d/share/shaders/k3d_ruledpaper.sl:101:		tex = color texture(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:107:	// Figure out where in the lining we are and draw accordingly
k3d/share/shaders/k3d_ruledpaper.sl:108:	if ( (mod(t, lines)<=linet) || ((s>=verts) && (s<=verte)) )
k3d/share/shaders/k3d_ruledpaper.sl:109:		tex = (tex*(1-linestr)) + (color(0.2,0.8,0.8) * linestr);
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:116:		// Figure out where we are on the paper so that we can get
k3d/share/shaders/k3d_ruledpaper.sl:117:		// accurate, aspecty circles.
k3d/share/shaders/k3d_ruledpaper.sl:121:		// Find bounding boxes first to speed up calcs
k3d/share/shaders/k3d_ruledpaper.sl:122:		// I wrote this handy macro to automate it!
k3d/share/shaders/k3d_ruledpaper.sl:123:		circle(circms,2.7);
k3d/share/shaders/k3d_ruledpaper.sl:124:		circle(circms,4.05);
k3d/share/shaders/k3d_ruledpaper.sl:125:		circle(circms,10.7);
k3d/share/shaders/k3d_ruledpaper.sl:126:		circle(circms,14.75);
k3d/share/shaders/k3d_ruledpaper.sl:127:		circle(circms,18.75);
k3d/share/shaders/k3d_ruledpaper.sl:128:		circle(circms,25.45);
k3d/share/shaders/k3d_ruledpaper.sl:129:		circle(circms,26.75);
k3d/share/shaders/k3d_ruledpaper.sl:133:	if (Oi == color (0, 0, 0)) { Ci = 0; } else {
k3d/share/shaders/k3d_ruledpaper.sl:135:			// If inside plasticky reinforcement strip then
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_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:6: *   is basically thresholded turbulence (summed abs(snoise)).  Where it's
k3d/share/shaders/k3d_rustymetal.sl:7: *   rusty, shade like rust colored matte, and also make it bumpy (like
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:9: *   regular metal.  All computations are done in shader space.
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:20: *   octaves to sum based on the shader sampling rate.  This helps to keep
k3d/share/shaders/k3d_rustymetal.sl:21: *   aliasing under control.
k3d/share/shaders/k3d_rustymetal.sl:23: * AUTHOR: Larry Gritz, gritz@SpamSucks_seas.gwu.edu
k3d/share/shaders/k3d_rustymetal.sl:24: *         The George Washington University
k3d/share/shaders/k3d_rustymetal.sl:27: *   19 Jan 1995 - gritz - created
k3d/share/shaders/k3d_rustymetal.sl:34:/* Signed noise varies from -1 to 1 (like Perlin uses) */
k3d/share/shaders/k3d_rustymetal.sl:37:/* Maximum number of octaves */
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:46:	    color rustcolor = color (.437, .084, 0);
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: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:65:  alimit = sqrt (area(PP));
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:72:  Nrust = calculatenormal (P + rustbump * snoise(PP) * normalize(N));
k3d/share/shaders/k3d_rustymetal.sl:74:  /* Scale the rust appropriately, modulate it by another noise 
k3d/share/shaders/k3d_rustymetal.sl:75:   * computation, then sharpen it by squaring its value.
k3d/share/shaders/k3d_rustymetal.sl:77:  rustiness = step (1-rusty, clamp (sum,0,1));
k3d/share/shaders/k3d_rustymetal.sl:78:  rustiness *= clamp (abs(snoise(PP)), 0, .08) / 0.08;
k3d/share/shaders/k3d_rustymetal.sl:79:  rustiness *= rustiness;
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:82:   * account the perturbed normal and shading like matte.
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:89:   * original (smooth) normal and the usual metal illumination model.
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:93:      V = -normalize(I);
k3d/share/shaders/k3d_rustymetal.sl:94:      Cmetal = Cs * (metalKa*ambient() + metalKs*specular(Nf,V,metalroughness));
k3d/share/shaders/k3d_rustymetal.sl:97:  /* Now blend the metal and rust colors depending on the computed value
k3d/share/shaders/k3d_rustymetal.sl:98:   * of the rustiness.
k3d/share/shaders/k3d_rustymetal.sl:101:  Ci = Oi * mix (Cmetal, Crust, 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:9: *      When put on a sphere, sets the color to look like relatively
k3d/share/shaders/k3d_saturn.sl:10: *   Saturn-like.  The shader works by using a variety of fractal 
k3d/share/shaders/k3d_saturn.sl:11: *   turbulence techniques.
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:18: *               terrain type by latitude
k3d/share/shaders/k3d_saturn.sl:22: *   Assumes being used on a sphere.  Haven't really tried it by using other
k3d/share/shaders/k3d_saturn.sl:23: *   than the default arguments.
k3d/share/shaders/k3d_saturn.sl:25: * AUTHOR: Ken Musgrave.
k3d/share/shaders/k3d_saturn.sl:26: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_saturn.sl:33: *    This started out as L. Gritz's terran.sl shader.  But I think he may be
k3d/share/shaders/k3d_saturn.sl:34: *        the only one that would recognize that it was.
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:36: *        Did major hacking to make it a Saturn-like shader by Tal Lancaster 
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:52:  color Ct;
k3d/share/shaders/k3d_saturn.sl:53:  point Ptexture;
k3d/share/shaders/k3d_saturn.sl:55:  /* Do all shading in shader space */
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:60:   * Step 2: Assign a climite type, roughly by latitude.
k3d/share/shaders/k3d_saturn.sl:63:  /* make climate symmetric about equator */
k3d/share/shaders/k3d_saturn.sl:70:  	/* Color map for Saturn */
k3d/share/shaders/k3d_saturn.sl:72:		color (.73, .598, .266),
k3d/share/shaders/k3d_saturn.sl:73:		color (.73, .598, .266),
k3d/share/shaders/k3d_saturn.sl:74:		color (1, .63, .332),
k3d/share/shaders/k3d_saturn.sl:75:		color (.598, .531, .266),
k3d/share/shaders/k3d_saturn.sl:76:		color (.863, .664, .332),
k3d/share/shaders/k3d_saturn.sl:77:		color (.797, .598, .332),
k3d/share/shaders/k3d_saturn.sl:78:		color (.73, .598, .266),
k3d/share/shaders/k3d_saturn.sl:79:		color (.461, .461, .461),
k3d/share/shaders/k3d_saturn.sl:80:		color (.332, .199, .266),
k3d/share/shaders/k3d_saturn.sl:81:		color (.332, .199, .266),
k3d/share/shaders/k3d_saturn.sl:82:		color (.332, .199, .266));
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:5: *	When put on a disk will give a "saturn-like ringed" apearence with
k3d/share/shaders/k3d_saturnring.sl:6: * varing colors and transparency.
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:16: *  otherwise then they will neeb to be changed.
k3d/share/shaders/k3d_saturnring.sl:18: * AUTHOR: Tal Lancaster
k3d/share/shaders/k3d_saturnring.sl:21: * History:
k3d/share/shaders/k3d_saturnring.sl:22: *	Created: 5/15/95
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:35:/* prman noise has less range */
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:45:	float relpos;   /* relative position of PP on disk 
k3d/share/shaders/k3d_saturnring.sl:46:	                               (a percentage distance) */
k3d/share/shaders/k3d_saturnring.sl:47:	float oi = 0.0; /* Opacity holder */
k3d/share/shaders/k3d_saturnring.sl:48:	color cs;	    /* color 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:59:	printf ("val %f ringrad %f \n",
k3d/share/shaders/k3d_saturnring.sl:60:	 val,  ringrad);
k3d/share/shaders/k3d_saturnring.sl:63:	if (val < cutoff * ringrad) {
k3d/share/shaders/k3d_saturnring.sl:64:		/* Creating an inner disk that is transparent to place the planet */
k3d/share/shaders/k3d_saturnring.sl:68:		/* Create rings of varing transparency */
k3d/share/shaders/k3d_saturnring.sl:69:		relpos =  val / ringrad;
k3d/share/shaders/k3d_saturnring.sl:70:		oi =  (relpos + snoise (40* relpos) - floor(relpos) );
k3d/share/shaders/k3d_saturnring.sl:74:		printf ("oi = %f\n", oi);
k3d/share/shaders/k3d_saturnring.sl:77:		/* Create some gaps of completely transparent rings */
k3d/share/shaders/k3d_saturnring.sl:88:		if (relpos >  RING1) 
k3d/share/shaders/k3d_saturnring.sl:89:			cs = dgrey;
k3d/share/shaders/k3d_saturnring.sl:90:		else if (relpos >  RING2) {
k3d/share/shaders/k3d_saturnring.sl:91:			/* Want transparent section */
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:101:			cs = mutedgreen;	
k3d/share/shaders/k3d_saturnring.sl:106:			Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_scartissue.sl:1:/*  IDscartissue.sl written by Ivan DeWolf
k3d/share/shaders/k3d_scartissue.sl:2: *  an unremarkable recursive noise to make scartissue
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:7:k3d_scartissue(
k3d/share/shaders/k3d_scartissue.sl:11:		roughness		= .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:17:	color light = color (1,.3,.2);
k3d/share/shaders/k3d_scartissue.sl:18:	color dark = color (.015,.02,.02);
k3d/share/shaders/k3d_scartissue.sl:19:	color base;
k3d/share/shaders/k3d_scartissue.sl:20:	normal Nn = normalize(N);
k3d/share/shaders/k3d_scartissue.sl:21:	normal Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_scartissue.sl:22:	vector V = normalize(-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:29:	base = mix(dark,light,nz);
k3d/share/shaders/k3d_scartissue.sl:31:	N = calculatenormal(P);
k3d/share/shaders/k3d_scartissue.sl:32:	Nf = faceforward(normalize(N), I );
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:2: * (c) Pixar (appears in _RenderMan Companion_)
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:8: *   to change the material appearance.
k3d/share/shaders/k3d_screen.sl:11: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader
k3d/share/shaders/k3d_screen.sl:12: *   frequency - how many cycles of screen in st space
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:19: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:25:		   color specularcolor = 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: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:7: *   to change the material appearance.  This texture antialiases pretty
k3d/share/shaders/k3d_screen_aa.sl:8: *   well, even with only one sample per pixel.
k3d/share/shaders/k3d_screen_aa.sl:11: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader
k3d/share/shaders/k3d_screen_aa.sl:12: *   frequency - how many cycles of screen in st space
k3d/share/shaders/k3d_screen_aa.sl:15: * AUTHOR: written by Larry Gritz
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:21: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_screen_aa.sl:22: * RenderMan (R) is a registered trademark of Pixar.
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:31:		      color specularcolor = 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:35:  vector IN;			/* normalized incident vector */
k3d/share/shaders/k3d_screen_aa.sl:37:  float ss, tt;			/* s,t, parameters in phase */
k3d/share/shaders/k3d_screen_aa.sl:40:  /* Compute a forward facing normal */
k3d/share/shaders/k3d_screen_aa.sl:41:  IN = normalize(I);
k3d/share/shaders/k3d_screen_aa.sl:42:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_screen_aa.sl:44:  /* Determine how wide in s-t space one pixel projects to */
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:48:  /* Figure out where in the pattern we are */
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:52:  /* Figure out where the strips are. Do some simple antialiasing. */
k3d/share/shaders/k3d_screen_aa.sl:68:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_screen_aa.sl:79:	      specularcolor * Ks * specular(Nf, -IN, roughness));
k3d/share/shaders/k3d_sdixon.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_sdixon.sl:2:/* From the RenderMan Companion p.384 */
k3d/share/shaders/k3d_sdixon.sl:3:/* Listing 16.37  Pencil-labeling surface shader*/
k3d/share/shaders/k3d_sdixon.sl:8:surface
k3d/share/shaders/k3d_sdixon.sl:13:	 	roughness 	= .25;
k3d/share/shaders/k3d_sdixon.sl:14:	color	green 		= color(0, .2, 0), 
k3d/share/shaders/k3d_sdixon.sl:15:		yellow 		= color(.56, .23, 0);
k3d/share/shaders/k3d_sdixon.sl:16:	string	texturename	= "")
k3d/share/shaders/k3d_sdixon.sl:18:	point Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_sdixon.sl:19:	point V = normalize(-I);
k3d/share/shaders/k3d_sdixon.sl:21:	color cout;
k3d/share/shaders/k3d_sdixon.sl:23:	/* This shader uses a single-channel texture map to apply a 
k3d/share/shaders/k3d_sdixon.sl:24:	 *   metallic-green ink to a matte-yellow background. */
k3d/share/shaders/k3d_sdixon.sl:26:	/* Get the amount of ink from texture file. */
k3d/share/shaders/k3d_sdixon.sl:27:	ink = texture(texturename, s, t);
k3d/share/shaders/k3d_sdixon.sl:29: 	/* Use ink to mix yellow and green */
k3d/share/shaders/k3d_sdixon.sl:30:	cout = mix(yellow, green, ink); 					 
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: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:4:k3d_shadowdistant_rim( 
k3d/share/shaders/k3d_shadowdistant_rim.sl:6:    color  lightcolor=1 ; 
k3d/share/shaders/k3d_shadowdistant_rim.sl:7:    point from = point "shader" (0,0,0) ;
k3d/share/shaders/k3d_shadowdistant_rim.sl:8:    point to   = point "shader" (0,0,1) ;
k3d/share/shaders/k3d_shadowdistant_rim.sl:9:    string shadowname="";
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:17:    solar( to - from, 0.0 ) {
k3d/share/shaders/k3d_shadowdistant_rim.sl:18:        Cl = intensity * lightcolor;
k3d/share/shaders/k3d_shadowspot.sl:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_shadowspot.sl:2:/* From the RenderMan Companion p.380 */
k3d/share/shaders/k3d_shadowspot.sl:10:	color lightcolor = 1;
k3d/share/shaders/k3d_shadowspot.sl:11:	point from = point "shader" (0, 0, 0);
k3d/share/shaders/k3d_shadowspot.sl:12:	point to = point "shader" (0, 0, 1);
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:18:	float blur = 0.01;
k3d/share/shaders/k3d_shadowspot.sl:21:	point A = (to - from) / length(to - from); /* direction */
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:28:		cosangle = L.A / length(L);	/* A is already normalized */
k3d/share/shaders/k3d_shadowspot.sl:29:		attenuation = pow(cosangle, beamdistribution) / (L.L);
k3d/share/shaders/k3d_shadowspot.sl:32:		    attenuation *= (1.0 - shadow( shadowfile, Ps, "samples", samples, "blur", blur, "bias", bias ));
k3d/share/shaders/k3d_shadowspot.sl:33:		Cl = attenuation * intensity * lightcolor;
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:12: *	innerRadius - inner ring
k3d/share/shaders/k3d_shifteddrtile.sl:13: *	outerRadius - outer ring
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:20: *	The center varible should really be placed in the parameter list 
k3d/share/shaders/k3d_shifteddrtile.sl:21: *      (remember to set the right space)
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:27: * AUTHOR: Tal Lancaster
k3d/share/shaders/k3d_shifteddrtile.sl:30: * History:
k3d/share/shaders/k3d_shifteddrtile.sl:31: *	Created: 8/12/95
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: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: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: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:72:	center = (0.5, 0.5, 0);  /* This should really be */
k3d/share/shaders/k3d_shifteddrtile.sl:73:	                         /* put in the paramter list */
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:87:	d = distance (center, (ss, tt, 0));
k3d/share/shaders/k3d_shifteddrtile.sl:90:		/* Do ring */
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:19: *	Really should move center to the paramter list so both centers 
k3d/share/shaders/k3d_shiftedmoontile.sl:20: *	 can be controled.
k3d/share/shaders/k3d_shiftedmoontile.sl:22: * AUTHOR: Tal Lancaster
k3d/share/shaders/k3d_shiftedmoontile.sl:25: * History:
k3d/share/shaders/k3d_shiftedmoontile.sl:26: *	Created: 8/12/95
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:41:#define difference(a, b) ((a) - (a) * b)
k3d/share/shaders/k3d_shiftedmoontile.sl:43:surface
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: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:68:	center = (0.5, 0.5, 0);  /* This should really be moved */
k3d/share/shaders/k3d_shiftedmoontile.sl:69:	                         /*  to the paramter list */
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:79:	d = distance (center, (ss, tt, 0));
k3d/share/shaders/k3d_shiftedmoontile.sl:80:	d2 = distance (eclipseCenter, (ss, tt, 0));
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:4: * Parameters:
k3d/share/shaders/k3d_shiny.sl:5: *    Ka, Kd, Ks, roughness - The usual meaning
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:12: *        spawn rays.  This can be an important optimization, especially
k3d/share/shaders/k3d_shiny.sl:13: *        when using the "ray server."
k3d/share/shaders/k3d_shiny.sl:17: * Author: Larry Gritz (gritzl@acm.org).
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:28:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_shiny.sl:29:#include "k3d_material.h"
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: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:3: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_shinymetal.sl:5: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_shinymetal.sl:6: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:12:		       string texturename = "";)
k3d/share/shaders/k3d_shinymetal.sl:14:  normal Nf;
k3d/share/shaders/k3d_shinymetal.sl:15:  vector V, D;
k3d/share/shaders/k3d_shinymetal.sl:16:  color env;
k3d/share/shaders/k3d_shinymetal.sl:18:  V = normalize(I);
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:24:    env = Kr * color environment(texturename, D);
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:4: * Parameters:
k3d/share/shaders/k3d_shinyplastic.sl:5: *    Ka, Kd, Ks, roughness - The usual meaning
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:13: *        spawn rays.  This can be an important optimization, especially
k3d/share/shaders/k3d_shinyplastic.sl:14: *        when using the "ray server."
k3d/share/shaders/k3d_shinyplastic.sl:18: * Author: Larry Gritz (lg@bmrt.org)
k3d/share/shaders/k3d_shinyplastic.sl:24:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_shinyplastic.sl:25:#include "k3d_material.h"
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: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:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_show_st.sl:2:/* From the RenderMan Companion p.344 */
k3d/share/shaders/k3d_show_st.sl:3:/* Listing 16.11  Shader mapping texture-space coordinates to colors */
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_show_st.sl:11:	Ci = color(s, t, 0);
k3d/share/shaders/k3d_skin1.sl:4: * Copyright (C) 2002, Rudy Cortes   rcortes@hntb.com
k3d/share/shaders/k3d_skin1.sl:5: * created  09/16/2002
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:8: * without express or implied warranty. 
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:14: * everywhere, Just list me on the credits under "Shading Team"
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:19: * color value.
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:21: * original sheencolor color value.
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:24: * blemishmap = Use a grayscale map to control where the belmishes will be more visible
k3d/share/shaders/k3d_skin1.sl:25: * xdir, angle = control the direction of the specular highlights.
k3d/share/shaders/k3d_skin1.sl:26: * Oily,oilmap = controls how oily the skin looks. Use a grayscale map to contol
k3d/share/shaders/k3d_skin1.sl:27: * oiliness.---Note--- teh oiliy parameter is multiplied with the map.
k3d/share/shaders/k3d_skin1.sl:28: * xroughness,yroughness = how rough is the specular highlight on x and Y?
k3d/share/shaders/k3d_skin1.sl:29: * poresfreq, poresthresh poresdepth = control the frequency, threshold and depth of the
k3d/share/shaders/k3d_skin1.sl:30: * pores.
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:40: * Modification history:
k3d/share/shaders/k3d_skin1.sl:41: *   9/22/02 Tal Lancaster
k3d/share/shaders/k3d_skin1.sl:42: *     Renamed RudyCSkin for RMR.
k3d/share/shaders/k3d_skin1.sl:54: * Greg Ward Larson's anisotropic specular local illumination model.
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:60:color
k3d/share/shaders/k3d_skin1.sl:61:LocIllumWardAnisotropic (normal N;  vector V;
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:67:    vector X = xdir / xroughness;
k3d/share/shaders/k3d_skin1.sl:68:    vector Y = (N ^ xdir) / yroughness;
k3d/share/shaders/k3d_skin1.sl:70:    color C = 0;
k3d/share/shaders/k3d_skin1.sl:71:    extern point P;
k3d/share/shaders/k3d_skin1.sl:73:  /* Must declare extern L & Cl because we're in a function */
k3d/share/shaders/k3d_skin1.sl:74:  extern vector L;  extern color Cl; 
k3d/share/shaders/k3d_skin1.sl:76:  lightsource ("__nonspecular", nonspec);
k3d/share/shaders/k3d_skin1.sl:78:      vector LN = normalize (L);
k3d/share/shaders/k3d_skin1.sl:81:    vector H = normalize (V + LN);
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:83:        / sqrt (cos_theta_i * cos_theta_r);
k3d/share/shaders/k3d_skin1.sl:84:    C += Cl * ((1-nonspec) * cos_theta_i * rho);
k3d/share/shaders/k3d_skin1.sl:88:    return C / (4 * xroughness * yroughness);
k3d/share/shaders/k3d_skin1.sl:92:/* ------ ADAPTED FROM Mat Pahr's Skin.sl------
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:101:   an asymmetry value g.  v1 and v2 should be normalized and g should 
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:107:  return (1. - g*g) / pow(1. + g*g - 2.*g*costheta, 1.5);
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:115:   equation to approximate overall 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:121:    return albedo * phase(wo, wi, g) / (win + won) *
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:126:    vector R, T;
k3d/share/shaders/k3d_skin1.sl:127:    fresnel(II, NN, eta, Kr, Kt, R, T);
k3d/share/shaders/k3d_skin1.sl:128:    Kr = smoothstep(0., .5, Kr);
k3d/share/shaders/k3d_skin1.sl:129:    Kt = 1. - Kr;
k3d/share/shaders/k3d_skin1.sl:130:    return normalize(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:139:  extern point P;
k3d/share/shaders/k3d_skin1.sl:140:  float Kr, Kt, Kr2, Kt2;
k3d/share/shaders/k3d_skin1.sl:141:  color C = 0;
k3d/share/shaders/k3d_skin1.sl:143:  vector T = efresnel(-Vf, Nn, eta, Kr, Kt);
k3d/share/shaders/k3d_skin1.sl:146:      vector Ln = normalize(L);
k3d/share/shaders/k3d_skin1.sl:148:      vector H = normalize(Ln + Vf);
k3d/share/shaders/k3d_skin1.sl:150:    C += Kr * sheenColor * Cl * (Ln . Nn) * pow(H . Nn, 4.);
k3d/share/shaders/k3d_skin1.sl:151:      C += Kr * sheenColor * Cl * (Ln . Nn) * .2;
k3d/share/shaders/k3d_skin1.sl:153:      vector T2 = efresnel(-Ln, Nn, eta, Kr2, Kt2);
k3d/share/shaders/k3d_skin1.sl:154:      C += skinColor * Cl * (Ln . Nn) * Kt * Kt2 * 
k3d/share/shaders/k3d_skin1.sl:155:    (singleScatter(T, T2, Nn, .8, .8, thickness) +
k3d/share/shaders/k3d_skin1.sl:156:     singleScatter(T, T2, Nn, .3, .5, thickness) +
k3d/share/shaders/k3d_skin1.sl:157:     singleScatter(T, T2, Nn, 0., .4, thickness));
k3d/share/shaders/k3d_skin1.sl:159:  return C;
k3d/share/shaders/k3d_skin1.sl:160:}    /* subsurfaceSkin --ends */
k3d/share/shaders/k3d_skin1.sl:167: *shader beggins here.
k3d/share/shaders/k3d_skin1.sl:170:surface k3d_skin1(
k3d/share/shaders/k3d_skin1.sl:172:  color skincolor = color (0.7, 0.56, 0.52);
k3d/share/shaders/k3d_skin1.sl:173:  string skinmap = "";
k3d/share/shaders/k3d_skin1.sl:174:  color sheenColor = 1.;
k3d/share/shaders/k3d_skin1.sl:175:  string sheenmap = "";
k3d/share/shaders/k3d_skin1.sl:176:  float blemishfreq  = 12,
k3d/share/shaders/k3d_skin1.sl:177:        belmishthresh = 4,
k3d/share/shaders/k3d_skin1.sl:179:  string blemishmap = "";
k3d/share/shaders/k3d_skin1.sl:182:  varying vector xdir = dPdu;
k3d/share/shaders/k3d_skin1.sl:185:  string oilmap = "";
k3d/share/shaders/k3d_skin1.sl:186:  float xroughness = .3,
k3d/share/shaders/k3d_skin1.sl:187:        yroughness = .5;
k3d/share/shaders/k3d_skin1.sl:188:  float poresfreq = 60,
k3d/share/shaders/k3d_skin1.sl:189:        poresthresh = 3,
k3d/share/shaders/k3d_skin1.sl:190:        poresdepth = -0.001;)
k3d/share/shaders/k3d_skin1.sl:194:  /* initialize local variables*/
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:198:  color sc , lc;
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:204:  color Cskin = skincolor;
k3d/share/shaders/k3d_skin1.sl:205:  color Csheen = sheenColor;
k3d/share/shaders/k3d_skin1.sl:209:  /*--- layer 1 - add pores to the skin*/
k3d/share/shaders/k3d_skin1.sl:211:  PP = transform ("shader",P) * poresfreq;
k3d/share/shaders/k3d_skin1.sl:212:  turb = 0;
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:216:  turb = pow(turb,poresthresh) * poresdepth;
k3d/share/shaders/k3d_skin1.sl:219:  /* displace normals*/
k3d/share/shaders/k3d_skin1.sl:220:  NN = calculatenormal(P + turb * normalize(N));
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:228:      Cskin = color texture(skinmap);
k3d/share/shaders/k3d_skin1.sl:231:      Csheen = color texture(sheenmap);
k3d/share/shaders/k3d_skin1.sl:235:  /* layer 2 - create small skin blemishes over the skin. Use a map to control
k3d/share/shaders/k3d_skin1.sl:236:   * where the blemishes are visible */
k3d/share/shaders/k3d_skin1.sl:238:  PP = transform ("shader",P) * blemishfreq;
k3d/share/shaders/k3d_skin1.sl:239:  turb = 0;
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:243:  turb = pow(turb, belmishthresh );
k3d/share/shaders/k3d_skin1.sl:245:  color red01 = Cskin + 0.05,
k3d/share/shaders/k3d_skin1.sl:246:        red02 = red01 - 0.05,
k3d/share/shaders/k3d_skin1.sl:247:        darkred01 = Cskin - 0.05,
k3d/share/shaders/k3d_skin1.sl:248:        darkred02 = darkred01 - 0.05;
k3d/share/shaders/k3d_skin1.sl:251:  color blemishcol = color spline ( turb,
k3d/share/shaders/k3d_skin1.sl:252:                                    red01,
k3d/share/shaders/k3d_skin1.sl:253:                                    red02,
k3d/share/shaders/k3d_skin1.sl:254:                                    darkred01,
k3d/share/shaders/k3d_skin1.sl:255:                                    red01,
k3d/share/shaders/k3d_skin1.sl:256:                                    darkred01,
k3d/share/shaders/k3d_skin1.sl:257:                                    red02,
k3d/share/shaders/k3d_skin1.sl:258:                                    darkred01,
k3d/share/shaders/k3d_skin1.sl:259:                                    darkred02,
k3d/share/shaders/k3d_skin1.sl:260:                                    darkred01,
k3d/share/shaders/k3d_skin1.sl:261:                                    darkred02,
k3d/share/shaders/k3d_skin1.sl:262:                                    red01);
k3d/share/shaders/k3d_skin1.sl:264:  lc =  subsurfaceSkin(Vf, Nf, blemishcol, Csheen, 1/eta, thickness);
k3d/share/shaders/k3d_skin1.sl:268:      lo *= float texture (blemishmap);
k3d/share/shaders/k3d_skin1.sl:272:  /* --Layer 3-- apply an Anisotropic BRDF to simulate the oil layer that lies
k3d/share/shaders/k3d_skin1.sl:273:  * outside the skin. Oilyness is controlled by the oily, xrougness and yroughness.
k3d/share/shaders/k3d_skin1.sl:277:  vector anisoDir = xdir;
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:286:      oilVal *= float texture(oilmap);
k3d/share/shaders/k3d_skin2.sl:4: * Copyright (C) 2000-2001, Matt Pharr <mmp@SpamSucks_Exluna.com> 
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:7: * without express or implied warranty. 
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:15: * See SIGGRAPH 2001 course notes, "Advanced RenderMan 3: Render Harder,"
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:20:   an asymmetry value g.  v1 and v2 should be normalized and g should 
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:26:	return (1. - g*g) / pow(1. + g*g - 2.*g*costheta, 1.5);
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:34:   equation to approximate overall 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:40:    return albedo * phase(wo, wi, g) / (win + won) *
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:46:    vector R, T;
k3d/share/shaders/k3d_skin2.sl:47:    fresnel(II, NN, eta, Kr, Kt, R, T);
k3d/share/shaders/k3d_skin2.sl:48:    Kr = smoothstep(0., .5, Kr);
k3d/share/shaders/k3d_skin2.sl:49:    Kt = 1. - Kr;
k3d/share/shaders/k3d_skin2.sl:50:    return normalize(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:61:   skin color.
k3d/share/shaders/k3d_skin2.sl:63:color subsurfaceSkin(vector Vf; normal Nn; color skinColor, sheenColor;
k3d/share/shaders/k3d_skin2.sl:65:	extern point P;
k3d/share/shaders/k3d_skin2.sl:66:	float Kr, Kt, Kr2, Kt2;
k3d/share/shaders/k3d_skin2.sl:67:	color C = 0;
k3d/share/shaders/k3d_skin2.sl:69:	vector T = efresnel(-Vf, Nn, eta, Kr, Kt);
k3d/share/shaders/k3d_skin2.sl:72:	    vector Ln = normalize(L);
k3d/share/shaders/k3d_skin2.sl:74:	    vector H = normalize(Ln + Vf);
k3d/share/shaders/k3d_skin2.sl:76:		C += Kr * sheenColor * Cl * (Ln . Nn) * pow(H . Nn, 4.);
k3d/share/shaders/k3d_skin2.sl:77:	    C += Kr * sheenColor * Cl * (Ln . Nn) * .2;
k3d/share/shaders/k3d_skin2.sl:79:	    vector T2 = efresnel(-Ln, Nn, eta, Kr2, Kt2);
k3d/share/shaders/k3d_skin2.sl:80:	    C += skinColor * Cl * (Ln . Nn) * Kt * Kt2 * 
k3d/share/shaders/k3d_skin2.sl:81:		(singleScatter(T, T2, Nn, .8, .8, thickness) +
k3d/share/shaders/k3d_skin2.sl:82:		 singleScatter(T, T2, Nn, .3, .5, thickness) +
k3d/share/shaders/k3d_skin2.sl:83:		 singleScatter(T, T2, Nn, 0., .4, thickness));
k3d/share/shaders/k3d_skin2.sl:85:	return C;
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: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:1:/* skymetal shader 
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:5: * NOTE: This shader was created at a time when the shading lanuage
k3d/share/shaders/k3d_skymetal.sl:6: *   didn't support vector the vector type.  
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:9: * TLSkymetal shader.  Actually, I never could get this oneto work right,
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:18:    point up = normalize (point "world" (0, 1, 0) - point "world"  (0, 0, 0)); 
k3d/share/shaders/k3d_skymetal.sl:19:             /* actually should be vector and vtransform if using 3.5 or 
k3d/share/shaders/k3d_skymetal.sl:20:			    greater */
k3d/share/shaders/k3d_skymetal.sl:25:	color refl;
k3d/share/shaders/k3d_skymetal.sl:28:	color sky_zenith = color (0.125, 0.162, 0.5);
k3d/share/shaders/k3d_skymetal.sl:29:	color sky_horiz = color (.4, .45, .8);
k3d/share/shaders/k3d_skymetal.sl:30:	color land_horiz = color (.0281, 0.0287, 0.0220);
k3d/share/shaders/k3d_skymetal.sl:31:	color land_zenith = color (0, 0, 0);
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: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:9:	introduces a random color variation so that one tile will be lighter or
k3d/share/shaders/k3d_slateroof.sl:10:	darker than the next Parameters:
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:23: 		average
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:25: 		the smaller the detail on the tile pattern
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:34: 	Peter Quint 17/11/2000
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:40:	calculations in this shader. Renderdc, however, does not yet support
k3d/share/shaders/k3d_slateroof.sl:41:	message passing, so to produce the test image the code has been
k3d/share/shaders/k3d_slateroof.sl:42:	duplicated here 
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:53:							ramp = .1,
k3d/share/shaders/k3d_slateroof.sl:55:							maxcolorvary = .2,
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: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:76:   uniform 	float colorfactor = 3.276 * factor;	/* Used in noise calculations */	
k3d/share/shaders/k3d_slateroof.sl:77:   color 	Ct = 0;								/* A temporary color variable */
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:79:				newcolorvary, ocolorvary, ns;
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:86:   ttile = tcoord / twidth;
k3d/share/shaders/k3d_slateroof.sl:88:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroof.sl:89:   stile = scoord / swidth;
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:95:	/* Work out the displacement assuming the point is in the 
k3d/share/shaders/k3d_slateroof.sl:96:   current tile */
k3d/share/shaders/k3d_slateroof.sl:100:	 * normally the center, except in the short tiles which lie at the
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: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:113:	colorvary = ocolorvary;
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: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:137:			/* the point might be in another tile */
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:140:			 * the row below */
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:144:			newstile = newscoord / swidth;
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:156:				/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:158:					/* set parameters to overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:164:					colorvary = newcolorvary; 
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:181:		colorvary = ocolorvary;
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:185:	Ct = color spline( 	ns, 
k3d/share/shaders/k3d_slateroof.sl:186:			color( .41, .44, .60),
k3d/share/shaders/k3d_slateroof.sl:187:			color( .65, .70, .82),
k3d/share/shaders/k3d_slateroof.sl:188:			color( .39, .31, .35),
k3d/share/shaders/k3d_slateroof.sl:189:			color( .50, .41, .53),
k3d/share/shaders/k3d_slateroof.sl:190:			color( .47, .47, .63));
k3d/share/shaders/k3d_slateroof.sl:191:	Ct = Ct * (1 + colorvary);
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:7:    	Parameters:
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:22: 		Description
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:27:		the t direction so that it overlaps the tile 'below' it. No randomness
k3d/share/shaders/k3d_slateroofd.sl:28:		is incorporated in the s direction, which remains regular. The routine
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:38:		Peter Quint 17/11/2000
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:48:							ramp = .1,
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: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: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:77:   ttile = tcoord / twidth;
k3d/share/shaders/k3d_slateroofd.sl:79:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroofd.sl:80:   stile = scoord / swidth;
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:86:	/* Work out the displacement assuming the point is in the 
k3d/share/shaders/k3d_slateroofd.sl:87:   	current tile */
k3d/share/shaders/k3d_slateroofd.sl:89:	if (ttile < tfreq - 1)
k3d/share/shaders/k3d_slateroofd.sl:92:   		normally the center, except in the short tiles which lie at the
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: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:103: 		/* the very bottom row cannot expand */
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: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:129:			/* the point might be in another tile */
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:132:		 			the row below */
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:136:			newstile = newscoord / swidth;
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:147:			/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroofd.sl:149:					/* set parameters to overlapping tile */
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:172:			/* taking the maximum of dispo, disp ensures that there
k3d/share/shaders/k3d_slateroofd.sl:173:   			are no discontinuities */
k3d/share/shaders/k3d_slateroofd.sl:177:	/*printf("disp = %f\n",disp);*/
k3d/share/shaders/k3d_slateroofd.sl:178:   N = calculatenormal(P);
k3d/share/shaders/k3d_slideprojector.sl:1:light k3d_slideprojector(float intensity = 2000;
k3d/share/shaders/k3d_slideprojector.sl:2:			 color lightcolor = 1;
k3d/share/shaders/k3d_slideprojector.sl:3:			 point from = point(0, 0, 0);
k3d/share/shaders/k3d_slideprojector.sl:6:			 float conedeltaangle = 5; float beamdistribution = 2;
k3d/share/shaders/k3d_slideprojector.sl:7:			 string slidename = "")
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:12:  X = normalize(Y ^ 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:21:  color Ct;
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:30:    sloc = spread * Pu / Pt;
k3d/share/shaders/k3d_slideprojector.sl:31:    tloc = spread * Pv / Pt;
k3d/share/shaders/k3d_slideprojector.sl:36:    attenuation = pow(cosangle, beamdistribution) / (L.L);
k3d/share/shaders/k3d_slideprojector.sl:38:      smoothstep(cos(rconeangle), cos(rconeangle - rconedeltaangle),
k3d/share/shaders/k3d_slideprojector.sl:47:	Ct = color texture(slidename, sloc, tloc);
k3d/share/shaders/k3d_slideprojector.sl:50:    Cl = attenuation * intensity * lightcolor * Ct;
k3d/share/shaders/k3d_smoke.sl:4: * Description:
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:8: * Parameters:
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:12: *          toward the viewer.
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:19: *   scatter - when non-1, can be used to give wavelength-dependent
k3d/share/shaders/k3d_smoke.sl:22: * Author: Larry Gritz
k3d/share/shaders/k3d_smoke.sl:30:/* For point P (we are passed both the current and shader space
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:35:void smokedensity(point Pcur, Pshad;
k3d/share/shaders/k3d_smoke.sl:36:		  uniform float smokevary, smokefreq, smokeoctaves;
k3d/share/shaders/k3d_smoke.sl:38:		  output color Lscatter; output float smoke)
k3d/share/shaders/k3d_smoke.sl:40:  Lscatter = 0;
k3d/share/shaders/k3d_smoke.sl:41:  illuminance(Pcur)
k3d/share/shaders/k3d_smoke.sl:43:    extern color Cl;
k3d/share/shaders/k3d_smoke.sl:45:    lightsource("__foglight", foglight);
k3d/share/shaders/k3d_smoke.sl:47:      Lscatter += Cl;
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:52:#pragma nolint
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:58:      smoke = smoothstep(-1, 1, smokevary * smoke);
k3d/share/shaders/k3d_smoke.sl:68:/* Return a component-by-component exp() of a color */
k3d/share/shaders/k3d_smoke.sl:69:color
k3d/share/shaders/k3d_smoke.sl:70:colorexp(color C)
k3d/share/shaders/k3d_smoke.sl:72:  return color(exp(comp(C, 0)), exp(comp(C, 1)), exp(comp(C, 2)));
k3d/share/shaders/k3d_smoke.sl:78:		 float integstart = 0, integend = 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:86:  color li, last_li;
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:93:  /* Calculate a reasonable step size */
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:105:      /* Take a step and get the local scattered light and smoke density */
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:115:      color lighttau =
k3d/share/shaders/k3d_smoke.sl:118:      /* Composite with exponential extinction of background light */
k3d/share/shaders/k3d_smoke.sl:120:      Ov += (1 - Ov) * (1 - colorexp(-tau * scatter));
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_smoke.sl:128:   * which makes it through the volume.  So just composite!
k3d/share/shaders/k3d_smoke2.sl:2: * TLSmoke.sl -- This is really Larry's noisysmoke.sl.  I only took out the
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:5: * Description:
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:9: * Parameters:
k3d/share/shaders/k3d_smoke2.sl:10: *   density - overall smoke density control
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:21: * Author: Larry Gritz
k3d/share/shaders/k3d_smoke2.sl:23: * History:
k3d/share/shaders/k3d_smoke2.sl:24: *   9/4/96 tal -- took out random call and renamed to TLSmoke
k3d/share/shaders/k3d_smoke2.sl:30: * * Moved scripts & shaders to the share directory
k3d/share/shaders/k3d_smoke2.sl:32: * Revision 1.1  2003/02/11 14:32:43  blackburst
k3d/share/shaders/k3d_smoke2.sl:36: * Eliminated duplicate local variable declarations
k3d/share/shaders/k3d_smoke2.sl:42: * Initial RCS revision
k3d/share/shaders/k3d_smoke2.sl:50:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_smoke2.sl:57:             Psmoke = PP*freq;                                              \
k3d/share/shaders/k3d_smoke2.sl:62:                 for (i=1;  i<octaves;  i+=1) {                             \
k3d/share/shaders/k3d_smoke2.sl:67:             g = density * smoothstep(-1,1,smokevary*smoke);                \
k3d/share/shaders/k3d_smoke2.sl:78:	    float integstart = 0, integend = 100;
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:89:  point Worigin = P + I;
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:92:  point Worigin = P - I;
k3d/share/shaders/k3d_smoke2.sl:93:  point incident = vtransform ("shader", I);
k3d/share/shaders/k3d_smoke2.sl:95:  point origin = transform ("shader", Worigin);
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:101:  float nsteps = 0;          /* record number of integration steps */
k3d/share/shaders/k3d_smoke2.sl:102:  color li, last_li, lighttau;
k3d/share/shaders/k3d_smoke2.sl:104:  color scat;
k3d/share/shaders/k3d_smoke2.sl:109:  /* Integrate forwards from the start point */
k3d/share/shaders/k3d_smoke2.sl:110:  d = integstart + /*random()* */ stepsize;
k3d/share/shaders/k3d_smoke2.sl:112:      IN = normalize (incident);
k3d/share/shaders/k3d_smoke2.sl:113:      WIN = vtransform ("shader", "current", IN);
k3d/share/shaders/k3d_smoke2.sl:114:      PP = origin + d * IN;
k3d/share/shaders/k3d_smoke2.sl:115:      PW = Worigin + d * WIN;
k3d/share/shaders/k3d_smoke2.sl:124:	  PP = origin + d*IN;
k3d/share/shaders/k3d_smoke2.sl:125:	  PW = Worigin + d*WIN;
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:133:	  scat = -tau * scatter;
k3d/share/shaders/k3d_smoke2.sl:134:	  dO = 1 - color (exp(comp(scat,0)), exp(comp(scat,1)), exp(comp(scat,2)));
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:148:   * the background element.
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:151:   * which makes it through the volume.
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:10:* To do: accomodate negative widths. twosided/onesided cards.
k3d/share/shaders/k3d_softboxes.sl:16:** Derived from softbox3 v1.2 - Author Bjorke for all
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:52:/* Returns:								***/
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: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:70:	result = 1 - (1-smoothstep(a,A,x)) * (1-smoothstep(b,B,y));
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:76:	result = smoothstep (q, r, 1);
k3d/share/shaders/k3d_softboxes.sl:78:    return result;
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:91:			boxTexBlur,
k3d/share/shaders/k3d_softboxes.sl:92:			boxFilter,
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:102:    output color theColor;
k3d/share/shaders/k3d_softboxes.sl:103:    output color theOpac;
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:108:    varying color ct = 1;
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:114:    varying point Pplane = Pb1 - Vlight*(zcomp(Pb1)/zcomp(Vlight));
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: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:131:	contrib = 0;
k3d/share/shaders/k3d_softboxes.sl:133:	contrib = 0;
k3d/share/shaders/k3d_softboxes.sl:135:	contrib = 1 - clipSuperellipse (Pplane, iW, iH, oW,oH, boxRoundness);
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:144:		ct = texture(boxTexture,theS,theT,
k3d/share/shaders/k3d_softboxes.sl:145:			    "filter",	theFilterName,
k3d/share/shaders/k3d_softboxes.sl:146:			    "blur",	boxTexBlur);
k3d/share/shaders/k3d_softboxes.sl:147:		if (boxTexStr != 1) {
k3d/share/shaders/k3d_softboxes.sl:148:		    ct = (ct*boxTexStr)+(1-boxTexStr);
k3d/share/shaders/k3d_softboxes.sl:152:		uniform float alphaChan;
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:160:			    "blur",	boxTexBlur);
k3d/share/shaders/k3d_softboxes.sl:164:#pragma nolint
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:169:    theOpac = contrib * boxOpac * ot;
k3d/share/shaders/k3d_softboxes.sl:170:    theColor = contrib * ct * boxColor / pow(pDist,decayExp);	/* premultiplied!!!!! */
k3d/share/shaders/k3d_softboxes.sl:178:    uniform string	theName;
k3d/share/shaders/k3d_softboxes.sl:179:    varying point	thePoint;
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:190:			    "blur",	theBlur,
k3d/share/shaders/k3d_softboxes.sl:193:    return(inShadow);
k3d/share/shaders/k3d_softboxes.sl:201:    string	Comment = "";
k3d/share/shaders/k3d_softboxes.sl:203:    string	Tcl = "";
k3d/share/shaders/k3d_softboxes.sl:204:    string	NodeName = "";
k3d/share/shaders/k3d_softboxes.sl:205:#else /* !BMRT -- slc compiler doesn't like these definitions */
k3d/share/shaders/k3d_softboxes.sl:206:    string	Tcl = "[addL]";	
k3d/share/shaders/k3d_softboxes.sl:207:    string	NodeName = "$OBJNAME";
k3d/share/shaders/k3d_softboxes.sl:210:    color	lightcolor	= color (1,1,1);
k3d/share/shaders/k3d_softboxes.sl:212:    float	meterDistance = 1;
k3d/share/shaders/k3d_softboxes.sl:213:    string	meterSpace = "";
k3d/share/shaders/k3d_softboxes.sl:217:    string	boxCoord1	= "";
k3d/share/shaders/k3d_softboxes.sl:218:    color	boxColor1	= color (1,1,1),	/* multiplied by lightcolor&intensity */
k3d/share/shaders/k3d_softboxes.sl:219:		boxOpacity1	= color (1,1,1);
k3d/share/shaders/k3d_softboxes.sl:225:    string	boxTex1	= "";
k3d/share/shaders/k3d_softboxes.sl:226:    float	boxFilter1	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:227:		boxTexStr1	= 1,
k3d/share/shaders/k3d_softboxes.sl:228:		boxTexBlur1	= 0;
k3d/share/shaders/k3d_softboxes.sl:229:    string	boxCoord2	= "";
k3d/share/shaders/k3d_softboxes.sl:230:    color	boxColor2	= color (1,1,1),	/* multiplied by lightcolor&intensity */
k3d/share/shaders/k3d_softboxes.sl:231:		boxOpacity2	= color (1,1,1);
k3d/share/shaders/k3d_softboxes.sl:237:    string	boxTex2	= "";
k3d/share/shaders/k3d_softboxes.sl:238:    float	boxFilter2	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:239:		boxTexStr2	= 1,
k3d/share/shaders/k3d_softboxes.sl:240:		boxTexBlur2	= 0;
k3d/share/shaders/k3d_softboxes.sl:241:    string	boxCoord3	= "";
k3d/share/shaders/k3d_softboxes.sl:242:    color	boxColor3	= color (1,1,1),	/* multiplied by lightcolor&intensity */
k3d/share/shaders/k3d_softboxes.sl:243:		boxOpacity3	= color (1,1,1);
k3d/share/shaders/k3d_softboxes.sl:249:    string	boxTex3	= "";
k3d/share/shaders/k3d_softboxes.sl:250:    float	boxFilter3	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:251:		boxTexStr3	= 1,
k3d/share/shaders/k3d_softboxes.sl:252:		boxTexBlur3	= 0;
k3d/share/shaders/k3d_softboxes.sl:253:    string	boxCoord4	= "";
k3d/share/shaders/k3d_softboxes.sl:254:    color	boxColor4	= color (1,1,1),	/* multiplied by lightcolor&intensity */
k3d/share/shaders/k3d_softboxes.sl:255:		boxOpacity4	= color (1,1,1);
k3d/share/shaders/k3d_softboxes.sl:261:    string	boxTex4	= "";
k3d/share/shaders/k3d_softboxes.sl:262:    float	boxFilter4	= TEX_GAUSSIAN_FILT,
k3d/share/shaders/k3d_softboxes.sl:263:		boxTexStr4	= 1,
k3d/share/shaders/k3d_softboxes.sl:264:		boxTexBlur4	= 0;
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:273:    color shadowcolor = 0;
k3d/share/shaders/k3d_softboxes.sl:275:    string shadowname = "";
k3d/share/shaders/k3d_softboxes.sl:277:    float   shadowblur = 0.01,
k3d/share/shaders/k3d_softboxes.sl:280:    string shadownameb = "";
k3d/share/shaders/k3d_softboxes.sl:282:    float   shadowblurb = 0.01,
k3d/share/shaders/k3d_softboxes.sl:285:    string shadownamec = "";
k3d/share/shaders/k3d_softboxes.sl:287:    float   shadowblurc = 0.01,
k3d/share/shaders/k3d_softboxes.sl:290:    string shadownamed = "";
k3d/share/shaders/k3d_softboxes.sl:292:    float   shadowblurd = 0.01,
k3d/share/shaders/k3d_softboxes.sl:296:    BOOL	NonSpecular	= 0;
k3d/share/shaders/k3d_softboxes.sl:297:    BOOL	ObeyMateria	= 0;
k3d/share/shaders/k3d_softboxes.sl:298:    BOOL	UseMateriaBlur	= 0;
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:312:	theEnvSpace = "shader";
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:318:	adjMeterDistance = meterDistance;
k3d/share/shaders/k3d_softboxes.sl:320:	uniform point metP = transform(meterSpace,"shader",point (0,0,0));
k3d/share/shaders/k3d_softboxes.sl:321:	adjMeterDistance = length(metP) + meterDistance;
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:330:    __nonspecular = NonSpecular;
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:346:		    materiaBlur = 0;
k3d/share/shaders/k3d_softboxes.sl:351:    solar() {
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:355:	    varying color thisOpac;
k3d/share/shaders/k3d_softboxes.sl:356:	    varying color thisColor;
k3d/share/shaders/k3d_softboxes.sl:357:	    varying float sortedDist[4];
k3d/share/shaders/k3d_softboxes.sl:358:	    varying color sortedOpac[4];
k3d/share/shaders/k3d_softboxes.sl:359:	    varying color sortedColor[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:362:boxCoord1,boxTex1,boxTexStr1,
k3d/share/shaders/k3d_softboxes.sl:363:(boxTexBlur1+materiaBlur),boxFilter1,
k3d/share/shaders/k3d_softboxes.sl:365:		    boxRoundness1,boxColor1,boxOpacity1,decayRate,
k3d/share/shaders/k3d_softboxes.sl:366:		    thisDist,thisColor,thisOpac);
k3d/share/shaders/k3d_softboxes.sl:367:	    sortedDist[boxCt]  = thisDist;
k3d/share/shaders/k3d_softboxes.sl:368:	    sortedColor[boxCt] = thisColor;
k3d/share/shaders/k3d_softboxes.sl:369:	    sortedOpac[boxCt]  = thisOpac;
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:374:boxCoord2,boxTex2,boxTexStr2,
k3d/share/shaders/k3d_softboxes.sl:375:(boxTexBlur2+materiaBlur),boxFilter2,
k3d/share/shaders/k3d_softboxes.sl:377:		    boxRoundness2,boxColor2,boxOpacity2,decayRate,
k3d/share/shaders/k3d_softboxes.sl:378:		    thisDist,thisColor,thisOpac);
k3d/share/shaders/k3d_softboxes.sl:379:	    sortedDist[boxCt]  = thisDist;
k3d/share/shaders/k3d_softboxes.sl:380:	    sortedColor[boxCt] = thisColor;
k3d/share/shaders/k3d_softboxes.sl:381:	    sortedOpac[boxCt]  = thisOpac;
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:386:boxCoord3,boxTex3,boxTexStr3,
k3d/share/shaders/k3d_softboxes.sl:387:(boxTexBlur3+materiaBlur),boxFilter3,
k3d/share/shaders/k3d_softboxes.sl:389:		    boxRoundness3,boxColor3,boxOpacity3,decayRate,
k3d/share/shaders/k3d_softboxes.sl:390:		    thisDist,thisColor,thisOpac);
k3d/share/shaders/k3d_softboxes.sl:391:	    sortedDist[boxCt]  = thisDist;
k3d/share/shaders/k3d_softboxes.sl:392:	    sortedColor[boxCt] = thisColor;
k3d/share/shaders/k3d_softboxes.sl:393:	    sortedOpac[boxCt]  = thisOpac;
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:398:boxCoord4,boxTex4,boxTexStr4,
k3d/share/shaders/k3d_softboxes.sl:399:(boxTexBlur4+materiaBlur),boxFilter4,
k3d/share/shaders/k3d_softboxes.sl:401:		    boxRoundness4,boxColor4,boxOpacity4,decayRate,
k3d/share/shaders/k3d_softboxes.sl:402:		    thisDist,thisColor,thisOpac);
k3d/share/shaders/k3d_softboxes.sl:403:	    sortedDist[boxCt]  = thisDist;
k3d/share/shaders/k3d_softboxes.sl:404:	    sortedColor[boxCt] = thisColor;
k3d/share/shaders/k3d_softboxes.sl:405:	    sortedOpac[boxCt]  = thisOpac;
k3d/share/shaders/k3d_softboxes.sl:409:#pragma nolint
k3d/share/shaders/k3d_softboxes.sl:410:		varying vector Rs = normalize (vtransform (theEnvSpace, normalize(-L)));
k3d/share/shaders/k3d_softboxes.sl:412:#pragma nolint
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:416:		    Rs = vector( PShd + (pdotv + sqrt (abs (1 - pl + ((pdotv)*(pdotv)))))*Rs );
k3d/share/shaders/k3d_softboxes.sl:419:		    Rs = vector (-zcomp (Rs), xcomp (Rs), ycomp (Rs));
k3d/share/shaders/k3d_softboxes.sl:421:		Cl = color environment (envTexName, Rs,
k3d/share/shaders/k3d_softboxes.sl:422:					    "filter", theFilterName,
k3d/share/shaders/k3d_softboxes.sl:423:					    "blur", (envTexBlur+materiaBlur));
k3d/share/shaders/k3d_softboxes.sl:424:		if (envTexStr != 1) {
k3d/share/shaders/k3d_softboxes.sl:425:		    Cl = (Cl*envTexStr)+(1-envTexStr);
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:435:			    thisDist = sortedDist[j];
k3d/share/shaders/k3d_softboxes.sl:436:			    thisOpac = sortedOpac[j];
k3d/share/shaders/k3d_softboxes.sl:437:			    thisColor = sortedColor[j];
k3d/share/shaders/k3d_softboxes.sl:438:			    sortedDist[j] = sortedDist[i];
k3d/share/shaders/k3d_softboxes.sl:439:			    sortedOpac[j] = sortedOpac[i];
k3d/share/shaders/k3d_softboxes.sl:440:			    sortedColor[j] = sortedColor[i];
k3d/share/shaders/k3d_softboxes.sl:441:			    sortedDist[i] = thisDist;
k3d/share/shaders/k3d_softboxes.sl:442:			    sortedOpac[i] = thisOpac;
k3d/share/shaders/k3d_softboxes.sl:443:			    sortedColor[i] = thisColor;
k3d/share/shaders/k3d_softboxes.sl:448:		color ttc;
k3d/share/shaders/k3d_softboxes.sl:449:		for(k=0; k<boxCt; k+=1) {
k3d/share/shaders/k3d_softboxes.sl:451:		    Cl = sortedColor[k]+(Cl*(1-sortedOpac[k]));
k3d/share/shaders/k3d_softboxes.sl:455:	    varying vector Ln = normalize(L);
k3d/share/shaders/k3d_softboxes.sl:456:	    varying vector Nn = normalize(N);
k3d/share/shaders/k3d_softboxes.sl:457:	    varying vector In = normalize(I);
k3d/share/shaders/k3d_softboxes.sl:463:		Cl = mix(color(0,0,0),Cl,q);
k3d/share/shaders/k3d_softboxes.sl:465:	    varying float shadowed;
k3d/share/shaders/k3d_softboxes.sl:468:			shadowblur,shadowsamples,shadowbias);
k3d/share/shaders/k3d_softboxes.sl:473:			shadowblurb,shadowsamplesb,shadowbiasb);
k3d/share/shaders/k3d_softboxes.sl:478:			shadowblurc,shadowsamplesc,shadowbiasc);
k3d/share/shaders/k3d_softboxes.sl:483:			shadowblurd,shadowsamplesd,shadowbiasd);
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_spacecloud.sl:2: * TLSpaceCloud.sl - perform turbulence function to add more dimension to
k3d/share/shaders/k3d_spacecloud.sl:3: *    texture-map and try to make it not so obvious that it is a texture-map.
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:10: *   txtFile -- texture map
k3d/share/shaders/k3d_spacecloud.sl:11: *   startPulse -- start 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:19: *  Only tested on rectanglar patch.
k3d/share/shaders/k3d_spacecloud.sl:21: * AUTHOR: Tal Lancaster
k3d/share/shaders/k3d_spacecloud.sl:25: *  Created: 6/1/95
k3d/share/shaders/k3d_spacecloud.sl:27: *  tal 3/2/97  -- Cleaned up code, removed many constants, added comments
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:29: *      I was never happy with the results.  So now am just using noise over
k3d/share/shaders/k3d_spacecloud.sl:42:/* separate fuzzes */
k3d/share/shaders/k3d_spacecloud.sl:47:surface k3d_spacecloud(
k3d/share/shaders/k3d_spacecloud.sl:48:  string txtFile = "";
k3d/share/shaders/k3d_spacecloud.sl:49:  float startPulse = .2; /* .1 .2 .3 .01 */
k3d/share/shaders/k3d_spacecloud.sl:60:  color Ct;
k3d/share/shaders/k3d_spacecloud.sl:62:  float freq, i, size;
k3d/share/shaders/k3d_spacecloud.sl:68:    Ct = color texture (txtFile, s, 1-t);
k3d/share/shaders/k3d_spacecloud.sl:70:    Ct = color (.3, .3, .3);
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: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: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_spacecloud.sl:96:	Ci = Ct * Oi * 1.75  /* saturate colors */;
k3d/share/shaders/k3d_spaceshiphull1.sl:4:float fractalsum(point Q)
k3d/share/shaders/k3d_spaceshiphull1.sl:9:	for(f = 1; f < 8; f *= 2)
k3d/share/shaders/k3d_spaceshiphull1.sl:12:	return value;
k3d/share/shaders/k3d_spaceshiphull1.sl:17:surface k3d_spaceshiphull1(
k3d/share/shaders/k3d_spaceshiphull1.sl:21:	float roughness = 0.8; color specularcolor = 1;
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:28:  color platecolor;
k3d/share/shaders/k3d_spaceshiphull1.sl:32:  // Figure out which row we're in  
k3d/share/shaders/k3d_spaceshiphull1.sl:36:  tplate = floor(tt);
k3d/share/shaders/k3d_spaceshiphull1.sl:38:  ss += rowvary * noise(tplate + 0.3);
k3d/share/shaders/k3d_spaceshiphull1.sl:39:  splate = floor(ss);
k3d/share/shaders/k3d_spaceshiphull1.sl:41:  // Calculate plate color
k3d/share/shaders/k3d_spaceshiphull1.sl:42:  platecolor = Cs - (lumavary * float noise(splate + 0.4, tplate + 0.5));
k3d/share/shaders/k3d_spaceshiphull1.sl:44:  // Add grime
k3d/share/shaders/k3d_spaceshiphull1.sl:45:  platecolor -= grime * fractalsum(P);
k3d/share/shaders/k3d_spaceshiphull1.sl:47:  // Add specular contribution
k3d/share/shaders/k3d_spaceshiphull1.sl:48:  platespecular = Ks * noise(splate + 0.6, tplate + 0.7);
k3d/share/shaders/k3d_spaceshiphull1.sl:50:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_spaceshiphull1.sl:51:  V = normalize(-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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_spotlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_spotlight.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
k3d/share/shaders/k3d_spotlight.sl:6: * RenderMan (R) is a registered trademark of Pixar.
k3d/share/shaders/k3d_spotlight.sl:10:		    color lightcolor = 1;
k3d/share/shaders/k3d_spotlight.sl:11:		    point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_spotlight.sl:12:		    point to = point "shader"(0, 0, 1);
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:18:  uniform vector A = normalize(to - from);
k3d/share/shaders/k3d_spotlight.sl:20:  illuminate(from, A, coneangle)
k3d/share/shaders/k3d_spotlight.sl:23:    atten = pow(cosangle, beamdistribution) / (L.L);
k3d/share/shaders/k3d_spotlight.sl:26:    Cl = atten * intensity * lightcolor;
k3d/share/shaders/k3d_square_ridges.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
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:13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
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:21:		\author Tim Shead (tshead@k-3d.com)
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:27:#define filter_width(x) max(abs(Du(x)*du) + abs(Dv(x)*dv), MIN_FILTER_WIDTH)
k3d/share/shaders/k3d_square_ridges.sl:32:	return step(edge0, x) - step(edge1, x);
k3d/share/shaders/k3d_square_ridges.sl:35:float pulse_train(float edge, period, x)
k3d/share/shaders/k3d_square_ridges.sl:37:	return pulse(edge, period, mod(x, period));
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: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:54:	return (integral(x1) - integral(x0)) / w;
k3d/share/shaders/k3d_square_ridges.sl:57:displacement k3d_square_ridges(
k3d/share/shaders/k3d_square_ridges.sl:59:	float Frequency = 8.0;
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:66:	vector Nn = normalize(N);
k3d/share/shaders/k3d_square_ridges.sl:67:	P += Nn * ((Km * ridge_position) / length(vtransform("shader", Nn)));
k3d/share/shaders/k3d_square_ridges.sl:68://	P += Km * ridge_position * N;
k3d/share/shaders/k3d_square_ridges.sl:69:	N = calculatenormal(P);
k3d/share/shaders/k3d_srfdeformation.sl:1:/* renamed shader to SIG2k_srf_deformation to be consistent with RMR 
k3d/share/shaders/k3d_srfdeformation.sl:2: *    -- tal@SpamSucks_renderman.org
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:18:   by Rob Bredow and Scott Stokdyk 
k3d/share/shaders/k3d_srfdeformation.sl:21:color
k3d/share/shaders/k3d_srfdeformation.sl:22:fnc_mydiffuse (color Cl; 
k3d/share/shaders/k3d_srfdeformation.sl:23:	       vector L; 
k3d/share/shaders/k3d_srfdeformation.sl:24:	       normal N) 
k3d/share/shaders/k3d_srfdeformation.sl:26:    normal Nn; 
k3d/share/shaders/k3d_srfdeformation.sl:27:    vector Ln;
k3d/share/shaders/k3d_srfdeformation.sl:29:    Nn = normalize(N);
k3d/share/shaders/k3d_srfdeformation.sl:30:    Ln = normalize(L);
k3d/share/shaders/k3d_srfdeformation.sl:31:    return Cl * max(Ln.Nn,0);   
k3d/share/shaders/k3d_srfdeformation.sl:36:fnc_projectCurrentCamera(point P;
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:48:    string texname = "";        /* Texture to project */
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: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:60:    color Ci0, Ci1, Ci2;
k3d/share/shaders/k3d_srfdeformation.sl:61:    normal N1, N2;
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:69:	Ci0 = texture(texname, x, y);
k3d/share/shaders/k3d_srfdeformation.sl:73:    /* Calculate shading difference between P and Porig*/
k3d/share/shaders/k3d_srfdeformation.sl:75:    N = normalize(calculatenormal(P));
k3d/share/shaders/k3d_srfdeformation.sl:76:    N1 = faceforward(normalize(N),I);
k3d/share/shaders/k3d_srfdeformation.sl:77:    N = normalize(calculatenormal(Porig));
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:85:    illuminance(P, N1, radians(illum_width)) {
k3d/share/shaders/k3d_srfdeformation.sl:89:    illuminance(Porig, N2, radians(illum_width)) {
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:1:/* I took wave's lead and renamed star to DPStar.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_star.sl:4: * star.sl
k3d/share/shaders/k3d_star.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_star.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_star.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_star.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_star.sl:14:#include "k3d_proctext.h"
k3d/share/shaders/k3d_star.sl:16:surface
k3d/share/shaders/k3d_star.sl:17:k3d_star(
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:27:    color Ct;
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:33:        (cos(starangle/2),sin(starangle/2),0);
k3d/share/shaders/k3d_star.sl:34:    uniform point d0 = p1 - p0;
k3d/share/shaders/k3d_star.sl:37:    ss = s - sctr; tt = t - tctr;
k3d/share/shaders/k3d_star.sl:39:    r = sqrt(ss*ss + tt*tt);
k3d/share/shaders/k3d_star.sl:40:    a = mod(angle, starangle)/starangle;
k3d/share/shaders/k3d_star.sl:44:    d1 = r*(cos(a), sin(a),0) - p0;
k3d/share/shaders/k3d_star.sl:46:    Ct = mix(Cs, starcolor, in_out);
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:4:	We partition space into a 1x1x1 grid, rendering one solid spherical "star" per cell.
k3d/share/shaders/k3d_starfield.sl:8:	AUTHOR: written by Timothy M. Shead
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:13:	// Work in object coordinates ...
k3d/share/shaders/k3d_starfield.sl:14:	point PP = transform("object", frequency * P);
k3d/share/shaders/k3d_starfield.sl:16:	// Get the nearest star ...
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:19:	star_center += irregularity * (point noise(star_center) - point(0.5, 0.5, 0.5));
k3d/share/shaders/k3d_starfield.sl:21:	// Calculate the distance to the nearest star ...
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:26:	// Give stars relative intensities ...
k3d/share/shaders/k3d_starfield.sl:27:	float star_intensity = float cellnoise(star_center);
k3d/share/shaders/k3d_starfield.sl:29:	Ci = intensity * star_intensity * inside_star * inside_star;
k3d/share/shaders/k3d_stones.sl:5: * Copyright (C) 2002, Rudy Cortes   rcortes@hntb.com
k3d/share/shaders/k3d_stones.sl:6: * created  06/12/2002
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:9: * without express or implied warranty.
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:13: * Uses st to create the rocks and "shader" space to create the grunge.
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:21: * ka, Kd, Ks, roughness = the usual
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:26: * stonecolor, groundcolor = this is obvious, isn't it?
k3d/share/shaders/k3d_stones.sl:27: * varyhue, varysat,varylum  = how much will the color change?
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:33: * NOTE .- This shader is VERY SLOW when you enable bumping, even SLOWER with
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:42:  rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); \
k3d/share/shaders/k3d_stones.sl:43:  ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_stones.sl:51:#define whichtile(x,freq) (floor((x) * (freq)))
k3d/share/shaders/k3d_stones.sl:53:#define filterwidth_point(p) (max(sqrt(area(p)), MINFILTERWIDTH))
k3d/share/shaders/k3d_stones.sl:57:/* varyEach takes a computed color, then tweaks each indexed item
k3d/share/shaders/k3d_stones.sl:58: * separately to add some variation.  Hue, saturation, and lightness
k3d/share/shaders/k3d_stones.sl:59: * are all independently controlled.  Hue adds, but saturation and
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:65:    /* Convert to "hsv" space, it's more convenient */
k3d/share/shaders/k3d_stones.sl:66:    color Chsv = ctransform ("hsv", Cin);
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:69:    h += varyhue * (cellnoise(index+3)-0.5);
k3d/share/shaders/k3d_stones.sl:70:    s *= 1 - varysat * (cellnoise(index-14)-0.5);
k3d/share/shaders/k3d_stones.sl:71:    v *= 1 - varyval * (cellnoise(index+37)-0.5);
k3d/share/shaders/k3d_stones.sl:72:    Chsv = color (mod(h,1), clamp(s,0,1), clamp(v,0,1));
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:84:          Ks = 0, roughness = 1,
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:91:   color  stonecolor = color(.7,.6,.4);
k3d/share/shaders/k3d_stones.sl:92:   color  groundcolor = color (.45,0.35,0.2);
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:99: float freq,mag;
k3d/share/shaders/k3d_stones.sl:100: float r,theta,angle;
k3d/share/shaders/k3d_stones.sl:103: float noifreq = 10, noiscale = 0.3;
k3d/share/shaders/k3d_stones.sl:105: vector V;
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:117:   rotate2d(s,t,angle,0.5,0.5,cx,cy);    /*randomize rotations*/
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:125:   /*tile index to be use in vary each*/
k3d/share/shaders/k3d_stones.sl:128:   /*create buble shapes*/
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:143:   layer_opac = clamp( mag,0,1);
k3d/share/shaders/k3d_stones.sl:144:   /*create a diferent color for each rock*/
k3d/share/shaders/k3d_stones.sl:145:   layer_color = varyEach(stonecolor, stoneindex,varyhue,varysat,varylum);
k3d/share/shaders/k3d_stones.sl:146:   surface_color = mix(surface_color,layer_color,layer_opac);
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:168:        turb += fade * abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_stones.sl:170:        grunge = pow(turb, grunge_Pow);
k3d/share/shaders/k3d_stones.sl:171:        surface_mag += grunge * grunginess;
k3d/share/shaders/k3d_stones.sl:177:  P += Km * surface_mag * normalize(N);
k3d/share/shaders/k3d_stones.sl:178:  N = normalize(calculatenormal(P)); 
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:185:  V = - normalize(I);
k3d/share/shaders/k3d_stones.sl:187:/*color output*/
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:11: *    turbscale - how turbulent the layers are
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:20: *    C language version by F. Kenton Musgrave
k3d/share/shaders/k3d_strata.sl:21: *    Translation to Shading Language by Larry Gritz.
k3d/share/shaders/k3d_strata.sl:24: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_strata.sl:25: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_strata.sl:26: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_strata.sl:29: *    ??? - original C language version by Ken Musgrave
k3d/share/shaders/k3d_strata.sl:30: *    Apr 94 - translation to Shading Language by L. Gritz
k3d/share/shaders/k3d_strata.sl:32: * this file last updated 18 Apr 1994
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:42:  color Ct;
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:49:  turb = 0;
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:59:    color spline(mod(cmap, 1), color(166, 131, 70), color(166, 131, 70),
k3d/share/shaders/k3d_strata.sl:60:		 color(204, 178, 127), color(184, 153, 97), color(140, 114,
k3d/share/shaders/k3d_strata.sl:62:		 color(159, 123, 60), color(204, 178, 127), color(230, 180,
k3d/share/shaders/k3d_strata.sl:64:		 color(192, 164, 110), color(172, 139, 80), color(102, 76,
k3d/share/shaders/k3d_strata.sl:66:		 color(166, 131, 70), color(201, 175, 124), color(181, 150,
k3d/share/shaders/k3d_strata.sl:68:		 color(161, 125, 64), color(177, 145, 87), color(170, 136,
k3d/share/shaders/k3d_strata.sl:70:		 color(197, 170, 117), color(180, 100, 50), color(175, 142,
k3d/share/shaders/k3d_strata.sl:72:		 color(197, 170, 117), color(177, 145, 87), color(170, 136,
k3d/share/shaders/k3d_strata.sl:74:		 color(186, 156, 100), color(166, 131, 70), color(188, 159,
k3d/share/shaders/k3d_strata.sl:76:		 color(168, 134, 74), color(159, 123, 60), color(195, 167,
k3d/share/shaders/k3d_strata.sl:78:		 color(175, 142, 84), color(161, 125, 64), color(197, 170,
k3d/share/shaders/k3d_strata.sl:80:		 color(177, 145, 87), color(177, 145, 87)) / 255;
k3d/share/shaders/k3d_strata.sl:82:  /* Shade like matte, but with color scaled by cloudcolor and opacity */
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: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:13: * AUTHOR: written by Larry Gritz (lg@bmrt.org)
k3d/share/shaders/k3d_stucco.sl:17:displacement k3d_stucco(float Km = 0.05, power = 5, frequency = 10;)
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_stucco.sl:24:  P += magnitude * normalize(N);
k3d/share/shaders/k3d_stucco.sl:25:  N = calculatenormal(P);
k3d/share/shaders/k3d_superkagee.sl:14:    uniform string      theName;
k3d/share/shaders/k3d_superkagee.sl:15:    varying point       thePoint;
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:27:                            "filter",   theFilterName,
k3d/share/shaders/k3d_superkagee.sl:28:                            "blur",     theBlur,
k3d/share/shaders/k3d_superkagee.sl:31:return(inShadow);
k3d/share/shaders/k3d_superkagee.sl:39:surface k3d_superkagee(
k3d/share/shaders/k3d_superkagee.sl:40:    color shadColor = 0;
k3d/share/shaders/k3d_superkagee.sl:41:    string     shadownamea = "";
k3d/share/shaders/k3d_superkagee.sl:43:            float       shadowblura = 0,
k3d/share/shaders/k3d_superkagee.sl:48:    string     shadownameb = "";
k3d/share/shaders/k3d_superkagee.sl:50:            float       shadowblurb = 0,
k3d/share/shaders/k3d_superkagee.sl:55:    string     shadownamec = "";
k3d/share/shaders/k3d_superkagee.sl:57:            float       shadowblurc = 0,
k3d/share/shaders/k3d_superkagee.sl:62:    string     shadownamed = "";
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:72:"$Id: k3d_superkagee.sl,v 1.1 2004/05/19 18:15:20 tshead Exp $";
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:78:                    shadowfilta,shadowblura,shadowsamplesa,shadowbiasa
k3d/share/shaders/k3d_superkagee.sl:85:                    shadowfiltb,shadowblurb,shadowsamplesb,shadowbiasb
k3d/share/shaders/k3d_superkagee.sl:92:                    shadowfiltc,shadowblurc,shadowsamplesc,shadowbiasc
k3d/share/shaders/k3d_superkagee.sl:99:                    shadowfiltd,shadowblurd,shadowsamplesd,shadowbiasd
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:4: * Description:
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:6: *   like varnished oak planks, with staggered planks, rings and grain,
k3d/share/shaders/k3d_superplank.sl:7: *   reflections (either traced or via reflection map), and bumps.
k3d/share/shaders/k3d_superplank.sl:8: *   It can make the plank pattern as either straight staggered planks
k3d/share/shaders/k3d_superplank.sl:9: *   or in a parquet pattern.
k3d/share/shaders/k3d_superplank.sl:11: * Parameters:
k3d/share/shaders/k3d_superplank.sl:12: *   Ka, Kd, Ks, specularcolor, roughness - work just like the plastic shader
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:23: *   plankpattern - plank orientation pattern  1=straight, 2=parquet
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:39: * Author: written by Larry Gritz
k3d/share/shaders/k3d_superplank.sl:40: *          current contact address: gritzl@acm.org
k3d/share/shaders/k3d_superplank.sl:47:#include "k3d_patterns.h"
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:60:			/* Overall texturing control */
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:63:			color lightwood = color(.5, .2, .067);	/* light wood color */
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: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:71:			color groovecolor = color(.01, .003, .001);
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:74:			/* Wood appearance */
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:85:  /* mapping coordinates */
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:90:  float sw, tw, overallscale;
k3d/share/shaders/k3d_superplank.sl:91:  /* Planks & grooves */
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:96:  /* Wood appearance */
k3d/share/shaders/k3d_superplank.sl:97:  color Ct, woodcolor;
k3d/share/shaders/k3d_superplank.sl:98:  float r2;
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:104:  vector IN;			/* normalized I vector */
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:112:  vector V;
k3d/share/shaders/k3d_superplank.sl:113:  color Cspec;
k3d/share/shaders/k3d_superplank.sl:120:   * Determine the basic mapping, filter sizes for antialiasing, other
k3d/share/shaders/k3d_superplank.sl:121:   * values used throughout the shader.
k3d/share/shaders/k3d_superplank.sl:124:  /* First, determine the basic mapping */
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:132:  /* How much current space corresponds to a unit of s or t?
k3d/share/shaders/k3d_superplank.sl:133:   * We will use this later to help scale the displacement, this making
k3d/share/shaders/k3d_superplank.sl:134:   * the bumps scale relative to the overall pattern, rather than being
k3d/share/shaders/k3d_superplank.sl:135:   * strictly tied to the scale of the object.
k3d/share/shaders/k3d_superplank.sl:137:  overallscale = (length(Deriv(P, ss)));
k3d/share/shaders/k3d_superplank.sl:141:   * 2. Plank pattern.
k3d/share/shaders/k3d_superplank.sl:143:   * Determine which row and plank we're on, and come up with an
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:148:      /* Straight, staggered planks */
k3d/share/shaders/k3d_superplank.sl:149:      PGWIDTH = plankwidth + groovewidth;
k3d/share/shaders/k3d_superplank.sl:150:      PGHEIGHT = planklength + groovewidth;
k3d/share/shaders/k3d_superplank.sl:152:      whichrow = floor(plank_s);
k3d/share/shaders/k3d_superplank.sl:153:      /* Jiggle each row */
k3d/share/shaders/k3d_superplank.sl:154:      plank_t = tt / PGHEIGHT + 20 * plankstagger * cellnoise(whichrow);
k3d/share/shaders/k3d_superplank.sl:155:      whichplank = floor(plank_t);
k3d/share/shaders/k3d_superplank.sl:159:      /* Parquet pattern */
k3d/share/shaders/k3d_superplank.sl:160:      PGWIDTH = plankwidth + groovewidth;
k3d/share/shaders/k3d_superplank.sl:161:      PGHEIGHT = PGWIDTH * plankspertile;
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:182:  /* Figure out where the grooves are.  The value groovy is 0 where there
k3d/share/shaders/k3d_superplank.sl:183:   * are grooves, 1 where the wood grain is visible.  Do some simple
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:188:  GWF = groovewidth * 0.5 / PGWIDTH;
k3d/share/shaders/k3d_superplank.sl:189:  GHF = groovewidth * 0.5 / PGHEIGHT;
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: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:200:  groovy = w * h;
k3d/share/shaders/k3d_superplank.sl:203:   * 3. Ring and grain patterns, color and specularity adjustment.
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:206:   * interact subtly.
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:210:   * the rings are too small to see.
k3d/share/shaders/k3d_superplank.sl:212:  fwidth = max(swidth * ringscale, twidth * ringscale);
k3d/share/shaders/k3d_superplank.sl:216:      ring_s = ss * ringscale;
k3d/share/shaders/k3d_superplank.sl:217:      ring_t = tt * ringscale;
k3d/share/shaders/k3d_superplank.sl:218:      ttt = ring_t + whichplank * 28.38 + wavy * noise(8 * ring_s, ring_t);
k3d/share/shaders/k3d_superplank.sl:219:      ring = ringscale * noise(ring_s - whichplank * 4.18, ttt / 20);
k3d/share/shaders/k3d_superplank.sl:220:      ring -= floor(ring);
k3d/share/shaders/k3d_superplank.sl:221:      ring =
k3d/share/shaders/k3d_superplank.sl:222:	0.3 + 0.7 * smoothstep(.55 - .35 * ringwidth, 0.55,
k3d/share/shaders/k3d_superplank.sl:223:			       ring) * (1 - smoothstep(0.75, 0.8, ring));
k3d/share/shaders/k3d_superplank.sl:224:      ring = (1 - fade) * ring + 0.65 * fade;
k3d/share/shaders/k3d_superplank.sl:226:      /* Grain pattern */
k3d/share/shaders/k3d_superplank.sl:227:      fwidth = max(swidth * grainscale, twidth * grainscale);
k3d/share/shaders/k3d_superplank.sl:231:	  grain_s = ss * grainscale;
k3d/share/shaders/k3d_superplank.sl:232:	  grain_t = tt * grainscale;
k3d/share/shaders/k3d_superplank.sl:233:	  r2 = 1.3 - noise(12 * grain_s, grain_t);
k3d/share/shaders/k3d_superplank.sl:234:	  r2 = grainy * r2 * r2 + (1 - grainy);
k3d/share/shaders/k3d_superplank.sl:235:	  grain = (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_superplank.sl:238:	grain = 0.75;
k3d/share/shaders/k3d_superplank.sl:242:      ring = 0.4875;
k3d/share/shaders/k3d_superplank.sl:243:      grain = 0.75;
k3d/share/shaders/k3d_superplank.sl:245:  grain *= (.85 + .15 * ring);
k3d/share/shaders/k3d_superplank.sl:247:  /* Start with the light wood color */
k3d/share/shaders/k3d_superplank.sl:248:  woodcolor = lightwood;
k3d/share/shaders/k3d_superplank.sl:249:  /* Add some plank-to-plank variation in overall color */
k3d/share/shaders/k3d_superplank.sl:250:  woodcolor *=
k3d/share/shaders/k3d_superplank.sl:251:    1 - plankvary / 2 + plankvary * float cellnoise(whichplank, whichrow);
k3d/share/shaders/k3d_superplank.sl:252:  /* Darken the wood according to the ring and grain patterns */
k3d/share/shaders/k3d_superplank.sl:253:  woodcolor *= (1 - 0.25 * ring) * (1 - .5 * grain);
k3d/share/shaders/k3d_superplank.sl:254:  /* Combine the rings, grain, plank variation into one surface color */
k3d/share/shaders/k3d_superplank.sl:255:  Ct = mix(groovecolor, woodcolor, groovy);
k3d/share/shaders/k3d_superplank.sl:256:  /* Less specular in the grooves, more specular in the dark wood. */
k3d/share/shaders/k3d_superplank.sl:257:  adjustedKs = Ks * (1 + .2 * ring) * (1 + .3 * grain) * groovy;
k3d/share/shaders/k3d_superplank.sl:263:   * We do some bump mapping to make the grooves and grain depressed,
k3d/share/shaders/k3d_superplank.sl:264:   * and add some general lumpiness to the varnish layer.
k3d/share/shaders/k3d_superplank.sl:268:      /* Grooves */
k3d/share/shaders/k3d_superplank.sl:269:      disp = -groovedepth * (1 - groovy);
k3d/share/shaders/k3d_superplank.sl:270:      /* Random bumps on the varnish */
k3d/share/shaders/k3d_superplank.sl:271:      if(varnishbumpamp > 0)
k3d/share/shaders/k3d_superplank.sl:273:	  varnishbumpamp * (2 *
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:276:      /* Depressions due to grain & rings */
k3d/share/shaders/k3d_superplank.sl:277:      disp -= graindepth * (.75 * grain + ring);
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:279:      NN = normalize(N);
k3d/share/shaders/k3d_superplank.sl:280:      shadlen = overallscale / length(ntransform("shader", NN));
k3d/share/shaders/k3d_superplank.sl:283:      N = calculatenormal(P + (Km * shadlen * disp) * 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:291:   * Have some subtle interaction between grain and specularity.
k3d/share/shaders/k3d_superplank.sl:294:  IN = normalize(I);
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:303:    lightsource("__nonspecular", nonspec);
k3d/share/shaders/k3d_superplank.sl:306:	vector H = normalize(normalize(L) + V);
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:314:    adjustedKs * (specularcolor * Cspec);
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:2: * (c) Copyright 1988, Pixar.
k3d/share/shaders/k3d_superpplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_superpplastic.sl:5: *     Copyright 1988, 1989, Pixar.  All rights reserved.
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:13: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
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:22:			  color specularcolor = 1; string texturename = "";
k3d/share/shaders/k3d_superpplastic.sl:23:			  float filtertype = 1; float blur = 0.0;
k3d/share/shaders/k3d_superpplastic.sl:27:  normal Nf;
k3d/share/shaders/k3d_superpplastic.sl:28:  vector V;
k3d/share/shaders/k3d_superpplastic.sl:29:  color Ct;
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:49:		    "blur", blur);
k3d/share/shaders/k3d_superpplastic.sl:53:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_superpplastic.sl:54:  V = -normalize(I);
k3d/share/shaders/k3d_superpplastic.sl:58:	  specularcolor * Ks * specular(Nf, V, roughness));
k3d/share/shaders/k3d_supertexmap.sl:2: * supertexmap.sl
k3d/share/shaders/k3d_supertexmap.sl:4: * Description:
k3d/share/shaders/k3d_supertexmap.sl:5: *    Apply a texture map (possibly with associated alpha) 
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:10: * Parameters:
k3d/share/shaders/k3d_supertexmap.sl:11: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
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:14: *                 "perspective", "cylindrical", "spherical".
k3d/share/shaders/k3d_supertexmap.sl:15: *    textureprojspace - the space in which the texture projection is
k3d/share/shaders/k3d_supertexmap.sl:16: *                applied; either a standard space like "shader", or a
k3d/share/shaders/k3d_supertexmap.sl:17: *                named coordinate system.
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:22: * Author: Larry Gritz (gritzl@acm.org)
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:31:#include "k3d_project.h"
k3d/share/shaders/k3d_supertexmap.sl:33:#include "k3d_material.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:37:			/* base color */
k3d/share/shaders/k3d_supertexmap.sl:38:			string Csmapname = "", Csproj = "st", Csspace =
k3d/share/shaders/k3d_supertexmap.sl:39:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:43:			float Csblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:45:			string Osmapname = "", Osproj = "st", Osspace =
k3d/share/shaders/k3d_supertexmap.sl:46:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:50:			float Osblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:51:			/* specularity */
k3d/share/shaders/k3d_supertexmap.sl:52:			string Ksmapname = "", Ksproj = "st", Ksspace =
k3d/share/shaders/k3d_supertexmap.sl:53:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:57:			float Ksblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:59:			string dispmapname = "", dispproj = "st", dispspace =
k3d/share/shaders/k3d_supertexmap.sl:60:			"shader";
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:68:  /* Start out with the regular plastic parameters, unless overridden
k3d/share/shaders/k3d_supertexmap.sl:71:  color Ct = Cs, Ot = Os;
k3d/share/shaders/k3d_supertexmap.sl:75:  /* Color mapping */
k3d/share/shaders/k3d_supertexmap.sl:78:      ApplyColorTextureOver(Ct, Csmapname, Csproj, P, Csspace,
k3d/share/shaders/k3d_supertexmap.sl:79:			    array_to_mx(Csmx), Csblur);
k3d/share/shaders/k3d_supertexmap.sl:84:      ApplyColorTextureOver(Ct, Osmapname, Osproj, P, Osspace,
k3d/share/shaders/k3d_supertexmap.sl:85:			    array_to_mx(Osmx), Osblur);
k3d/share/shaders/k3d_supertexmap.sl:87:  /* specularity mapping */
k3d/share/shaders/k3d_supertexmap.sl:90:      ApplyFloatTextureOver(Ks, Ksmapname, Ksproj, P, Ksspace,
k3d/share/shaders/k3d_supertexmap.sl:91:			    array_to_mx(Ksmx), Ksblur);
k3d/share/shaders/k3d_supertexmap.sl:97:	ApplyFloatTextureOver(disp, dispmapname, dispproj, P, dispspace,
k3d/share/shaders/k3d_supertexmap.sl:98:			      array_to_mx(dispmx), dispblur);
k3d/share/shaders/k3d_supertexmap.sl:99:      N = Displace(normalize(N), dispspace, disp, truedisp);
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:1:/* SuperToon.sl V1.1    Felipe Esquivel 

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:5: * no se tenga un degradado en el cambio de color. En su lugar el cambio se

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:7: * analitico se utiliza delta para determinar el nivel de antialiasing del shader.

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:11: * reason why no border detection is allowed. Now with specular.

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:15:  color C = 0;

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

k3d/share/shaders/k3d_supertoon.sl:18:    C = smoothstep(lim2 - delta, lim2 + delta, comp(valor, 0))* lim2;

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:21:    C = lim2 + (smoothstep(lim3 - delta, lim3 + delta, comp(valor, 0))* lim3);

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

k3d/share/shaders/k3d_supertoon.sl:24:    C = lim3 + (smoothstep(lim4 - delta, lim4, comp(valor, 0))* lim4);

k3d/share/shaders/k3d_supertoon.sl:27:  return C;

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

k3d/share/shaders/k3d_supertoon.sl:32:                        roughness = 0.5, /* specular roughness */

k3d/share/shaders/k3d_supertoon.sl:37:                  color specColor = 1;)

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

k3d/share/shaders/k3d_supertoon.sl:40:    vector NI = normalize(I);

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

k3d/share/shaders/k3d_supertoon.sl:42:    color  especular = 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:46:      especular = splitColor(especular, delta * 3, lim3, lim4, lim4);

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:2:mottle_limit, mottle_scale, moddle_dim, mottle_mag - control the
k3d/share/shaders/k3d_terran.sl:3:           mottling that adds detail to lower latitude regions.
k3d/share/shaders/k3d_terran.sl:10:/* This is because PRMAN's noise has less range than BMRT's */
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: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:37:  float chaos, latitude, purt;
k3d/share/shaders/k3d_terran.sl:38:  color Ct;
k3d/share/shaders/k3d_terran.sl:39:  point Ptexture, tp;
k3d/share/shaders/k3d_terran.sl:40:  float l, o, a, i, weight;	/* Loop variables for fBm calc */
k3d/share/shaders/k3d_terran.sl:43:  /* Do all shading in shader space */
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:50:   *       expect these two shaders to work well together.
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:60:	  bumpy += o * snoise(l * Ptexture);
k3d/share/shaders/k3d_terran.sl:61:	  l *= lacunarity;
k3d/share/shaders/k3d_terran.sl:62:	  o *= spectral_exp;
k3d/share/shaders/k3d_terran.sl:66:    {				/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terran.sl:67:      /* get "distortion" vector, as used with clouds */
k3d/share/shaders/k3d_terran.sl:68:      Ptexture += dist_scale * DNoise(Ptexture);
k3d/share/shaders/k3d_terran.sl:69:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terran.sl:70:      o = spectral_exp;
k3d/share/shaders/k3d_terran.sl:71:      tp = Ptexture;
k3d/share/shaders/k3d_terran.sl:74:      for(i = 1; i < octaves && weight >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_terran.sl:76:	  tp *= lacunarity;
k3d/share/shaders/k3d_terran.sl:77:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terran.sl:80:	  bumpy += snoise(tp) * min(weight, spectral_exp);
k3d/share/shaders/k3d_terran.sl:81:	  o *= spectral_exp;
k3d/share/shaders/k3d_terran.sl:87:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran.sl:96:   * Step 2: Assign a climite type, roughly by latitude.
k3d/share/shaders/k3d_terran.sl:99:  /* make climate symmetric about equator -- use the "v" parameter */
k3d/share/shaders/k3d_terran.sl:102:  /* fractally purturb color map offset using "chaos" */
k3d/share/shaders/k3d_terran.sl:103:  /*  "nonlinear" scales purturbation-by-z */
k3d/share/shaders/k3d_terran.sl:104:  /*  "purt_scale" scales overall purturbation */
k3d/share/shaders/k3d_terran.sl:105:  latitude += chaos * (nonlinear * (1 - latitude) + purt_scale);
k3d/share/shaders/k3d_terran.sl:114:      /* Choose color of land based on the following spline.
k3d/share/shaders/k3d_terran.sl:115:       * Ken originally had a huge table.  I was too lazy to type it in,
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:117:       * suitable colors.  -- lg
k3d/share/shaders/k3d_terran.sl:121:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran.sl:122:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran.sl:123:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran.sl:124:		   color (.255, .341,  0),
k3d/share/shaders/k3d_terran.sl:125:		   color (.256, .341, .141),
k3d/share/shaders/k3d_terran.sl:126:		   color (.235, .392, .235),
k3d/share/shaders/k3d_terran.sl:127:		   color (.490, .494, .1176),
k3d/share/shaders/k3d_terran.sl:128:		   color (.655, .529, .392),
k3d/share/shaders/k3d_terran.sl:129:		   color (.769, .616, .314),
k3d/share/shaders/k3d_terran.sl:130:		   color (.976, .820, .471),
k3d/share/shaders/k3d_terran.sl:131:		   color (1,1,1),
k3d/share/shaders/k3d_terran.sl:132:		   color (1,1,1));
k3d/share/shaders/k3d_terran.sl:135:	spline(latitude, color(.5, .39, .2), color(.5, .39, .2),
k3d/share/shaders/k3d_terran.sl:136:	       color(.5, .39, .2), color(.2, .3, 0), color(.085, .2, .04),
k3d/share/shaders/k3d_terran.sl:137:	       color(.065, .22, .04), color(.5, .42, .28), color(.6, .5, .23),
k3d/share/shaders/k3d_terran.sl:138:/*		   color (.976, .820, .471), */
k3d/share/shaders/k3d_terran.sl:139:	       color(1, 1, 1), color(1, 1, 1));
k3d/share/shaders/k3d_terran.sl:141:      /* mottle the color some */
k3d/share/shaders/k3d_terran.sl:144:	  PP = mottle_scale * Ptexture;
k3d/share/shaders/k3d_terran.sl:147:	  for(i = 0; i < 6; i += 1)
k3d/share/shaders/k3d_terran.sl:149:	      purt += o * snoise(l * PP);
k3d/share/shaders/k3d_terran.sl:153:	  Ct += (mottle_mag * purt) * (color(0.5, 0.175, 0.5));
k3d/share/shaders/k3d_terran.sl:159:      Ct = color(.1, .2, .5);
k3d/share/shaders/k3d_terran.sl:161:	Ct = color(1, 1, 1);	/* Ice color */
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:1:/* Was terran.sl -- changed color spline to not use white 
k3d/share/shaders/k3d_terran2.sl:5: * terran.sl - surface for an Earth-like planet.
k3d/share/shaders/k3d_terran2.sl:9: *      When put on a sphere, sets the color to look like relatively
k3d/share/shaders/k3d_terran2.sl:10: *   Earth-like.  The shader works by using a variety of fractal 
k3d/share/shaders/k3d_terran2.sl:11: *   turbulence and mottling techniques.
k3d/share/shaders/k3d_terran2.sl:12: *      Note that there is a companion displacement shader "terranbump"
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:14: *   important that the parameters common to "terran" and "terranbump"
k3d/share/shaders/k3d_terran2.sl:15: *   both be set to the same values.  Otherwise you get bumpy mountains
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: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: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:30: *               terrain type by latitude
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:33: *    mottle_limit, mottle_scale, moddle_dim, mottle_mag - control the
k3d/share/shaders/k3d_terran2.sl:34: *               mottling that adds detail to lower latitude regions.
k3d/share/shaders/k3d_terran2.sl:38: *       The default values for the shader assume that the planet is
k3d/share/shaders/k3d_terran2.sl:39: *    represented by a unit sphere.  The texture space and/or parameters
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:42: *       For best results, use with the "terranbump" displacement shader,
k3d/share/shaders/k3d_terran2.sl:43: *    and add a cloud layer using either "planetclouds" or "venusclouds".
k3d/share/shaders/k3d_terran2.sl:46: * AUTHOR: Ken Musgrave.
k3d/share/shaders/k3d_terran2.sl:47: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_terran2.sl:54: *    ???? - original texture developed by F. Ken Musgrave.
k3d/share/shaders/k3d_terran2.sl:55: *    Feb 1994 - Conversion to Shading Language by L. Gritz
k3d/share/shaders/k3d_terran2.sl:56: *    1 March 1994 by lg
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:66:/* This is because PRMAN's noise has less range than BMRT's */
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:81:	  float multifractal = 0;
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:100:  float chaos, latitude, purt;
k3d/share/shaders/k3d_terran2.sl:101:  color Ct;
k3d/share/shaders/k3d_terran2.sl:102:  point Ptexture, tp;
k3d/share/shaders/k3d_terran2.sl:103:  float l, o, a, i, weight;      /* Loop variables for fBm calc */
k3d/share/shaders/k3d_terran2.sl:106:  /* Do all shading in shader space */
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:113:   *       expect these two shaders to work well together.
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:119:	  bumpy += o * snoise (l * Ptexture);
k3d/share/shaders/k3d_terran2.sl:120:	  l *= lacunarity;
k3d/share/shaders/k3d_terran2.sl:121:	  o *= spectral_exp;
k3d/share/shaders/k3d_terran2.sl:124:  else {			/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terran2.sl:125:      /* get "distortion" vector, as used with clouds */
k3d/share/shaders/k3d_terran2.sl:126:      Ptexture += dist_scale * DNoise (Ptexture);
k3d/share/shaders/k3d_terran2.sl:127:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terran2.sl:128:      o = spectral_exp;  tp = Ptexture;
k3d/share/shaders/k3d_terran2.sl:131:      for (i = 1;  i < octaves  &&  weight >= VERY_SMALL;  i += 1) {
k3d/share/shaders/k3d_terran2.sl:132:	  tp *= lacunarity;
k3d/share/shaders/k3d_terran2.sl:133:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terran2.sl:136:	  bumpy += snoise(tp) * min (weight, spectral_exp);
k3d/share/shaders/k3d_terran2.sl:137:	  o *= spectral_exp;
k3d/share/shaders/k3d_terran2.sl:143:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran2.sl:151:   * Step 2: Assign a climite type, roughly by latitude.
k3d/share/shaders/k3d_terran2.sl:154:  /* make climate symmetric about equator -- use the "v" parameter */
k3d/share/shaders/k3d_terran2.sl:157:  /* fractally purturb color map offset using "chaos" */
k3d/share/shaders/k3d_terran2.sl:158:  /*  "nonlinear" scales purturbation-by-z */
k3d/share/shaders/k3d_terran2.sl:159:  /*  "purt_scale" scales overall purturbation */
k3d/share/shaders/k3d_terran2.sl:160:  latitude += chaos*(nonlinear*(1-latitude) + purt_scale);
k3d/share/shaders/k3d_terran2.sl:167:      /* Choose color of land based on the following spline.
k3d/share/shaders/k3d_terran2.sl:168:       * Ken originally had a huge table.  I was too lazy to type it in,
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:170:       * suitable colors.  -- lg
k3d/share/shaders/k3d_terran2.sl:174:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran2.sl:175:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran2.sl:176:		   color (.529, .412, .2745),
k3d/share/shaders/k3d_terran2.sl:177:		   color (.255, .341,  0),
k3d/share/shaders/k3d_terran2.sl:178:		   color (.256, .341, .141),
k3d/share/shaders/k3d_terran2.sl:179:		   color (.235, .392, .235),
k3d/share/shaders/k3d_terran2.sl:180:		   color (.490, .494, .1176),
k3d/share/shaders/k3d_terran2.sl:181:		   color (.655, .529, .392),
k3d/share/shaders/k3d_terran2.sl:182:		   color (.769, .616, .314),
k3d/share/shaders/k3d_terran2.sl:183:		   color (.976, .820, .471),
k3d/share/shaders/k3d_terran2.sl:184:		   color (1,1,1),
k3d/share/shaders/k3d_terran2.sl:185:		   color (1,1,1));
k3d/share/shaders/k3d_terran2.sl:188:		   color (.5, .39, .2),
k3d/share/shaders/k3d_terran2.sl:189:		   color (.5, .39, .2),
k3d/share/shaders/k3d_terran2.sl:190:		   color (.5, .39, .2),
k3d/share/shaders/k3d_terran2.sl:191:		   color (.2, .3,  0),
k3d/share/shaders/k3d_terran2.sl:192:		   color (.085, .2, .04),
k3d/share/shaders/k3d_terran2.sl:193:		   color (.065, .22, .04),
k3d/share/shaders/k3d_terran2.sl:194:		   color (.5, .42, .28),
k3d/share/shaders/k3d_terran2.sl:195:		   color (.6, .5, .23),
k3d/share/shaders/k3d_terran2.sl:196:		   color (.976, .820, .471), 
k3d/share/shaders/k3d_terran2.sl:197:		/*   color (.976, .820, .471), */ 
k3d/share/shaders/k3d_terran2.sl:198:		   color (1,1,1) /* ,
k3d/share/shaders/k3d_terran2.sl:199:		   color (1,1,1) */);
k3d/share/shaders/k3d_terran2.sl:201:     /* mottle the color some */
k3d/share/shaders/k3d_terran2.sl:203:         PP = mottle_scale * Ptexture;
k3d/share/shaders/k3d_terran2.sl:205:	 for (i = 0;  i < 6;  i += 1) {
k3d/share/shaders/k3d_terran2.sl:206:	     purt += o * snoise (l * PP);
k3d/share/shaders/k3d_terran2.sl:210:	 Ct += (mottle_mag * purt) * (color (0.5,0.175,0.5));
k3d/share/shaders/k3d_terran2.sl:215:      Ct = color(.1,.2,.5);
k3d/share/shaders/k3d_terran2.sl:217:	  Ct = color(1,1,1);  /* Ice color */
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:6:/* This is because PRMAN's noise has less range than BMRT's */
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:24:  point Ptexture, tp;
k3d/share/shaders/k3d_terranbump.sl:25:  float l, o, a, i, weight;	/* Loop variables for fBm calc */
k3d/share/shaders/k3d_terranbump.sl:28:  /* Do all shading in shader space */
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:38:	  bumpy += o * snoise(l * Ptexture);
k3d/share/shaders/k3d_terranbump.sl:39:	  l *= lacunarity;
k3d/share/shaders/k3d_terranbump.sl:40:	  o *= spectral_exp;
k3d/share/shaders/k3d_terranbump.sl:44:    {				/* use a "multifractal" fBm bump function */
k3d/share/shaders/k3d_terranbump.sl:45:      /* get "distortion" vector, as used with clouds */
k3d/share/shaders/k3d_terranbump.sl:46:      Ptexture += dist_scale * DNoise(Ptexture);
k3d/share/shaders/k3d_terranbump.sl:47:      /* compute bump vector using MfBm with displaced point */
k3d/share/shaders/k3d_terranbump.sl:48:      o = spectral_exp;
k3d/share/shaders/k3d_terranbump.sl:49:      tp = Ptexture;
k3d/share/shaders/k3d_terranbump.sl:52:      for(i = 1; i < octaves && weight >= VERY_SMALL; i += 1)
k3d/share/shaders/k3d_terranbump.sl:54:	  tp *= lacunarity;
k3d/share/shaders/k3d_terranbump.sl:55:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terranbump.sl:58:	  bumpy += snoise(tp) * min(weight, spectral_exp);
k3d/share/shaders/k3d_terranbump.sl:59:	  o *= spectral_exp;
k3d/share/shaders/k3d_terranbump.sl:66:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terranbump.sl:68:    P += (bump_scale * bumpy) * normalize(Ng);
k3d/share/shaders/k3d_terranbump.sl:70:  /* Recalculate the surface normal (this is where all the real magic is!) */
k3d/share/shaders/k3d_terranbump.sl:71:  N = calculatenormal(P);
k3d/share/shaders/k3d_texblender.sl:3:#include "k3d_filterwidth.h"
k3d/share/shaders/k3d_texblender.sl:4:#include "k3d_project.h"
k3d/share/shaders/k3d_texblender.sl:6:#include "k3d_material.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:14:    extern vector I;
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:20:color
k3d/share/shaders/k3d_texblender.sl:21:myEnvironment (point P;  vector R;  float Kr, blur;  DECLARE_ENVPARAMS;)
k3d/share/shaders/k3d_texblender.sl:23:    color C = 0;
k3d/share/shaders/k3d_texblender.sl:27:            C = ReflMap (envname, P, blur, alpha);
k3d/share/shaders/k3d_texblender.sl:29:            C = Environment (envname, envspace, envrad, P, R, blur, alpha);
k3d/share/shaders/k3d_texblender.sl:34:    color Cray = RayTrace (P, R, Kr, sqrt(blur), rayjitter, raysamples, alpha);
k3d/share/shaders/k3d_texblender.sl:35:    C = Cray + (1-alpha) * C;
k3d/share/shaders/k3d_texblender.sl:38:    return C;
k3d/share/shaders/k3d_texblender.sl:41:float myrand(point p;)
k3d/share/shaders/k3d_texblender.sl:50:	n=round(n);
k3d/share/shaders/k3d_texblender.sl:54:	return x/1000;
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:65:		//val=val*(1-Karm)+Karm*snoise(arm*P);
k3d/share/shaders/k3d_texblender.sl:66:		val=val+Karm*snoise(arm*P);
k3d/share/shaders/k3d_texblender.sl:67:		Karm*=0.8;
k3d/share/shaders/k3d_texblender.sl:68:		arm*=2;
k3d/share/shaders/k3d_texblender.sl:70:	return clamp((val+1)/2,0,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:84:    r = 0.2 + 0.8 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, r));
k3d/share/shaders/k3d_texblender.sl:86:    float r2 = grainy * (1.3 - noise (PQ)) + (1-grainy);
k3d/share/shaders/k3d_texblender.sl:88:	return clamp(r*r2*r2,0,1);
k3d/share/shaders/k3d_texblender.sl:91:color colorMap(string mapname, space; 
k3d/share/shaders/k3d_texblender.sl:92:		float scalex, scaley, scalez, octaves, blur;)
k3d/share/shaders/k3d_texblender.sl:94:	point transp;
k3d/share/shaders/k3d_texblender.sl:95:	color newc;
k3d/share/shaders/k3d_texblender.sl:97:	transp=transform(space,P)*vector (scalex, scaley, scalez);
k3d/share/shaders/k3d_texblender.sl:100:		newc=tex_clouds(transp,octaves);
k3d/share/shaders/k3d_texblender.sl:102:		newc=myrand(transp);
k3d/share/shaders/k3d_texblender.sl:104:		newc=tex_wood(transp,octaves);
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:110:			  return newc;
k3d/share/shaders/k3d_texblender.sl:113:color BlendColor(string mode; float K; color newc, oldc)
k3d/share/shaders/k3d_texblender.sl:115:  color res=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:118:	return res;
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:128:	return res;
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:141:		float rKmap[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:148:		float Gblur[5]={0,0,0,0,0};
k3d/share/shaders/k3d_texblender.sl:149:		string Gmapname[5]={"","","","",""};
k3d/share/shaders/k3d_texblender.sl:150:		string Gspace[5]={"object","object","object","object","object"};
k3d/share/shaders/k3d_texblender.sl:151:		string Gmode[5]={"m","m","m","m","m"};
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:159:    vector V ,D,badN,corr,dispDir,ndir;
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:168:		color MC=colorMap(Gmapname[i],Gspace[i],Sgmx[i],Sgmy[i],Sgmz[i],
k3d/share/shaders/k3d_texblender.sl:169:											Depth[i],Gblur[i]);
k3d/share/shaders/k3d_texblender.sl:171:		string mode=Gmode[i];
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: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:178:                                                 MF,roughness);
k3d/share/shaders/k3d_texblender.sl:185:			ndir=normalize(corr+Displace(dispDir,"shader",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:193:	color env=0,benv=0;
k3d/share/shaders/k3d_texblender.sl:194:	float olds=raysamples;
k3d/share/shaders/k3d_texblender.sl:195:	V = normalize(I);
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:205:		else raysamples=olds;
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:1:/* Copyrighted Pixar 1989 */
k3d/share/shaders/k3d_threads.sl:2:/* From the RenderMan Companion p.367 */
k3d/share/shaders/k3d_threads.sl:3:/* Listing 16.24  Displacement shader providing light-bulb threads to cylinder */
k3d/share/shaders/k3d_threads.sl:6: * threads(): wrap threads around a cylinder 
k3d/share/shaders/k3d_threads.sl:9:k3d_threads ( 
k3d/share/shaders/k3d_threads.sl:11:		frequency	= 5.0,
k3d/share/shaders/k3d_threads.sl:19:	magnitude = (sin( PI*2*(t*frequency + s + phase))+offset) * Km;
k3d/share/shaders/k3d_threads.sl:28:	P += normalize(N) * magnitude;
k3d/share/shaders/k3d_threads.sl:29:	N = calculatenormal(P);
k3d/share/shaders/k3d_tooledsteel.sl:1:/*  tooledsteel.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_tooledsteel.sl:2: *  ivan@SpamSucks_martian-tools.com
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:11: *  (like that'll ever happen...)
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: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:30: *			  angle in radians (i.e. PI*.5 = 90 degrees)
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:35:vector
k3d/share/shaders/k3d_tooledsteel.sl:38:  extern point P;
k3d/share/shaders/k3d_tooledsteel.sl:39:  extern vector dPdu;
k3d/share/shaders/k3d_tooledsteel.sl:40:  extern vector dPdv;
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:43:  vector udir = vector(1,0,0);
k3d/share/shaders/k3d_tooledsteel.sl:44:  vector vdir = vector(0,1,0);
k3d/share/shaders/k3d_tooledsteel.sl:47:  float dist, shortest=10000;
k3d/share/shaders/k3d_tooledsteel.sl:50:  point Pou = Po +(udir*.01);
k3d/share/shaders/k3d_tooledsteel.sl:51:  point Pov = Po +(vdir*.01);
k3d/share/shaders/k3d_tooledsteel.sl:53:  /*true cell center, surrounding cell centers, noised cell center*/
k3d/share/shaders/k3d_tooledsteel.sl:54:  point trucell, surrcell, nzcell;
k3d/share/shaders/k3d_tooledsteel.sl:55:  vector offset, nzoff, out;
k3d/share/shaders/k3d_tooledsteel.sl:58:  float ncells = floor(mult);
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:63:  setzcomp(trucell,0);
k3d/share/shaders/k3d_tooledsteel.sl:66:  /*what is the shortest distance to a noised cell center?*/
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:73:	nzcell = surrcell + nzoff;
k3d/share/shaders/k3d_tooledsteel.sl:75:	if(dist<shortest){
k3d/share/shaders/k3d_tooledsteel.sl:76:	  shortest = dist;
k3d/share/shaders/k3d_tooledsteel.sl:82:  chu = valu - shortest;
k3d/share/shaders/k3d_tooledsteel.sl:83:  chv = valv - shortest;
k3d/share/shaders/k3d_tooledsteel.sl:84:  out  = normalize((udir*chu)+(vdir*chv));
k3d/share/shaders/k3d_tooledsteel.sl:85:  return out;
k3d/share/shaders/k3d_tooledsteel.sl:88:color
k3d/share/shaders/k3d_tooledsteel.sl:89:anisospecular (vector VA; float specspread; float specwidth)
k3d/share/shaders/k3d_tooledsteel.sl:92:    extern vector I;
k3d/share/shaders/k3d_tooledsteel.sl:93:    extern normal N;
k3d/share/shaders/k3d_tooledsteel.sl:94:    extern point P;
k3d/share/shaders/k3d_tooledsteel.sl:97:    vector V = normalize(-I);
k3d/share/shaders/k3d_tooledsteel.sl:98:    normal NN = normalize(N);
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:101:    point zro = 0;
k3d/share/shaders/k3d_tooledsteel.sl:104:        extern vector L;  
k3d/share/shaders/k3d_tooledsteel.sl:105:	extern color Cl;
k3d/share/shaders/k3d_tooledsteel.sl:108:        lightsource ("__nonspecular", nonspec);
k3d/share/shaders/k3d_tooledsteel.sl:110:            vector LN = normalize (L);
k3d/share/shaders/k3d_tooledsteel.sl:111:	    vector H = normalize (V + LN);
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:118:    return C;
k3d/share/shaders/k3d_tooledsteel.sl:121:surface
k3d/share/shaders/k3d_tooledsteel.sl:128:		Kr		= .6,
k3d/share/shaders/k3d_tooledsteel.sl:130:		specspread 	= .5,
k3d/share/shaders/k3d_tooledsteel.sl:131:		mapspread 	= .2,
k3d/share/shaders/k3d_tooledsteel.sl:133:	string	mapname 	= "";
k3d/share/shaders/k3d_tooledsteel.sl:134:	color	specularcolor	=  1)
k3d/share/shaders/k3d_tooledsteel.sl:136:        vector VA = getvec(mult,Nzscale);
k3d/share/shaders/k3d_tooledsteel.sl:137:	point Po = transform("object",P);
k3d/share/shaders/k3d_tooledsteel.sl:138:	color ev = 0;
k3d/share/shaders/k3d_tooledsteel.sl:139:	vector D, V= normalize(-I);
k3d/share/shaders/k3d_tooledsteel.sl:140:	vector Nf, Ntmp;
k3d/share/shaders/k3d_tooledsteel.sl:141:        point zro = 0;
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:146:	VA = rotate(VA, twist, zro, normalize(N));
k3d/share/shaders/k3d_tooledsteel.sl:149:	Nf = faceforward(normalize(N), -I);
k3d/share/shaders/k3d_tooledsteel.sl:153:	    for(i=0;i<=numsamples;i=i+1){
k3d/share/shaders/k3d_tooledsteel.sl:154:	      jitter = (random()-.5)*Jspread;
k3d/share/shaders/k3d_tooledsteel.sl:155:	      angle = PI*((i/numsamples)-.5)*mapspread;
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:159:	      ev += environment(mapname, D)*(.5-abs((i/numsamples)-.5))*.25;
k3d/share/shaders/k3d_tooledsteel.sl:166:	specularcolor * Ks * anisospecular(VA, specspread*2, specwidth*.1)) +
k3d/share/shaders/k3d_tooledsteel.sl:167:	ev * Kr;
k3d/share/shaders/k3d_toonmap.sl:3:surface k3d_toonmap (
k3d/share/shaders/k3d_toonmap.sl:8:float roughness=0.107; 
k3d/share/shaders/k3d_toonmap.sl:9:string Highlight_Map="";
k3d/share/shaders/k3d_toonmap.sl:10:color Highlight_Color=(1, 1, 1); 
k3d/share/shaders/k3d_toonmap.sl:17:string Paint_Map="";
k3d/share/shaders/k3d_toonmap.sl:18:color Paint_Color=(0.5, 0.5, 0.5); 
k3d/share/shaders/k3d_toonmap.sl:26:float paint_trans=0.539; 
k3d/share/shaders/k3d_toonmap.sl:28:float ink_thresh=0.389; 
k3d/share/shaders/k3d_toonmap.sl:30:string Ink_Map=""; 
k3d/share/shaders/k3d_toonmap.sl:31:color Ink_Color=(0, 0, 0);
k3d/share/shaders/k3d_toonmap.sl:39:/** Surface main-code start **/
k3d/share/shaders/k3d_toonmap.sl:41:/** Texture_Highlight_Map **/
k3d/share/shaders/k3d_toonmap.sl:42:color temt_c4;
k3d/share/shaders/k3d_toonmap.sl:49:temt_c4=Highlight_Color;
k3d/share/shaders/k3d_toonmap.sl:55:temt_c4=texture(Highlight_Map,temp_ss4,temp_tt4,"swidth",swidth4,"twidth",twidth4,"samples",samples4);
k3d/share/shaders/k3d_toonmap.sl:59:temt_c4=texture(Highlight_Map[channel4],temp_ss4,temp_tt4,"swidth",swidth4,"twidth",twidth4,"samples",samples4);
k3d/share/shaders/k3d_toonmap.sl:62:/** Texture_Paint_Map **/
k3d/share/shaders/k3d_toonmap.sl:63:color temt_c3;
k3d/share/shaders/k3d_toonmap.sl:70:temt_c3=Paint_Color;
k3d/share/shaders/k3d_toonmap.sl:76:temt_c3=texture(Paint_Map,temp_ss3,temp_tt3,"swidth",swidth3,"twidth",twidth3,"samples",samples3);
k3d/share/shaders/k3d_toonmap.sl:80:temt_c3=texture(Paint_Map[channel3],temp_ss3,temp_tt3,"swidth",swidth3,"twidth",twidth3,"samples",samples3);
k3d/share/shaders/k3d_toonmap.sl:83:/** Texture_Ink_Map **/
k3d/share/shaders/k3d_toonmap.sl:84:color temt_c2;
k3d/share/shaders/k3d_toonmap.sl:91:temt_c2=Ink_Color;
k3d/share/shaders/k3d_toonmap.sl:97:temt_c2=texture(Ink_Map,temp_ss2,temp_tt2,"swidth",swidth2,"twidth",twidth2,"samples",samples2);
k3d/share/shaders/k3d_toonmap.sl:101:temt_c2=texture(Ink_Map[channel2],temp_ss2,temp_tt2,"swidth",swidth2,"twidth",twidth2,"samples",samples2);
k3d/share/shaders/k3d_toonmap.sl:108:toonspec(vector N, V; float roughness)
k3d/share/shaders/k3d_toonmap.sl:111:vector H;
k3d/share/shaders/k3d_toonmap.sl:114:H = normalize(normalize(L)+V);
k3d/share/shaders/k3d_toonmap.sl:115:C += pow(N.H, 1/roughness);
k3d/share/shaders/k3d_toonmap.sl:117:return C;
k3d/share/shaders/k3d_toonmap.sl:120:float cos_here;
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:125:color toon_color, layer_color;
k3d/share/shaders/k3d_toonmap.sl:126:color toon_opac, layer_opac;
k3d/share/shaders/k3d_toonmap.sl:128:Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_toonmap.sl:129:normI = normalize(I);
k3d/share/shaders/k3d_toonmap.sl:131:/* background layer (layer 0) */
k3d/share/shaders/k3d_toonmap.sl:132:toon_color = color (0, 0, 0);
k3d/share/shaders/k3d_toonmap.sl:135:/* toon paint (layer 1) */
k3d/share/shaders/k3d_toonmap.sl:137:/* only care about percentage illumination */
k3d/share/shaders/k3d_toonmap.sl:140:diff += normalize(L).Nf; 
k3d/share/shaders/k3d_toonmap.sl:142:/* antialias the transition */
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:145:/* specular -- transition also antialiased */ 
k3d/share/shaders/k3d_toonmap.sl:146:spec = toonspec(Nf, -normalize(I), roughness);
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:150:layer_opac = Os;
k3d/share/shaders/k3d_toonmap.sl:152:toon_color = blend(toon_color, layer_color, layer_opac);
k3d/share/shaders/k3d_toonmap.sl:153:toon_opac = union(toon_opac, layer_opac);
k3d/share/shaders/k3d_toonmap.sl:155:/* toon ink (layer 3) */
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:163:layer_color = temt_c2;
k3d/share/shaders/k3d_toonmap.sl:165:layer_color = 0;
k3d/share/shaders/k3d_toonmap.sl:167:toon_color = blend(toon_color, layer_color, layer_opac);
k3d/share/shaders/k3d_toonmap.sl:168:toon_opac = union(toon_opac, layer_opac);
k3d/share/shaders/k3d_toonmap.sl:170:color toonOi = toon_opac;
k3d/share/shaders/k3d_toonmap.sl:171:color toonCi = toon_opac * toon_color;
k3d/share/shaders/k3d_toonmap.sl:173:/** Surface main-code end **/
k3d/share/shaders/k3d_translucency.sl:4:* Shader: Double side translucency shader
k3d/share/shaders/k3d_translucency.sl:6:* Author: Xavier Matia Bernasconi - The Chimney Pot -
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:17:* Tips & Tricks: The transTx and TransTx2 values can be used,
k3d/share/shaders/k3d_translucency.sl:18:*		 when a texture is present, as scale value for the texture.
k3d/share/shaders/k3d_translucency.sl:19:*		 Don't use white on the translucency 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:24:*	 I'll really appriciate it.
k3d/share/shaders/k3d_translucency.sl:26:* Shader birthdate: 31-08-2000
k3d/share/shaders/k3d_translucency.sl:33:surface k3d_translucency(float Ka = 1;
k3d/share/shaders/k3d_translucency.sl:36:			float roughness = 0.1;
k3d/share/shaders/k3d_translucency.sl:37:			color specularcolor = 1;
k3d/share/shaders/k3d_translucency.sl:38:			color sheen = 0.25;
k3d/share/shaders/k3d_translucency.sl:39:			float blurcolorTx = 0;
k3d/share/shaders/k3d_translucency.sl:40:			string colorTx = "";
k3d/share/shaders/k3d_translucency.sl:41:			float blurcolorTx2 = 0;
k3d/share/shaders/k3d_translucency.sl:42:			string colorTx2 = "";
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:49:			string transTex = "";
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:52:			string transTex2 = "";
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:60:	/*Velvet illuminance loop variable*/
k3d/share/shaders/k3d_translucency.sl:62:	vector H;
k3d/share/shaders/k3d_translucency.sl:63:	vector ln;
k3d/share/shaders/k3d_translucency.sl:64:	color shiny;
k3d/share/shaders/k3d_translucency.sl:69:	/*XMB vector assignment*/
k3d/share/shaders/k3d_translucency.sl:71:	normal Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_translucency.sl:72:	vector V = -normalize(I);
k3d/share/shaders/k3d_translucency.sl:74:	/*Color texturing of different side*/
k3d/share/shaders/k3d_translucency.sl:76:	color Ct;
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:82:			Ct = color texture(colorTx, ss, tt, "blur", blurcolorTx) + (1-opac)*Cs;
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:88:			Ct = color texture(colorTx2, ss, tt, "blur", blurcolorTx2) + (1-opac)*Cs;
k3d/share/shaders/k3d_translucency.sl:94:	/*Translucency texturing of different side*/
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:100:			 Kt = Kt * transTx;
k3d/share/shaders/k3d_translucency.sl:101:		} else Kt = transTx;
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:106:			 Kt = Kt * transTx2;
k3d/share/shaders/k3d_translucency.sl:107:		} else Kt = transTx2;
k3d/share/shaders/k3d_translucency.sl:118:		ln = normalize(L);
k3d/share/shaders/k3d_translucency.sl:120:		shiny += pow (cosine, 1.0/roughness) / (ln.Nf) * Cl * sheen;
k3d/share/shaders/k3d_translucency.sl:122:		sine = sqrt (1.0-SQR(cosine));
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:4: * Description:
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:11: * toward the +z axis (also in shader space).  Thus, to position and
k3d/share/shaders/k3d_uberlight.sl:12: * orient the light source, you must translate and rotate the
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:17: * Basic color/brightness controls:
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:23: *       those that point in a particular direction (+z in local light
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:30: *       light coordinates) over which the light is active.  Outside
k3d/share/shaders/k3d_uberlight.sl:31: *       this range, no energy is transmitted.
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:39: *       sometimes hard to use).
k3d/share/shaders/k3d_uberlight.sl:40: *   falloffdist - the distance at which the incident energy is actually
k3d/share/shaders/k3d_uberlight.sl:41: *       equal to intensity*lightcolor.  In other words, the intensity
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:49: *       source (like the sun).
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:53: * controls:
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: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: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:74: *       value to use.  In either case, you may use larger values to
k3d/share/shaders/k3d_uberlight.sl:75: *       make the spot more bright in the center than the outskirts.
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:82: *       make a texture map that simply blocks light, just make it
k3d/share/shaders/k3d_uberlight.sl:83: *       black-and-white, but store it as an RGB texture.  For
k3d/share/shaders/k3d_uberlight.sl:84: *       simplicity, the shader assumes that the texture file will
k3d/share/shaders/k3d_uberlight.sl:85: *       have at least three channels.
k3d/share/shaders/k3d_uberlight.sl:87: * Projected noise on the light:
k3d/share/shaders/k3d_uberlight.sl:89: *       means not to use noise.  Larger values increase the blotchiness
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: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:95: *       water drops dripping down it.
k3d/share/shaders/k3d_uberlight.sl:97: * Shadow mapped shadows.  For PRMan (and perhaps other renderers),
k3d/share/shaders/k3d_uberlight.sl:98: * shadows are mainly computed by shadow maps.  Please consult the
k3d/share/shaders/k3d_uberlight.sl:99: * PRMan documentation for more information on the meanings of these
k3d/share/shaders/k3d_uberlight.sl:100: * parameters.
k3d/share/shaders/k3d_uberlight.sl:101: *   shadowmap - the name of the texture containing the shadow map.  If
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: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:114: *       were someplace else, but without changing the area
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:119: * geometry, the shader just does the intersection with the
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:125: *       that the shader should not use a blocker at all.
k3d/share/shaders/k3d_uberlight.sl:126: *   blockerwidth, blockerheight - define the dimensions of the blocker's
k3d/share/shaders/k3d_uberlight.sl:127: *       superellipse shape.
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:133: * Joint shadow controls:
k3d/share/shaders/k3d_uberlight.sl:134: *   shadowcolor - Shadows (i.e., those regions with "occlusion" as
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:137: *       this shader, shadowed regions actually just change the color
k3d/share/shaders/k3d_uberlight.sl:138: *       of the light to "shadowcolor".  If this color is set to
k3d/share/shaders/k3d_uberlight.sl:140: *       to, say (.25,.25,.25), it will make the shadowed regions lose
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:143: *       something yellowish and make the shadowcolor dark but
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:148: * Other controls:
k3d/share/shaders/k3d_uberlight.sl:149: *   nonspecular - when set to 1, this light does not create
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:162: *       1, this light will only cast specular highlights but not
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:167: *       __nonspecular.
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:172: *       make a particular light *not* cause illumination in the fog.
k3d/share/shaders/k3d_uberlight.sl:173: *       Note that the noisysmoke shader is distributed with BMRT but
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:179: * extensions to the shader.
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:184: * SIGGRAPH '98, course 11, "Advanced RenderMan: Beyond the Companion"
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:187: * original attribution and all comments.
k3d/share/shaders/k3d_uberlight.sl:189: * This shader was tested using Pixar's PhotoRealistic RenderMan 3.7
k3d/share/shaders/k3d_uberlight.sl:190: * and the Blue Moon Rendering Tools (BMRT) release 2.3.6.  I have
k3d/share/shaders/k3d_uberlight.sl:191: * tried to avoid Shading Language constructs which wouldn't work on
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:199: * Author: coded by Larry Gritz, 1998
k3d/share/shaders/k3d_uberlight.sl:200: *         based on paper by Ronen Barzel, 1997
k3d/share/shaders/k3d_uberlight.sl:202: * Contacts:  {lg|ronen}@pixar.com
k3d/share/shaders/k3d_uberlight.sl:210: * PRMan together.
k3d/share/shaders/k3d_uberlight.sl:212://#include "k3d_rayserver.h"
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:221: * Return value:
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:235:    {				/* avoid degenerate case */
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:239:	  result = 1 - (1 - smoothstep(a, A, x)) * (1 - smoothstep(b, B, y));
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:246:	    return x * 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:250:	  result = smoothstep(q, r, 1);
k3d/share/shaders/k3d_uberlight.sl:254:	  /* Harder, rounded corner case */
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:258:	  result = smoothstep(q, r, 1);
k3d/share/shaders/k3d_uberlight.sl:261:  return result;
k3d/share/shaders/k3d_uberlight.sl:268:/* Volumetric light shaping
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:273: * Return value:
k3d/share/shaders/k3d_uberlight.sl:274: *   - attenuation factor based on the falloff and shaping
k3d/share/shaders/k3d_uberlight.sl:277:		       string lighttype;	/* what kind of light */
k3d/share/shaders/k3d_uberlight.sl:278:		       vector axis;	/* light axis */
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: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:301:      /* For omni or area lights, use distance from the light */
k3d/share/shaders/k3d_uberlight.sl:304:  atten *= smoothstep(znear - nearedge, znear, Pz);
k3d/share/shaders/k3d_uberlight.sl:305:  atten *= 1 - smoothstep(zfar, zfar + faredge, Pz);
k3d/share/shaders/k3d_uberlight.sl:322:  /* Clip to superellipse */
k3d/share/shaders/k3d_uberlight.sl:323:  if(lighttype != "omni" && beamdistribution > 0)
k3d/share/shaders/k3d_uberlight.sl:324:    atten *= pow(zcomp(normalize(vector PL)), beamdistribution);
k3d/share/shaders/k3d_uberlight.sl:328:	1 - clipSuperellipse(PL / Pz - point(shearx, sheary, 0), width,
k3d/share/shaders/k3d_uberlight.sl:330:			     roundness);
k3d/share/shaders/k3d_uberlight.sl:332:  return atten;
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:340: * gets through.
k3d/share/shaders/k3d_uberlight.sl:342:float BlockerContribution(point P1, P2;
k3d/share/shaders/k3d_uberlight.sl:343:			  string blockercoords;
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: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:356:      vector Vlight = (Pb1 - Pb2);
k3d/share/shaders/k3d_uberlight.sl:359:	clipSuperellipse(Pplane, blockerwidth, blockerheight,
k3d/share/shaders/k3d_uberlight.sl:360:			 blockerwidth + blockerwedge,
k3d/share/shaders/k3d_uberlight.sl:361:			 blockerheight + blockerhedge, blockerround);
k3d/share/shaders/k3d_uberlight.sl:363:  return unoccluded;
k3d/share/shaders/k3d_uberlight.sl:369:light k3d_uberlight(
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:372:		     color lightcolor = color(1, 1, 1);
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: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:381:		     float roundness = 1;
k3d/share/shaders/k3d_uberlight.sl:382:		     float beamdistribution = 0;
k3d/share/shaders/k3d_uberlight.sl:383:		     /* Cookie or slide to control light cross-sectional color */
k3d/share/shaders/k3d_uberlight.sl:384:		     string slidename = "";
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:389:		     string shadowmap = "";
k3d/share/shaders/k3d_uberlight.sl:390:		     float shadowblur = 0.01, shadowbias = .01, shadownsamps =
k3d/share/shaders/k3d_uberlight.sl:392:		     color shadowcolor = 0;
k3d/share/shaders/k3d_uberlight.sl:393:		     /* Ray traced shadows */
k3d/share/shaders/k3d_uberlight.sl:394:		     float raytraceshadow = 0, nshadowrays = 1;
k3d/share/shaders/k3d_uberlight.sl:395:		     vector shadowcheat = vector "shader"(0, 0, 0);
k3d/share/shaders/k3d_uberlight.sl:396:		     /* Fake blocker shadow */
k3d/share/shaders/k3d_uberlight.sl:397:		     string blockercoords = "";
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:400:		     .1, blockerround = 1;
k3d/share/shaders/k3d_uberlight.sl:401:		     /* Miscellaneous controls */
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:407:  /* For simplicity, assume that the light is at the origin of shader
k3d/share/shaders/k3d_uberlight.sl:408:   * space and aimed in the +z direction.  So to move or orient the
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:413:   * shader coordinates.
k3d/share/shaders/k3d_uberlight.sl:415:  point PL = transform("shader", Ps);
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:422:  vector axis = normalize(N);
k3d/share/shaders/k3d_uberlight.sl:424:  /* For PRMan, we've gotta do it the hard way */
k3d/share/shaders/k3d_uberlight.sl:425:  point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_uberlight.sl:426:  vector axis = normalize(vector "shader"(0, 0, 1));
k3d/share/shaders/k3d_uberlight.sl:428:  uniform float angle;
k3d/share/shaders/k3d_uberlight.sl:431:      uniform float maxradius = 1.4142136 * max(height + hedge + abs(sheary),
k3d/share/shaders/k3d_uberlight.sl:432:						width + wedge + abs(shearx));
k3d/share/shaders/k3d_uberlight.sl:433:      angle = atan(maxradius);
k3d/share/shaders/k3d_uberlight.sl:435:  else if(lighttype == "arealight")
k3d/share/shaders/k3d_uberlight.sl:436:    {				/* BMRT area light */
k3d/share/shaders/k3d_uberlight.sl:440:    {				/* Omnidirectional light */
k3d/share/shaders/k3d_uberlight.sl:443:  __nonspecular = nonspecular;
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:448:     * blockers and whatnot.  Start with no attenuation (i.e., a 
k3d/share/shaders/k3d_uberlight.sl:452:    color lcol = lightcolor;
k3d/share/shaders/k3d_uberlight.sl:454:    /* Basic light shaping - the volumetric shaping is all encapsulated
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:460:		       sheary, width, height, hedge, wedge, roundness,
k3d/share/shaders/k3d_uberlight.sl:461:		       beamdistribution);
k3d/share/shaders/k3d_uberlight.sl:463:    /* Project a slide or use a cookie */
k3d/share/shaders/k3d_uberlight.sl:470:	lcol *= color texture(slidename, xslide, yslide);
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:479:#pragma nolint
k3d/share/shaders/k3d_uberlight.sl:480:	    float n = noise(noisefreq * (PL + noiseoffset) * point(1, 1, 0));
k3d/share/shaders/k3d_uberlight.sl:489:	    1 - shadow(shadowmap, Ps, "blur", shadowblur, "samples",
k3d/share/shaders/k3d_uberlight.sl:491:	point shadoworigin;
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:495:	  shadoworigin = point "shader"(xcomp(PL), ycomp(PL), cuton);
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:498:	 * we're in BMRT and the user wanted a shadow map.
k3d/share/shaders/k3d_uberlight.sl:500:	if(raytraceshadow != 0)
k3d/share/shaders/k3d_uberlight.sl:502:	    color vis = 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:505:	      vis += visibility(Ps, shadoworigin + shadowcheat);
k3d/share/shaders/k3d_uberlight.sl:506:	    vis /= nshadowrays;
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:514:	      BlockerContribution(Ps, shadoworigin, blockercoords,
k3d/share/shaders/k3d_uberlight.sl:515:				  blockerwidth, blockerheight, blockerwedge,
k3d/share/shaders/k3d_uberlight.sl:516:				  blockerhedge, blockerround);
k3d/share/shaders/k3d_uberlight.sl:518:	lcol = mix(shadowcolor, lcol, unoccluded);
k3d/share/shaders/k3d_uberlight.sl:519:	__nonspecular = 1 - unoccluded * (1 - __nonspecular);
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: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:14:color abSpecularColor=color(1.00,1.00,1.00); 
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: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:23:color abIncandescence=color(0.00,0.00,0.00); 
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: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:34:float abUseNormals=0; 
k3d/share/shaders/k3d_urbermap.sl:35:point STMatrix0=point(1,0,0); 
k3d/share/shaders/k3d_urbermap.sl:36:point STMatrix1=point(0,1,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:41:vector V, D;
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:54:"swidth", abColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:55:"twidth", abColorMapBlur );
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:59:"swidth", abColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:60:"twidth", abColorMapBlur );
k3d/share/shaders/k3d_urbermap.sl:62:Csurf = Csurf / Copac;
k3d/share/shaders/k3d_urbermap.sl:66:Copac = color(1, 1, 1);
k3d/share/shaders/k3d_urbermap.sl:71:Csurf = Cs;
k3d/share/shaders/k3d_urbermap.sl:72:Copac = color(1);
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:88:if(abSpecularMap != "")
k3d/share/shaders/k3d_urbermap.sl:90:spec = abSpecular * float texture(abSpecularMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:91:"swidth", abSpecularMapBlur,
k3d/share/shaders/k3d_urbermap.sl:92:"twidth", abSpecularMapBlur );
k3d/share/shaders/k3d_urbermap.sl:96:spec = abSpecular;
k3d/share/shaders/k3d_urbermap.sl:100:if(abSpecularColorMap != "")
k3d/share/shaders/k3d_urbermap.sl:102:Cspec = abSpecularColor * color texture(abSpecularColorMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:103:"swidth", abSpecularColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:104:"twidth", abSpecularColorMapBlur );
k3d/share/shaders/k3d_urbermap.sl:108:Cspec = abSpecularColor;
k3d/share/shaders/k3d_urbermap.sl:114:roughness = abRoughness * float texture(abRoughnessMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:115:"swidth", abRoughnessMapBlur,
k3d/share/shaders/k3d_urbermap.sl:116:"twidth", abRoughnessMapBlur );
k3d/share/shaders/k3d_urbermap.sl:120:roughness = abRoughness;
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:128:Copac = Copac * color texture(abTransparencyMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:129:"swidth", abTransparencyMapBlur,
k3d/share/shaders/k3d_urbermap.sl:130:"twidth", abTransparencyMapBlur );
k3d/share/shaders/k3d_urbermap.sl:134:Copac = Copac * (color(1) - color texture(abTransparencyMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:135:"swidth", abTransparencyMapBlur,
k3d/share/shaders/k3d_urbermap.sl:136:"twidth", abTransparencyMapBlur ));
k3d/share/shaders/k3d_urbermap.sl:143:Cincand = abIncandescence * color texture(abIncandescenseMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:144:"swidth", abIncandescenseMapBlur,
k3d/share/shaders/k3d_urbermap.sl:145:"twidth", abIncandescenseMapBlur );
k3d/share/shaders/k3d_urbermap.sl:156:bmp = abBumpScale * float texture( abBumpMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:157:"swidth", abBumpMapBlur,
k3d/share/shaders/k3d_urbermap.sl:158:"twidth", abBumpMapBlur );
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: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:166:normal deltaN = normalize(N) - normalize(Ng);
k3d/share/shaders/k3d_urbermap.sl:167:Nf = normalize(Nf) + deltaN;
k3d/share/shaders/k3d_urbermap.sl:179:Nf = faceforward( normalize(Nf), I );
k3d/share/shaders/k3d_urbermap.sl:180:V = -normalize(I);
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:189:D = vector(-zcomp(D), xcomp(D), ycomp(D));
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:5: *   Makes solid marble texture with strong veins.  The "veincolor" parameter
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:10: *   Ka, Kd, Ks, roughness, specularcolor - same as plastic
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:14: *   warping - controls how much turbulent warping there will be
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:19: * AUTHOR: Larry Gritz, the George Washington University
k3d/share/shaders/k3d_veinedmarble.sl:20: *         email: gritz@seas.gwu.edu
k3d/share/shaders/k3d_veinedmarble.sl:24: * last modified  29 Jun 1994 by Larry Gritz
k3d/share/shaders/k3d_veinedmarble.sl:28:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_veinedmarble.sl:29:#include "k3d_material.h"
k3d/share/shaders/k3d_veinedmarble.sl:32:surface k3d_veinedmarble(float Ka = .5;
k3d/share/shaders/k3d_veinedmarble.sl:35:			 float roughness = .075;
k3d/share/shaders/k3d_veinedmarble.sl:36:			 color specularcolor = 1;
k3d/share/shaders/k3d_veinedmarble.sl:37:			 float veinfreq = 1;
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:41:			 color veincolor = color(.6, .5, .1);
k3d/share/shaders/k3d_veinedmarble.sl:42:			 float sharpness = 8;
k3d/share/shaders/k3d_veinedmarble.sl:45:  color Ct;
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:55:  /* Now calculate the veining function for the lookup area */
k3d/share/shaders/k3d_veinedmarble.sl:56:  turbsum = 0;
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:63:      turbsum += (1 - turbsum) * turb;
k3d/share/shaders/k3d_veinedmarble.sl:64:      freq *= 3;
k3d/share/shaders/k3d_veinedmarble.sl:68:  Ct = mix(Cs, veincolor, turbsum);
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:8: *   This phenomenological model contains three compnents:
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:22: * AUTHOR: written by Stephen H. Westin, Ford Motor Company
k3d/share/shaders/k3d_velvet.sl:25: * 	2001.02.01	westin@SpamSucks_graphics.cornell.edu
k3d/share/shaders/k3d_velvet.sl:26: *			Fixed retroreflection lobe (sign error); added
k3d/share/shaders/k3d_velvet.sl:27: *			"backscatter" parameter to control it; added
k3d/share/shaders/k3d_velvet.sl:28: *			"edginess" parameter to control horizon scatter;
k3d/share/shaders/k3d_velvet.sl:31: * prev modified  28 January 1997 S. H. Westin
k3d/share/shaders/k3d_velvet.sl:36:surface
k3d/share/shaders/k3d_velvet.sl:40:	    float backscatter = 0.1,
k3d/share/shaders/k3d_velvet.sl:42:        color sheen = .25;
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:47:  vector V;                      /* Normalized eye vector */
k3d/share/shaders/k3d_velvet.sl:48:  vector H;                      /* Bisector vector for Phong/Blinn */
k3d/share/shaders/k3d_velvet.sl:49:  vector Ln;                     /* Normalized vector to light */
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:54:  V = -normalize (I);
k3d/share/shaders/k3d_velvet.sl:57:  illuminance ( P, Nf, 1.57079632679489661923 /* Hemisphere */ ) {
k3d/share/shaders/k3d_velvet.sl:58:    Ln = normalize ( L );
k3d/share/shaders/k3d_velvet.sl:59:    /* Retroreflective lobe */
k3d/share/shaders/k3d_velvet.sl:61:    shiny += pow ( cosine, 1.0/roughness ) * backscatter
k3d/share/shaders/k3d_velvet.sl:63:    /* Horizon scattering */
k3d/share/shaders/k3d_velvet.sl:65:    sine = sqrt (1.0-SQR(cosine));
k3d/share/shaders/k3d_velvet.sl:70:  /* Add in diffuse color */
k3d/share/shaders/k3d_venus.sl:2: * venus.sl - surface for a very cloudy planet like Venus.
k3d/share/shaders/k3d_venus.sl:6: *      When put on a sphere, sets the color to look like a densely
k3d/share/shaders/k3d_venus.sl:7: *   clouded planet, very much like the real Venus appears in UV.
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: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:24: *    represented by a unit sphere.  The texture space and/or parameters
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:29: * AUTHOR: Ken Musgrave.
k3d/share/shaders/k3d_venus.sl:30: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_venus.sl:34: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_venus.sl:35: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_venus.sl:36: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_venus.sl:40: *    ???? - Venus texture developed by F. Ken Musgrave.
k3d/share/shaders/k3d_venus.sl:41: *    Feb 1994 - Conversion to Shading Language by L. Gritz
k3d/share/shaders/k3d_venus.sl:43: * last modified 1 March 1994 by lg
k3d/share/shaders/k3d_venus.sl:54:surface k3d_venus(float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_venus.sl:59:  point Ptexture;		/* the shade point in texture space */
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: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:71:  /* Calculate Coriolis twist, yielding point PP */
k3d/share/shaders/k3d_venus.sl:72:  PtN = normalize(Ptexture);
k3d/share/shaders/k3d_venus.sl:73:  rsq = xcomp(PtN) * xcomp(PtN) + ycomp(PtN) * ycomp(PtN);
k3d/share/shaders/k3d_venus.sl:74:  angle = twist * TWOPI * rsq;
k3d/share/shaders/k3d_venus.sl:78:    point(xcomp(Ptexture) * cosine - ycomp(Ptexture) * sine,
k3d/share/shaders/k3d_venus.sl:79:	  xcomp(Ptexture) * sine + ycomp(Ptexture) * cosine, zcomp(Ptexture));
k3d/share/shaders/k3d_venus.sl:85:  for(i = 0; i < octaves; i += 1)
k3d/share/shaders/k3d_venus.sl:94:  /* Shade like matte, but with color scaled by cloud color */
k3d/share/shaders/k3d_venus.sl:98:			 Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_venus2.sl:1:/* I renamed the shader to MBVenus.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_venus2.sl:4: * venus.sl - surface for a very cloudy planet like Venus.
k3d/share/shaders/k3d_venus2.sl:8: *      When put on a sphere, sets the color to look like a densely
k3d/share/shaders/k3d_venus2.sl:9: *   clouded planet, very much like the real Venus appears in UV.
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: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:25: * AUTHOR: Ken Musgrave.
k3d/share/shaders/k3d_venus2.sl:26: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_venus2.sl:27: *    Planet radius param added by Mark Beckwith.
k3d/share/shaders/k3d_venus2.sl:30: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_venus2.sl:31: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_venus2.sl:32: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_venus2.sl:36: *    ???? - Venus texture developed by F. Ken Musgrave.
k3d/share/shaders/k3d_venus2.sl:37: *    Feb 1994 - Conversion to Shading Language by L. 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:39: *        (mark@SpamSucks_intrig.com)
k3d/share/shaders/k3d_venus2.sl:52:surface
k3d/share/shaders/k3d_venus2.sl:59:       float radius = 1)
k3d/share/shaders/k3d_venus2.sl:61:  point Ptexture;           /* the shade point in texture space */
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: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:73:  /* Calculate Coriolis twist, yielding point PP */
k3d/share/shaders/k3d_venus2.sl:74:  PtN = normalize (Ptexture);
k3d/share/shaders/k3d_venus2.sl:75:  rsq = xcomp(PtN)*xcomp(PtN) + ycomp(PtN)*ycomp(PtN);
k3d/share/shaders/k3d_venus2.sl:76:  angle = twist * TWOPI * rsq;
k3d/share/shaders/k3d_venus2.sl:79:  PP = point (xcomp(Ptexture)*cosine - ycomp(Ptexture)*sine,
k3d/share/shaders/k3d_venus2.sl:80:	      xcomp(Ptexture)*sine + ycomp(Ptexture)*cosine,
k3d/share/shaders/k3d_venus2.sl:81:	      zcomp(Ptexture));
k3d/share/shaders/k3d_venus2.sl:85:  for (i = 0;  i < octaves;  i += 1) {
k3d/share/shaders/k3d_venus2.sl:93:  /* Shade like matte, but with color scaled by cloud color */
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:3:   This shader raytraces a box that is one unit in size,
k3d/share/shaders/k3d_volcube.sl:4:   and then ray marches through the volume
k3d/share/shaders/k3d_volcube.sl:6:   StepJitter          - 0-1 jitter the sample position.
k3d/share/shaders/k3d_volcube.sl:7:   Density             - volume thickes per unit.
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:11:   SurfNormalDepth     - the mixing depth from surface
k3d/share/shaders/k3d_volcube.sl:12:                         normal to volume normal.
k3d/share/shaders/k3d_volcube.sl:13:   Additive            - if 1 add samples, if 0 over samples . 
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:30:	      string refractSpace;)
k3d/share/shaders/k3d_volcube.sl:32:    extern point P;
k3d/share/shaders/k3d_volcube.sl:33:    extern vector I;
k3d/share/shaders/k3d_volcube.sl:34:    extern normal N;
k3d/share/shaders/k3d_volcube.sl:35:    vector Rd,Ro;
k3d/share/shaders/k3d_volcube.sl:37:    vector Pn;
k3d/share/shaders/k3d_volcube.sl:40:    vector IN;
k3d/share/shaders/k3d_volcube.sl:41:    normal NN;
k3d/share/shaders/k3d_volcube.sl:43:    IN = normalize(I);
k3d/share/shaders/k3d_volcube.sl:44:    NN = normalize(N);
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:96:    return Ri;
k3d/share/shaders/k3d_volcube.sl:102:/* active_volume - controls animation in the volume */
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:123:    return activeVol + (dens-2);
k3d/share/shaders/k3d_volcube.sl:128:/* normal calculation inside the volume */
k3d/share/shaders/k3d_volcube.sl:129:normal calcGradeNorm(point Pos; float vol_mult, vol_offset, dens, epsilon;)
k3d/share/shaders/k3d_volcube.sl:131:    normal Nd;
k3d/share/shaders/k3d_volcube.sl:132:    Nd = normal (get_density(point (xcomp(Pos) - epsilon, ycomp(Pos),
k3d/share/shaders/k3d_volcube.sl:138:    Nd = ntransform("object","current",Nd);
k3d/share/shaders/k3d_volcube.sl:139:    return 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:149:		  vector V;
k3d/share/shaders/k3d_volcube.sl:151:		  output color diff;
k3d/share/shaders/k3d_volcube.sl:152:		  output color spec;)
k3d/share/shaders/k3d_volcube.sl:154:    extern vector L;
k3d/share/shaders/k3d_volcube.sl:155:    extern color Cl;
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:167:/* nomal mixer */
k3d/share/shaders/k3d_volcube.sl:168:normal 
k3d/share/shaders/k3d_volcube.sl:169:fnc_normalMix (normal N1; normal N2; float mixer)
k3d/share/shaders/k3d_volcube.sl:173:    normal NN1 = normalize(N1);
k3d/share/shaders/k3d_volcube.sl:174:    normal NN2 = normalize(N2);
k3d/share/shaders/k3d_volcube.sl:175:    normal result; 
k3d/share/shaders/k3d_volcube.sl:176:    N1_mag *= 1-mixer;
k3d/share/shaders/k3d_volcube.sl:177:    N2_mag *= mixer;
k3d/share/shaders/k3d_volcube.sl:178:    result = normalize(NN1 * N1_mag + NN2 * N2_mag);
k3d/share/shaders/k3d_volcube.sl:179:    return result;
k3d/share/shaders/k3d_volcube.sl:185:/* main ray marching shader  */
k3d/share/shaders/k3d_volcube.sl:186:surface
k3d/share/shaders/k3d_volcube.sl:188:	     float  StepJitter     = 0;
k3d/share/shaders/k3d_volcube.sl:194:	     float  SurfNormalDepth = .05;
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:202:    vector V  = normalize(-I);
k3d/share/shaders/k3d_volcube.sl:203:    normal Nf = normalize(N);
k3d/share/shaders/k3d_volcube.sl:205:    color  diff	= 1;
k3d/share/shaders/k3d_volcube.sl:206:    color  spec = 0;
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:213:    color  color_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:217:    color  cur_color    = 0;
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:221:    point  Pcur_obj     = inPoint_obj + jitter * step_obj;
k3d/share/shaders/k3d_volcube.sl:222:    point  Pcur        = P  + jitter * step_cur;
k3d/share/shaders/k3d_volcube.sl:229:    while(curStep < numOfSteps && density_sum < 1){
k3d/share/shaders/k3d_volcube.sl:230:	cur_density = 0;
k3d/share/shaders/k3d_volcube.sl:231:	cur_color = 0;
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:240:	if(cur_density > 0 && RunShadowPass == 0){
k3d/share/shaders/k3d_volcube.sl:241:	    cur_color = cur_density;
k3d/share/shaders/k3d_volcube.sl:242:	    cur_color = 1;
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:246:						  cur_density,Epsilon);
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:255:	    remainder = numOfSteps - curStep;
k3d/share/shaders/k3d_volcube.sl:256:	    if(remainder < 1){
k3d/share/shaders/k3d_volcube.sl:257:		cur_density *= remainder;
k3d/share/shaders/k3d_volcube.sl:260:	    cur_density *= density;
k3d/share/shaders/k3d_volcube.sl:261:	    cur_color *= clamp(cur_density,0,1);
k3d/share/shaders/k3d_volcube.sl:266:		density_sum += max(0,cur_density);
k3d/share/shaders/k3d_volcube.sl:267:		color_sum += clamp(cur_color,color 0, color 1);
k3d/share/shaders/k3d_volcube.sl:270:                /* Do Over Instead of Add */
k3d/share/shaders/k3d_volcube.sl:271:		cur_color = clamp(cur_color,color 0,color 1);
k3d/share/shaders/k3d_volcube.sl:272:		cur_density = clamp(cur_density,0,1);
k3d/share/shaders/k3d_volcube.sl:273:		color_sum = ( cur_color) * (1-density_sum) + color_sum;
k3d/share/shaders/k3d_volcube.sl:274:		density_sum = (cur_density) * (1-density_sum) + density_sum;
k3d/share/shaders/k3d_volcube.sl:280:		shad_sum += max(0,cur_density);
k3d/share/shaders/k3d_volcube.sl:283:		cur_density = clamp(cur_density,0,1);
k3d/share/shaders/k3d_volcube.sl:284:		shad_sum = (cur_density) * (1-shad_sum) + shad_sum;
k3d/share/shaders/k3d_volcube.sl:288:		color_sum = 1;
k3d/share/shaders/k3d_volcube.sl:290:	    P = Pcur;           
k3d/share/shaders/k3d_volcube.sl:291:            /* Displace Point To Current Sample */
k3d/share/shaders/k3d_volcube.sl:295:	curStep += 1;
k3d/share/shaders/k3d_volcube.sl:296:	Pcur_obj += step_obj;
k3d/share/shaders/k3d_volcube.sl:297:	Pcur += step_cur;
k3d/share/shaders/k3d_volcube.sl:298:	cur_depth += StepSize;
k3d/share/shaders/k3d_volcube.sl:301:    Ci = color_sum;
k3d/share/shaders/k3d_wallpaper.sl:1:/* I took wave's lead and renamed wallpaper to DPWallpaper.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_wallpaper.sl:4: * wallpaper.sl
k3d/share/shaders/k3d_wallpaper.sl:6: * AUTHOR: Darwyn Peachy
k3d/share/shaders/k3d_wallpaper.sl:9: *    _Texturing and Modeling: A Procedural Approach_, by David S. Ebert, ed.,
k3d/share/shaders/k3d_wallpaper.sl:10: *    F. Kenton Musgrave, Darwyn Peachey, Ken Perlin, and Steven Worley.
k3d/share/shaders/k3d_wallpaper.sl:11: *    Academic Press, 1994.  ISBN 0-12-228760-6.
k3d/share/shaders/k3d_wallpaper.sl:18:surface
k3d/share/shaders/k3d_wallpaper.sl:19:k3d_wallpaper(
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:26:    color Ct;
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: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:36:        (cos(starangle/2),sin(starangle/2),0);
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:46:	    scell = scellctr + i;
k3d/share/shaders/k3d_wallpaper.sl:47:	    tcell = tcellctr + j;
k3d/share/shaders/k3d_wallpaper.sl:49:                sctr = CELLSIZE * (scell + 0.5
k3d/share/shaders/k3d_wallpaper.sl:51:                tctr = CELLSIZE * (tcell + 0.5
k3d/share/shaders/k3d_wallpaper.sl:53:                ss = s - sctr;
k3d/share/shaders/k3d_wallpaper.sl:54:                tt = t - tctr;
k3d/share/shaders/k3d_wallpaper.sl:57:                r = sqrt(ss*ss + tt*tt);
k3d/share/shaders/k3d_wallpaper.sl:58:                a = mod(angle, starangle)/starangle;
k3d/share/shaders/k3d_wallpaper.sl:62:                d1 = r*(cos(a), sin(a),0) - p0;
k3d/share/shaders/k3d_wallpaper.sl:67:    Ct = mix(Cs, starcolor, step(0.5,in_out));
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_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:11: *   Ka, Kd, Ks, roughness	the usual
k3d/share/shaders/k3d_wallpaper_2stripe.sl:12: *   specularcolor
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:20: * AUTHOR: written by Larry Gritz (email: lg@bmrt.org)
k3d/share/shaders/k3d_wallpaper_2stripe.sl:26:#include "k3d_patterns.h"
k3d/share/shaders/k3d_wallpaper_2stripe.sl:27:#include "k3d_material.h"
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:31:			      color stripecolor = color "rgb"(1, 0.5, 0.5);
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:43:  color Ct = mix(Cs, stripecolor, stripe);
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:2:// Copyright (c) 1995-2004, Timothy M. Shead
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:13:// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
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:21:		\author Tim Shead (tshead@k-3d.com)
k3d/share/shaders/k3d_warningstripes.sl:24:/// Filtering code courtesy of the Advanced RenderMan book ... where else?
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: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:42:	return (integral(x1) - integral(x0)) / w;
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:47:	color StripeColor = color(0, 0, 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:52:	color Ct = mix(Cs, StripeColor, stripe_position);
k3d/share/shaders/k3d_warningstripes.sl:54:	vector Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_water.sl:2: * water.sl -- water surface, using ray tracing.

k3d/share/shaders/k3d_water.sl:3: * This was originally shiny.sl, but I change it to make it transparant.  The interesting part colors that

k3d/share/shaders/k3d_water.sl:4: * are not blue will pass thru the water.

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:7: *        water like look.

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

k3d/share/shaders/k3d_water.sl:13: *   Makes a smoothly polished metal, using ray tracing to calculate

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

k3d/share/shaders/k3d_water.sl:17: *    Ka, Kd, Ks, roughness, specularcolor - The usual meaning

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:24: *      Aug 1991 -- written by lg in C

k3d/share/shaders/k3d_water.sl:25: *      25 Jan 1994 -- recoded by lg in correct shading language.

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

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:38:	color specularcolor = 1;

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:47:    vector IN;               /* normalized incident 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:51:    vector R, Rdir;          /* Direction to cast the ray */

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:56:    IN = normalize (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:64:	    /* Construct orthogonal components to Rdir */

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

k3d/share/shaders/k3d_water.sl:66:					        xcomp(Rdir) - zcomp(Rdir),

k3d/share/shaders/k3d_water.sl:67:					        ycomp(Rdir) - xcomp(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:72:		    R = Rdir +

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:75:		    ev += trace (P, normalize(R));

k3d/share/shaders/k3d_water.sl:78:	    ev *= Kr / (samples*samples);

k3d/share/shaders/k3d_water.sl:80:	    /* No blur, just do a simple trace */

k3d/share/shaders/k3d_water.sl:81:	    ev = Kr * trace (P, Rdir);

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:88:    /* I added some current.  Note, it doesn't apppear horizontally. */

k3d/share/shaders/k3d_water.sl:89:    color current = (1,1,1);  

k3d/share/shaders/k3d_water.sl:91:    color layer_color = (1,1,1);

k3d/share/shaders/k3d_water.sl:92:    color layer_opac = 1;

k3d/share/shaders/k3d_water.sl:94:    point center;

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

k3d/share/shaders/k3d_water.sl:98:    d = distance(center, (s, t, 0));

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_water.sl:104:    /* This gives the water a somewhat transparant look. 

k3d/share/shaders/k3d_water.sl:105:     *   Note: This does works with radiosity.

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

k3d/share/shaders/k3d_watercolor.sl:3: *	provides a built-in Fresnel quantity calculator, which provides

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:10:surface k3d_watercolor(

k3d/share/shaders/k3d_watercolor.sl:11:	color upwelling = color(0, 0.2, 0.3);

k3d/share/shaders/k3d_watercolor.sl:12:	color sky = color(0.69,0.84,1);

k3d/share/shaders/k3d_watercolor.sl:13:	color air = color(0.1,0.1,0.1);

k3d/share/shaders/k3d_watercolor.sl:16:	string envmap = "";

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

k3d/share/shaders/k3d_watercolor.sl:20:	vector nI = normalize(I);

k3d/share/shaders/k3d_watercolor.sl:21:	vector nN = normalize(Ng);

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:35:		reflectivity = 0.5 * ( fs*fs + ts*ts );

k3d/share/shaders/k3d_watercolor.sl:37:	vector dPE = P-E;

k3d/share/shaders/k3d_watercolor.sl:43:		sky = color environment(envmap, nN);

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:16:	point	norm;

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

k3d/share/shaders/k3d_waterdisplacement.sl:19:	norm = normalize (N);

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

k3d/share/shaders/k3d_waterdisplacement.sl:23:		hump = texture(bumpmap, s, t);	

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

k3d/share/shaders/k3d_waterdisplacement.sl:26:	P = P - norm * hump * Km;

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

k3d/share/shaders/k3d_waterdisplacement.sl:29:	N = calculatenormal (P);

k3d/share/shaders/k3d_waterlight.sl:1:/** k3d_waterlight
k3d/share/shaders/k3d_waterlight.sl:3:Copyright (c) 1995-2004, Timothy M. Shead
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:10:light k3d_waterlight(
k3d/share/shaders/k3d_waterlight.sl:13:	float frequency = 1;
k3d/share/shaders/k3d_waterlight.sl:15:	color lightcolor = 1;
k3d/share/shaders/k3d_waterlight.sl:16:	string shadowname="";
k3d/share/shaders/k3d_waterlight.sl:18:	float  blur=.01;
k3d/share/shaders/k3d_waterlight.sl:22:	solar(vector "shader" (0, -1, 0), 0)
k3d/share/shaders/k3d_waterlight.sl:24:			Cl = mix(minimum_intensity, maximum_intensity, float noise(frequency * Ps)) * lightcolor;
k3d/share/shaders/k3d_waterlight.sl:29:			Cl *= 1 - shadow(shadowname, Ps, "samples", samples, "blur", blur, "bias", bias);
k3d/share/shaders/k3d_windowlight.sl:2: * windowlight.sl - make a window light (with crossbars)
k3d/share/shaders/k3d_windowlight.sl:4: * Description::
k3d/share/shaders/k3d_windowlight.sl:5: *   Simulates light coming through a window.  The light doesn't
k3d/share/shaders/k3d_windowlight.sl:6: *   diverge or falloff.
k3d/share/shaders/k3d_windowlight.sl:8: * Parameters:
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: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:26:#include "k3d_patterns.h"
k3d/share/shaders/k3d_windowlight.sl:29:		      color lightcolor = color(1, 0.9, 0.6);
k3d/share/shaders/k3d_windowlight.sl:30:		      color darkcolor = color(.05, 0.15, 0.1);
k3d/share/shaders/k3d_windowlight.sl:31:		      point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_windowlight.sl:32:		      point to = point "shader"(0, 1, 0);
k3d/share/shaders/k3d_windowlight.sl:33:		      point center = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_windowlight.sl:34:		      vector up = vector "shader"(0, 0, 1);
k3d/share/shaders/k3d_windowlight.sl:35:		      vector in = vector "shader"(0, 1, 0);
k3d/share/shaders/k3d_windowlight.sl:38:		      float framewidth = .1, frameheight = .1;
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:48:  path = normalize(from - to);
k3d/share/shaders/k3d_windowlight.sl:49:  inv = normalize(in);
k3d/share/shaders/k3d_windowlight.sl:50:  right = (up) ^ inv;
k3d/share/shaders/k3d_windowlight.sl:51:  upv = normalize(inv ^ right);
k3d/share/shaders/k3d_windowlight.sl:52:  right = upv ^ inv;
k3d/share/shaders/k3d_windowlight.sl:54:  /* d is the depth "into" the room perpendicular to the pane plane */
k3d/share/shaders/k3d_windowlight.sl:55:  d = inv.(Ps - center);
k3d/share/shaders/k3d_windowlight.sl:60:    offset = (PL - center).upv + paneheight * (vpanes / 2);
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:69:      yfract = 0;
k3d/share/shaders/k3d_windowlight.sl:71:    offset = (PL - center).right + panewidth * (hpanes / 2);
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:80:      xfract = 0;
k3d/share/shaders/k3d_windowlight.sl:81:    Cl = intensity * mix(darkcolor, lightcolor, yfract * xfract);
k3d/share/shaders/k3d_windywave.sl:4:			   float windfreq = 0.5; float windamp = 1;
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:16:  turb = 0;
k3d/share/shaders/k3d_windywave.sl:19:  for(i = 0; i < 4; i += 1)
k3d/share/shaders/k3d_windywave.sl:21:      turb += abs(a * snoise(PP));
k3d/share/shaders/k3d_windywave.sl:25:  wind = minwind + windamp * turb;
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:5: *   Makes wood solid texture.
k3d/share/shaders/k3d_wood2.sl:8: *   Ka, Kd, Ks, specular, roughness - work just like the plastic shader
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:14: * AUTHOR: written by Larry Gritz (lg@bmrt.org)
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:23:		  color specularcolor = 1;
k3d/share/shaders/k3d_wood2.sl:24:		  float ringscale = 15;
k3d/share/shaders/k3d_wood2.sl:26:		  color lightwood = color(0.69, 0.44, 0.25);
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:35:  /* Calculate in shader space */
k3d/share/shaders/k3d_wood2.sl:36:  PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_wood2.sl:38:  my_t = zcomp(PP) / ringscale;
k3d/share/shaders/k3d_wood2.sl:43:  r = ringscale * noise(PQ);
k3d/share/shaders/k3d_wood2.sl:44:  r -= floor(r);
k3d/share/shaders/k3d_wood2.sl:45:  r = 0.2 + 0.8 * smoothstep(0.2, 0.55, r) * (1 - smoothstep(0.75, 0.8, r));
k3d/share/shaders/k3d_wood2.sl:47:  /* \/--  extra line added for fine grain */
k3d/share/shaders/k3d_wood2.sl:49:  r2 = grainy * (1.3 - noise(PQ)) + (1 - grainy);
k3d/share/shaders/k3d_wood2.sl:51:  Ct = mix(lightwood, darkwood, r * r2 * r2);
k3d/share/shaders/k3d_wood2.sl:57:  Nf = faceforward(normalize(N), I);
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:3:string up="y"; 
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: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:16:float stripemin, stripemax, tt;
k3d/share/shaders/k3d_woodcut.sl:18:float tfreq = 50;
k3d/share/shaders/k3d_woodcut.sl:20:color illumcolor = 0.0;
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:32:V = -normalize(I); 
k3d/share/shaders/k3d_woodcut.sl:36:z *= ringscale;
k3d/share/shaders/k3d_woodcut.sl:41:y *= ringscale;
k3d/share/shaders/k3d_woodcut.sl:45:illumcolor = (Ka*ambient() + Kd*diffuse(Nf) + Ks*specular(Nf,V,roughness));
k3d/share/shaders/k3d_woodcut.sl:46:illumination = max(max(comp(illumcolor, 0), comp(illumcolor, 1)), comp(illumcolor, 2));
k3d/share/shaders/k3d_woodcut.sl:50:for (i = 0; i < 6.0; i += 1.0) {
k3d/share/shaders/k3d_woodcut.sl:56:illumination = (illumination * contrast) + (1.0 - contrast)/2.0 + 
k3d/share/shaders/k3d_woodcut.sl:57:(brightness - 1.0) + n*random;
k3d/share/shaders/k3d_woodcut.sl:60:surface_color = color (0.0, 0.0, 0.0);
k3d/share/shaders/k3d_woodcut.sl:61:layer_color = 0.0; 
k3d/share/shaders/k3d_woodcut.sl:64:surface_color = color (1.0, 1.0, 1.0);
k3d/share/shaders/k3d_woodcut.sl:65:layer_color = 1.0;
k3d/share/shaders/k3d_woodcut.sl:68:surface_color = color (0.0, 0.0, 0.0);
k3d/share/shaders/k3d_woodcut.sl:69:layer_color = 1.0;
k3d/share/shaders/k3d_woodcut.sl:71:surface_opac = 1.0;
k3d/share/shaders/k3d_woodcut.sl:74:stripemin = 0.5 - smoothstep(0.0, 1.0, illumination)/2.0;
k3d/share/shaders/k3d_woodcut.sl:75:stripemax = 0.5 + smoothstep(0.0, 1.0, illumination)/2.0;
k3d/share/shaders/k3d_woodcut.sl:76:float val = pulse(stripemin, stripemax, fuzz, tt);
k3d/share/shaders/k3d_woodcut.sl:77:layer_opac = color val;
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:80:Cr = spline (color_val,
k3d/share/shaders/k3d_woodcut.sl:81:color (0.0, 0.0, 0.0),
k3d/share/shaders/k3d_woodcut.sl:82:color (0.1, 0.05, 0.0),
k3d/share/shaders/k3d_woodcut.sl:83:color (0.8, 0.6, 0.4),
k3d/share/shaders/k3d_woodcut.sl:84:color (1.0, 1.0, 0.8),
k3d/share/shaders/k3d_woodcut.sl:85:color (1.0, 1.0, 1.0),
k3d/share/shaders/k3d_woodcut.sl:86:color (1.0, 1.0, 1.0));
k3d/share/shaders/k3d_woodcut.sl:87: float spacescale = length(vtransform("shader", normalize(N)));
k3d/share/shaders/k3d_woodcut.sl:88: vector Ndisp = normalize(N) * (0 / max(spacescale,1e-6));
k3d/share/shaders/k3d_woodcut.sl:90: N = normalize (calculatenormal (P + (1-0)*Ndisp)); 
k3d/share/shaders/k3d_woodcut.sl:91: Ci = surface_opac * Cr; Oi = 1; }
