k3d/share/shaders/k3d_altitude_fog.sl:1:volume k3d_altitude_fog(
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_ambientlight.sl:1:/* ambientlight.sl - Standard ambient light source for RenderMan Interface.
k3d/share/shaders/k3d_ambientlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_ambientlight.sl: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:9:light k3d_ambientlight(
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:9: *   Ka, Kd	    	work just like the matte shader
k3d/share/shaders/k3d_antialiasedchecks.sl:11: *   frequency		determines the frequency (in s-t space) of the checks
k3d/share/shaders/k3d_antialiasedchecks.sl:19: * last modified 27 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_antialiasedchecks.sl:25:k3d_antialiasedchecks (
k3d/share/shaders/k3d_antialiasedchecks.sl:26:float Ka = 1, Kd = 1, frequency = 10;
k3d/share/shaders/k3d_antialiasedchecks.sl:30:  point Nf;             /* Forward facing surface normal */
k3d/share/shaders/k3d_antialiasedchecks.sl:31:  float smod, tmod;     /* Texture position within the pattern */
k3d/share/shaders/k3d_antialiasedchecks.sl:33:  float x, y;           /* Used to determine pattern */
k3d/share/shaders/k3d_antialiasedchecks.sl:34:  float swidth, twidth, sfuzz, tfuzz;  /* Antialiasing */
k3d/share/shaders/k3d_antialiasedchecks.sl:35:  float Nfactor;        /* Multiplicative factor for AA due to normal */
k3d/share/shaders/k3d_antialiasedchecks.sl: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:41:  swidth = abs(Du(s)*du) + abs(Dv(s)*dv);
k3d/share/shaders/k3d_antialiasedchecks.sl:42:  twidth = abs(Du(t)*du) + abs(Dv(t)*dv);
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: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:56:      x = ((smoothstep (.5,.5+sfuzz,smod)) + (1 - smoothstep (0,sfuzz,smod)));
k3d/share/shaders/k3d_antialiasedchecks.sl:57:      y = ((smoothstep (.5,.5+tfuzz,tmod)) + (1 - smoothstep (0,tfuzz,tmod)));
k3d/share/shaders/k3d_antialiasedchecks.sl:59:      /* Gradually fade in the average color when we get close to the limit */
k3d/share/shaders/k3d_antialiasedchecks.sl:68:  Ci *= Os * (Ka*ambient() + Kd*diffuse(Nf));
k3d/share/shaders/k3d_arealight.sl:2: * arealight.sl - light source shader appropriate for an area light source.
k3d/share/shaders/k3d_arealight.sl:13:light k3d_arealight(
k3d/share/shaders/k3d_arealight.sl:18:#ifdef BMRT
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:33:#endif
k3d/share/shaders/k3d_background.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
k3d/share/shaders/k3d_background.sl:4:// Contact: tshead@k-3d.com
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:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_background.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_background.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_background.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_background.sl:18:// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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_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: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:20:#define NNOISE           4
k3d/share/shaders/k3d_bluemarble.sl:36:k3d_bluemarble(
k3d/share/shaders/k3d_bluemarble.sl:38:    uniform float Kd = 0.8;
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:59:    Ci = Os * (Ct * (Ka * ambient() + Kd * diffuse(NN))
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: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:13: *    Ka, Kd			The usual
k3d/share/shaders/k3d_brick.sl:14: *    brickcolor, mortarcolor	Pretty obvious (default is red bricks)
k3d/share/shaders/k3d_brick.sl:15: *    brickvary                 How much does the brick color vary from
k3d/share/shaders/k3d_brick.sl:17: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brick.sl: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:26:#include "k3d_noises.h"
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:30:float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_brick.sl:33:		  float raggedamp = 0.04, raggedfreq = 12;
k3d/share/shaders/k3d_brick.sl:34:		  float jagged = 0.006, brickvary = 0.3;
k3d/share/shaders/k3d_brick.sl:35:		  float brickwidth = .28, brickheight = .07;
k3d/share/shaders/k3d_brick.sl: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:47:  float swidth, twidth;
k3d/share/shaders/k3d_brick.sl:48:  uniform float BMWIDTH = (brickwidth + mortarthickness);
k3d/share/shaders/k3d_brick.sl:53:  float fact, disp;
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: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: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:82:  if(swidth >= 1)
k3d/share/shaders/k3d_brick.sl:86:      clamp(filteredpulse(MWF, 1 - MWF, ss, swidth), max(1 - MWF / swidth, 0),
k3d/share/shaders/k3d_brick.sl:88:  if(twidth >= 1)
k3d/share/shaders/k3d_brick.sl:92:      clamp(filteredpulse(MHF, 1 - MHF, tt, twidth), max(1 - MHF / twidth, 0),
k3d/share/shaders/k3d_brick.sl:96:  disp = 0;
k3d/share/shaders/k3d_brick.sl:100:      disp = groovedepth * (sqr((tt) / MHF) - 1);
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:119:  disp -=
k3d/share/shaders/k3d_brick.sl:125:  P += disp * normalize(N);
k3d/share/shaders/k3d_brick.sl:127:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_brick.sl:136:  Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
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: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:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brick2.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brick2.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brick2.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brick2.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brick2.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brick2.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brick2.sl:26:k3d_brick2(
k3d/share/shaders/k3d_brick2.sl:28:    uniform float Kd = 1;
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:44:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brick2.sl:55:    /* diffuse reflection model */
k3d/share/shaders/k3d_brick2.sl:57:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brick3.sl:2: * brick.sl -- Surface shader for a bricks.
k3d/share/shaders/k3d_brick3.sl:5: *   Makes a wall of bricks.  Need more be said?  OK.  It makes a good
k3d/share/shaders/k3d_brick3.sl: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:13: *    Ka, Kd			The usual
k3d/share/shaders/k3d_brick3.sl:14: *    brickcolor, mortarcolor	Pretty obvious (default is red bricks)
k3d/share/shaders/k3d_brick3.sl:15: *    brickvary                 How much does the brick color vary from
k3d/share/shaders/k3d_brick3.sl:17: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brick3.sl: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:24: * 	This shader is very similar to (and based upon) brick shaders
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:38:k3d_brick3 ( 
k3d/share/shaders/k3d_brick3.sl:39:float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_brick3.sl:42:        float jagged = 0.006, brickvary = 0.3;
k3d/share/shaders/k3d_brick3.sl:43:        float brickwidth = .25, brickheight = .08;
k3d/share/shaders/k3d_brick3.sl:48:#define BMWIDTH (brickwidth+mortarthickness)
k3d/share/shaders/k3d_brick3.sl:49:#define BMHEIGHT (brickheight+mortarthickness)
k3d/share/shaders/k3d_brick3.sl:50:#define MWF (mortarthickness*0.5/BMWIDTH)
k3d/share/shaders/k3d_brick3.sl:51:#define MHF (mortarthickness*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brick3.sl:52:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_brick3.sl:53:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_brick3.sl:54:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_brick3.sl:58:  float scoord, tcoord, ss, tt;
k3d/share/shaders/k3d_brick3.sl:59:  float swidth, twidth;
k3d/share/shaders/k3d_brick3.sl:62:  /* Determine how wide in s-t space one pixel projects to */
k3d/share/shaders/k3d_brick3.sl:63:  swidth = max (abs(Du(s)*du) + abs(Dv(s)*dv), MINFILTERWIDTH);
k3d/share/shaders/k3d_brick3.sl:64:  twidth = max (abs(Du(t)*du) + abs(Dv(t)*dv), MINFILTERWIDTH);
k3d/share/shaders/k3d_brick3.sl:66:  Nf = faceforward (normalize(N),I);
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:75:  swidth /= BMWIDTH;
k3d/share/shaders/k3d_brick3.sl:76:  twidth /= BMHEIGHT;
k3d/share/shaders/k3d_brick3.sl:79:  if (mod (tt*0.5, 1) > 0.5)
k3d/share/shaders/k3d_brick3.sl:83:  /* Shift the columns randomly by row */
k3d/share/shaders/k3d_brick3.sl:87:  ss -= sbrick;          /* Now ss and tt are coords within the brick */
k3d/share/shaders/k3d_brick3.sl:91:  if (swidth >= 1)
k3d/share/shaders/k3d_brick3.sl:93:  else w = clamp (boxstep(MWF-swidth,MWF,ss), max(1-MWF/swidth,0), 1)
k3d/share/shaders/k3d_brick3.sl:94:	 - clamp (boxstep(1-MWF-swidth,1-MWF,ss), 0, 2*MWF/swidth);
k3d/share/shaders/k3d_brick3.sl:96:  if (twidth >= 1)
k3d/share/shaders/k3d_brick3.sl:98:  else h = clamp (boxstep(MHF-twidth,MHF,tt), max(1-MHF/twidth,0),1)
k3d/share/shaders/k3d_brick3.sl:99:	 - clamp (boxstep(1-MHF-twidth,1-MHF,tt), 0, 2*MHF/twidth);
k3d/share/shaders/k3d_brick3.sl:107:  Ci = Os * Ct * (Ka * ambient() + Kd*diffuse(Nf));
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: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:17:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickanti.sl:18:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickanti.sl:19:#define MORTARTHICKNESS 0.02
k3d/share/shaders/k3d_brickanti.sl:21:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickanti.sl:22:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickanti.sl:23:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickanti.sl:24:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickanti.sl:27:k3d_brickanti(
k3d/share/shaders/k3d_brickanti.sl:29:    uniform float Kd = 1;
k3d/share/shaders/k3d_brickanti.sl:37:    float scoord = s;
k3d/share/shaders/k3d_brickanti.sl:38:    float tcoord = t;
k3d/share/shaders/k3d_brickanti.sl:39:    float swidth, twidth;
k3d/share/shaders/k3d_brickanti.sl:41:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_brickanti.sl:43:    ss = scoord / BMWIDTH;
k3d/share/shaders/k3d_brickanti.sl:44:    tt = tcoord / BMHEIGHT;
k3d/share/shaders/k3d_brickanti.sl:46:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickanti.sl:49:    swidth = abs(Du(ss)*du) + abs(Dv(ss)*dv);
k3d/share/shaders/k3d_brickanti.sl:50:    twidth = abs(Du(tt)*du) + abs(Dv(tt)*dv);
k3d/share/shaders/k3d_brickanti.sl:59:    w = boxstep(MWF-swidth,MWF,ss)
k3d/share/shaders/k3d_brickanti.sl:60:      - boxstep(1-MWF-swidth,1-MWF,ss);
k3d/share/shaders/k3d_brickanti.sl:61:    h = boxstep(MHF-twidth,MHF,tt)
k3d/share/shaders/k3d_brickanti.sl:62:      - boxstep(1-MHF-twidth,1-MHF,tt);
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:69:#define tintegral(tt)  (floor(tt)*(1-2*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:74:#endif
k3d/share/shaders/k3d_brickanti.sl:78:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickanti.sl:80:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brickbump.sl:2: * brickbump.sl -- displacement shader for bricks.
k3d/share/shaders/k3d_brickbump.sl:5: *   Makes displacements for a wall of bricks.  This is the companion
k3d/share/shaders/k3d_brickbump.sl:6: *   shader to the surface "brick" shader.  The parameters work exactly
k3d/share/shaders/k3d_brickbump.sl:7: *   the same.  Of course, you can use it with any surface shader, and
k3d/share/shaders/k3d_brickbump.sl:8: *   in fact matte or plastic gives those nice white cinder block walls.
k3d/share/shaders/k3d_brickbump.sl:9: *   However, if you do use it with "brick", the parameters MUST match,
k3d/share/shaders/k3d_brickbump.sl:13: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brickbump.sl:16: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brickbump.sl:17: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brickbump.sl:18: *    pitting                   The amplitude of the "pits" on the face of
k3d/share/shaders/k3d_brickbump.sl: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:26:#include "k3d_noises.h"
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:30:float jagged = 0.006;
k3d/share/shaders/k3d_brickbump.sl:31:			   float brickwidth = .25, brickheight = .08;
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:40:  float fact, disp;
k3d/share/shaders/k3d_brickbump.sl:41:  uniform float BMWIDTH = (brickwidth + mortarthickness);
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:50:  disp = 0;
k3d/share/shaders/k3d_brickbump.sl:54:      disp = groovedepth * (sqr((tt) / MHF) - 1);
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:73:  disp -=
k3d/share/shaders/k3d_brickbump.sl:79:  P += disp * normalize(N);
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: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:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickbump2.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickbump2.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brickbump2.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickbump2.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickbump2.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickbump2.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickbump2.sl:26:k3d_brickbump2(
k3d/share/shaders/k3d_brickbump2.sl:28:    uniform float Kd = 1;
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:45:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickbump2.sl:61:    /* compute shading normal */
k3d/share/shaders/k3d_brickbump2.sl:63:    Nf = normalize(faceforward(Nf, I));
k3d/share/shaders/k3d_brickbump2.sl:65:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickbump2.sl:67:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brickbump3.sl:2: * brickbump.sl -- displacement shader for bricks.
k3d/share/shaders/k3d_brickbump3.sl:5: *   Makes displacements for a wall of bricks.  This is the companion
k3d/share/shaders/k3d_brickbump3.sl:6: *   shader to the surface "brick" shader.  The parameters work exactly
k3d/share/shaders/k3d_brickbump3.sl:7: *   the same.  Of course, you can use it with any surface shader, and
k3d/share/shaders/k3d_brickbump3.sl:8: *   in fact matte or plastic gives those nice white cinder block walls.
k3d/share/shaders/k3d_brickbump3.sl:9: *   However, if you do use it with "brick", the parameters MUST match,
k3d/share/shaders/k3d_brickbump3.sl:13: *    brickwidth                Width of a brick (in st space)
k3d/share/shaders/k3d_brickbump3.sl:16: *    rowvary                   How much does each row shift?
k3d/share/shaders/k3d_brickbump3.sl:17: *    jagged                    How much do bricks deviate from squares?
k3d/share/shaders/k3d_brickbump3.sl:18: *    pitting                   The amplitude of the "pits" on the face of
k3d/share/shaders/k3d_brickbump3.sl:21: *    groovedepth               The depth of the grooves between bricks.
k3d/share/shaders/k3d_brickbump3.sl:26: *      28 May 1992 -- written by lg for the "Timbre Trees" video (saucer)
k3d/share/shaders/k3d_brickbump3.sl: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:34:  You may note the companion shaders "brick" and "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: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:46:   	       "groovedepth" 0.015
k3d/share/shaders/k3d_brickbump3.sl:49:displacement
k3d/share/shaders/k3d_brickbump3.sl:50:k3d_brickbump3 ( 
k3d/share/shaders/k3d_brickbump3.sl:51:float jagged = 0.006;
k3d/share/shaders/k3d_brickbump3.sl:52:            float brickwidth = .25, brickheight = .08;
k3d/share/shaders/k3d_brickbump3.sl:55:	    float pockfrequency = 10, groovedepth = 0.01; 
k3d/share/shaders/k3d_brickbump3.sl:58:#define BMWIDTH (brickwidth+mortarthickness)
k3d/share/shaders/k3d_brickbump3.sl:59:#define BMHEIGHT (brickheight+mortarthickness)
k3d/share/shaders/k3d_brickbump3.sl:60:#define MWF (mortarthickness*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickbump3.sl:61:#define MHF (mortarthickness*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickbump3.sl:62:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_brickbump3.sl:63:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_brickbump3.sl:64:#define sqr(x) ((x)*(x))
k3d/share/shaders/k3d_brickbump3.sl:67:  float scoord, tcoord, ss, tt;
k3d/share/shaders/k3d_brickbump3.sl:68:  float fact, disp;
k3d/share/shaders/k3d_brickbump3.sl:70:  scoord = s;  tcoord = t;
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:81:  if (mod (tt*0.5, 1) > 0.5)
k3d/share/shaders/k3d_brickbump3.sl:85:  /* Shift the columns randomly by row */
k3d/share/shaders/k3d_brickbump3.sl:89:  ss -= sbrick;          /* Now ss and tt are coords within the brick */
k3d/share/shaders/k3d_brickbump3.sl:93:  disp = 0;
k3d/share/shaders/k3d_brickbump3.sl:96:      disp = groovedepth * (sqr((tt)/MHF) - 1);
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:115:  P += disp * normalize(N);
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: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:16:#define BRICKWIDTH      0.25
k3d/share/shaders/k3d_brickperturb.sl:17:#define BRICKHEIGHT     0.08
k3d/share/shaders/k3d_brickperturb.sl:18:#define MORTARTHICKNESS 0.01
k3d/share/shaders/k3d_brickperturb.sl:20:#define BMWIDTH         (BRICKWIDTH+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickperturb.sl:21:#define BMHEIGHT        (BRICKHEIGHT+MORTARTHICKNESS)
k3d/share/shaders/k3d_brickperturb.sl:22:#define MWF             (MORTARTHICKNESS*0.5/BMWIDTH)
k3d/share/shaders/k3d_brickperturb.sl:23:#define MHF             (MORTARTHICKNESS*0.5/BMHEIGHT)
k3d/share/shaders/k3d_brickperturb.sl:26:k3d_brickperturb(
k3d/share/shaders/k3d_brickperturb.sl:28:    uniform float Kd = 1;
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:44:    if (mod(tt*0.5,1) > 0.5)
k3d/share/shaders/k3d_brickperturb.sl:56:    /* diffuse reflection model */
k3d/share/shaders/k3d_brickperturb.sl:58:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_brushedmetal.sl:2: * brushedmetal.sl
k3d/share/shaders/k3d_brushedmetal.sl:5: *   Simple anisotropic metal shader.
k3d/share/shaders/k3d_brushedmetal.sl:8: *   Ka, Kd, Ks - the usual meaning
k3d/share/shaders/k3d_brushedmetal.sl:9: *   uroughness, vroughness - separate roughnesses for u and v directions
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:21:float Ka = 1, Kd = 0.1, Ks = .9;
k3d/share/shaders/k3d_brushedmetal.sl:25:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_brushedmetal.sl:27:    MaterialBrushedMetal(Nf, Cs, Ka, Kd, Ks, normalize(dPdu), uroughness,
k3d/share/shaders/k3d_brushedmetal2.sl:1:/*  IDbrushedmetal.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_brushedmetal2.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_brushedmetal2.sl: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:17: *  Kd			- coefficient of diffuse
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:33:anisospecular (vector VA; float specspread; float specwidth)
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: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:65:k3d_brushedmetal2(
k3d/share/shaders/k3d_brushedmetal2.sl:67:		Kd		= .01,
k3d/share/shaders/k3d_brushedmetal2.sl:70:		specwidth	= .5,
k3d/share/shaders/k3d_brushedmetal2.sl:71:		specspread 	= .5,
k3d/share/shaders/k3d_brushedmetal2.sl:72:		mapspread 	= .3,
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:93:	      jitter = (random()-.5)*Jspread;
k3d/share/shaders/k3d_brushedmetal2.sl:94:	      angle = PI*((i/numsamples)-.5)*mapspread;
k3d/share/shaders/k3d_brushedmetal2.sl:97:	      D = vtransform("world", D);
k3d/share/shaders/k3d_brushedmetal2.sl:104:	Ci = Oi * (Cs * (Ka * ambient() + Kd * diffuse(-Nf)) + 
k3d/share/shaders/k3d_brushedmetal2.sl:105:	specularcolor * Ks * anisospecular(VA, specspread*2, specwidth*.1)) +
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: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:18:LocIllumWardAnisotropic (normal N;  vector V;
k3d/share/shaders/k3d_brushedmetal3.sl:19:                         vector xdir;  float xroughness, yroughness;)
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:30:        /* Must declare because extern L & Cl because we're in a function */
k3d/share/shaders/k3d_brushedmetal3.sl:51:k3d_brushedmetal3 ( 
k3d/share/shaders/k3d_brushedmetal3.sl:52:float Ka = 1, Kd = 0.1, Ks = .9;
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:9:displacement k3d_bubbles(
k3d/share/shaders/k3d_bubbles.sl:10:	float radius = 0.5;   /* values between -0.5 and 0.5          */
k3d/share/shaders/k3d_bubbles.sl:15: float distance2point;
k3d/share/shaders/k3d_bubbles.sl:17: float magnitud = 0;
k3d/share/shaders/k3d_bubbles.sl:19: float smod = mod((s) * frequency, 1) - 0.5;
k3d/share/shaders/k3d_bubbles.sl:20: float tmod = mod((t) * frequency, 1) - 0.5;
k3d/share/shaders/k3d_bubbles.sl:21: point myPoint = (smod, 0, tmod);
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_bubbly.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_bubbly.sl:6: *  basicly it's F1 squared as described in 
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:12: *  the "bubbles" are paraboloids diplaced along the normal. 
k3d/share/shaders/k3d_bubbly.sl:14: *  try negative values for Kd.
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:22: *  Kd      - coefficient of displacement. 
k3d/share/shaders/k3d_bubbly.sl:23: *	      Displacement bounds and this value should be equal.
k3d/share/shaders/k3d_bubbly.sl:24: *  bubsize - basicly the radius of the bubbles. distance in rVu's.
k3d/share/shaders/k3d_bubbly.sl:27:displacement
k3d/share/shaders/k3d_bubbly.sl:28:k3d_bubbly(
k3d/share/shaders/k3d_bubbly.sl:31:         Kd      = .2,
k3d/share/shaders/k3d_bubbly.sl:36:  float dist, shortest=10000;
k3d/share/shaders/k3d_bubbly.sl:39:  /*true cell center, surrounding cell centers, noised cell center*/
k3d/share/shaders/k3d_bubbly.sl:47:  /*what is the shortest distance to a noised cell center?*/
k3d/share/shaders/k3d_bubbly.sl:54:	dist = distance(Po,nzcell);
k3d/share/shaders/k3d_bubbly.sl:55:	if(dist<shortest) shortest = dist;
k3d/share/shaders/k3d_bubbly.sl:60:  P+= Nn*(pow(bub,2)-1)*Kd;
k3d/share/shaders/k3d_castucco.sl:2: * castucco.sl -- dispacement shader for stucco.
k3d/share/shaders/k3d_castucco.sl:11: *   Km - amplitude of the mesas.
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:19:#include "k3d_noises.h"
k3d/share/shaders/k3d_castucco.sl:20:#include "k3d_displace.h"
k3d/share/shaders/k3d_castucco.sl:22:displacement k3d_castucco(
k3d/share/shaders/k3d_castucco.sl:29:  point Pshad;			/* Point to be shaded, in shader space */
k3d/share/shaders/k3d_castucco.sl:30:  float fwidth;			/* Estimated change in P between image samples */
k3d/share/shaders/k3d_castucco.sl:31:  float disp;			/* Amount to displace */
k3d/share/shaders/k3d_castucco.sl:33:  /* Do texture calcs in "shader" space, get approximate filter size */
k3d/share/shaders/k3d_castucco.sl:34:  Pshad = freq * transform("shader", P);
k3d/share/shaders/k3d_castucco.sl:35:  fwidth = filterwidthp(Pshad);
k3d/share/shaders/k3d_castucco.sl:38:  disp = fBm(Pshad, fwidth, 3, 2, 0.6);
k3d/share/shaders/k3d_castucco.sl:40:  /* Threshold the fBm and scale it */
k3d/share/shaders/k3d_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:2:k3d_causticlight ( float intensity = 1;
k3d/share/shaders/k3d_causticlight.sl:4:	       point from = point "shader" (0,0,0);
k3d/share/shaders/k3d_causticlight.sl: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:13:               float  threshold = 0.5;
k3d/share/shaders/k3d_causticlight.sl:21:	float atten = pow (cosangle, beamdistribution) / (L . L);
k3d/share/shaders/k3d_causticlight.sl:22:	atten *= smoothstep (cos(coneangle), cos(coneangle-conedeltaangle),
k3d/share/shaders/k3d_causticlight.sl:25:        if (shadowname != "") {
k3d/share/shaders/k3d_causticlight.sl:26:            float caustic = shadow (shadowname, Ps, "samples", samples,
k3d/share/shaders/k3d_causticlight.sl:28:	    caustic = smoothstep (threshold, 1, caustic);
k3d/share/shaders/k3d_causticlight.sl:30:		point PL = transform ("shader", Ps);
k3d/share/shaders/k3d_celld.sl:2: * TLd_cell1
k3d/share/shaders/k3d_celld.sl:4: * Simple displacement shader using Voronoi cell noise
k3d/share/shaders/k3d_celld.sl:10: *   01/12/15  Created
k3d/share/shaders/k3d_celld.sl:14:#include "k3d_noises.h"
k3d/share/shaders/k3d_celld.sl:16:displacement k3d_celld (
k3d/share/shaders/k3d_celld.sl:17:        float Kvoro = 0;        /* desc {amount to displace. } */
k3d/share/shaders/k3d_celld.sl:18:	float voro_freq = 1;    /* desc {Feature size } */
k3d/share/shaders/k3d_celld.sl:19:	float voro_step = 0.05; /* desc {Step value size.  If the difference
k3d/share/shaders/k3d_celld.sl:20:				   between f2 and f1 is less then this value
k3d/share/shaders/k3d_celld.sl:22:	float voro_jitter = 0;  /* desc { Amount to perturb the voroni 
k3d/share/shaders/k3d_celld.sl:24:	string PSpace = "shader";  /* desc {Space to transform P for shading calculations } */
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:38:	voronoi_f1f2_3d (noiseP*voro_freq, voro_jitter, 
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:46:#endif
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_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:10:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ceramic.sl:11:  Ci = MaterialCeramic(Nf, Cs, Ka, Kd, Ks, roughness, specsharpness);
k3d/share/shaders/k3d_ceramictiles.sl:4: * Description: Ceramic tiles (like you'd find in a bathroom)
k3d/share/shaders/k3d_ceramictiles.sl:6: * Parameters for pattern placement and size:
k3d/share/shaders/k3d_ceramictiles.sl:7: *   projection, textureprojspace, mx -  define the projection used to
k3d/share/shaders/k3d_ceramictiles.sl:8: *     establish a basic 2-D coordinate system for the pattern.
k3d/share/shaders/k3d_ceramictiles.sl:10: *     for s and t directions)
k3d/share/shaders/k3d_ceramictiles.sl:11: *   groovewidth, grooveheight - width of the spacing between tiles,
k3d/share/shaders/k3d_ceramictiles.sl:12: *     expressed as a fraction of the tile-to-tile spacing.
k3d/share/shaders/k3d_ceramictiles.sl:13: *   groovedepth - displacement amount for the grooves (expressed in
k3d/share/shaders/k3d_ceramictiles.sl: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:20: *   Cedge - separate edge color for 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: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: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:33: *   Kdtile - diffuse component weighting of the tile
k3d/share/shaders/k3d_ceramictiles.sl:36: *   envname, envspace, envrad - environment mapping controls
k3d/share/shaders/k3d_ceramictiles.sl:49:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_ceramictiles.sl: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:56:#include "k3d_noises.h"
k3d/share/shaders/k3d_ceramictiles.sl:57:#include "k3d_displace.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:64: * shading.
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: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:79:						     dt);
k3d/share/shaders/k3d_ceramictiles.sl:84:/* Given coordinates (stile,ttile) and derivatives (ds,dt) *within* a
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:91:		  float stile, ttile, ds, dt;
k3d/share/shaders/k3d_ceramictiles.sl:92:		  float edgevary, mottling, speckly; float mottlefreq;
k3d/share/shaders/k3d_ceramictiles.sl:93:		  color Cbase, Cedge, Cmottle, Cspeck)
k3d/share/shaders/k3d_ceramictiles.sl:96:  float dst = max(ds, dt);
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:106:      float sedgeoffset =
k3d/share/shaders/k3d_ceramictiles.sl:107:	.05 * fBm(point(stile * 10, ttile * 10, tileindex + 10),
k3d/share/shaders/k3d_ceramictiles.sl:108:		  10 * dst, 2, 2, 0.5);
k3d/share/shaders/k3d_ceramictiles.sl:109:      float tedgeoffset =
k3d/share/shaders/k3d_ceramictiles.sl:110:	.05 * fBm(point(stile * 10, ttile * 10, tileindex - 3),
k3d/share/shaders/k3d_ceramictiles.sl:111:		  10 * dst, 2, 2, 0.5);
k3d/share/shaders/k3d_ceramictiles.sl:112:      float edgy =
k3d/share/shaders/k3d_ceramictiles.sl:114:	(smoothpulse(.05, .15, .85, .95, stile + sedgeoffset) *
k3d/share/shaders/k3d_ceramictiles.sl:115:	 smoothpulse(.05, .15, .85, .95, ttile + tedgeoffset));
k3d/share/shaders/k3d_ceramictiles.sl:116:      C = mix(C, Cedge, edgevary * edgy);
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: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:142:			   float Ka, Kdmortar, Kdtile, Ks;
k3d/share/shaders/k3d_ceramictiles.sl:150:  float kd = mix(Kdmortar, Kdtile, intile);
k3d/share/shaders/k3d_ceramictiles.sl:157:  return fkt * basecolor * (Ka * ambient() + kd * diffuse(Nf)) +
k3d/share/shaders/k3d_ceramictiles.sl:165:surface k3d_ceramictiles(float Ka = 1, Ks = .75, roughness =
k3d/share/shaders/k3d_ceramictiles.sl:168:			 float Kdtile = 0.5;
k3d/share/shaders/k3d_ceramictiles.sl:169:			 float Kdmortar = 0.8;
k3d/share/shaders/k3d_ceramictiles.sl: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:176:			 string textureprojspace = "shader";
k3d/share/shaders/k3d_ceramictiles.sl:180:			 float edgevary = 1, mottling = 1, speckly = 1;
k3d/share/shaders/k3d_ceramictiles.sl:183:			 color Cedge = color(.025, .025, .2);
k3d/share/shaders/k3d_ceramictiles.sl:189:   * Get a 2-D texture coordinates for the texturing, then
k3d/share/shaders/k3d_ceramictiles.sl:192:  float ss, tt, dss, dtt;
k3d/share/shaders/k3d_ceramictiles.sl:193:    ProjectTo2D (projection, P, textureprojspace, array_to_mx(mx),ss, tt, dss, dtt);
k3d/share/shaders/k3d_ceramictiles.sl:195:  dss /= stilespacing;
k3d/share/shaders/k3d_ceramictiles.sl:197:  dtt /= ttilespacing;
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:207:  float tileindex = swhichtile + 13 * twhichtile;
k3d/share/shaders/k3d_ceramictiles.sl:210:   * Displacement: the edges of the tile displace down a bit, as do
k3d/share/shaders/k3d_ceramictiles.sl:211:   * the grooves between tiles.  Also, add just a little bit of
k3d/share/shaders/k3d_ceramictiles.sl:214:  float tiledisp = smoothpulse(0, .075, 0.925, 1, stile);
k3d/share/shaders/k3d_ceramictiles.sl:215:  tiledisp *= smoothpulse(0, .075, 0.925, 1, ttile);
k3d/share/shaders/k3d_ceramictiles.sl:216:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_ceramictiles.sl:218:    Displace(Nf, "shader", groovedepth * (tiledisp - 1), truedisp);
k3d/share/shaders/k3d_ceramictiles.sl:220:  Ntile += 0.05 * (vector cellnoise(tileindex + 5) - 0.5);
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:231:			    Cbase, Cedge, Cmottle, Cspeck);
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: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:245:   * Illumination model
k3d/share/shaders/k3d_ceramictiles.sl:248:    MaterialCeramicTiles(Nf, Cmortar, Ctile, intile, Ka, Kdmortar, Kdtile, Ks,
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:4:			 float Kd = 1.0;
k3d/share/shaders/k3d_checkerboard.sl:13:  float filterwidths, filterwidtht;
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:32:  tiles = step(1.0, mod(s * TileS, 2.0));
k3d/share/shaders/k3d_checkerboard.sl:33:  tilet = step(1.0, mod(t * TileT, 2.0));
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_solid.sl:2:surface k3d_checkerboard_solid(
k3d/share/shaders/k3d_checkerboard_solid.sl:4:	float Kd = 1.0;
k3d/share/shaders/k3d_checkerboard_solid.sl:12:	string shadingspace = "shader";
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:25:	sum = mod(x + y + z, 2.0);
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:8:k3d_clamptoalpha()
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:4: * cloudplane.sl
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:16:#define NTERMS 5
k3d/share/shaders/k3d_cloudplane.sl:19:k3d_cloudplane(
k3d/share/shaders/k3d_cloudplane.sl:20:    color cloudcolor = color (1,1,1);
k3d/share/shaders/k3d_cloudplane.sl:25:    float i, amplitude, f;
k3d/share/shaders/k3d_cloudplane.sl:32:    Psh = transform("shader", P);
k3d/share/shaders/k3d_cloudplane.sl:40:    amplitude = 0.3;
k3d/share/shaders/k3d_cloudplane.sl:43:        fx = amplitude *
k3d/share/shaders/k3d_cloudplane.sl:45:        fy = amplitude *
k3d/share/shaders/k3d_cloudplane.sl:53:        amplitude *= 0.707;
k3d/share/shaders/k3d_cloudplane.sl:57:    Ct = mix(Cs, cloudcolor, f);
k3d/share/shaders/k3d_constant.sl:1:/* constant.sl - Standard constant surface for RenderMan Interface.
k3d/share/shaders/k3d_constant.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_constant.sl: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:14:k3d_contactshadow (  
k3d/share/shaders/k3d_contacshadow.sl:15:    string shadowname = "";     /* the name of the texture file */  
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:23:       camera space used when rendering the shadow map */  
k3d/share/shaders/k3d_contacshadow.sl:25:    textureinfo(shadowname, "viewingmatrix", matNl);  
k3d/share/shaders/k3d_contacshadow.sl:28:       screen space (-1..1) used when rendering the shadow map */  
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:33:       needed to look up the point in the shadow map */  
k3d/share/shaders/k3d_contacshadow.sl:39:	/* point being shaded is outside the region of the depth map */  
k3d/share/shaders/k3d_contacshadow.sl:43:	/* get the distance from the shadow camera to the closest
k3d/share/shaders/k3d_contacshadow.sl: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:52:	/* the difference between the two distances is used to calculate the  
k3d/share/shaders/k3d_contacshadow.sl:53:	   contact shadow effect */  
k3d/share/shaders/k3d_contacshadow.sl:54:	float distance = mapdist - zcomp(cameraP);  
k3d/share/shaders/k3d_contacshadow.sl:56:	distance = smoothstep(0, 1, distance/influence);  
k3d/share/shaders/k3d_contacshadow.sl:57:	distance = pow(distance, gamma);  
k3d/share/shaders/k3d_contacshadow.sl:59:	/* convert into a color (white=shadow) */  
k3d/share/shaders/k3d_contacshadow.sl:60:	Ci = (1.0-distance);  
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:6: * Last Update: 16 October 2000
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: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:20: *   the displacement of the tile itself out of the gap
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:24: *   tileheight = 0 there are bumps on the tile surface of height tileheight, but no difference
k3d/share/shaders/k3d_corktile.sl:25: *   in height between the gap and the tile itself
k3d/share/shaders/k3d_corktile.sl:27: * The shader makes an attempt at being self antaliasing
k3d/share/shaders/k3d_corktile.sl:31:#include "k3d_noises.h" /* the standard BMRT include file */
k3d/share/shaders/k3d_corktile.sl:32:#include "k3d_tile.h"
k3d/share/shaders/k3d_corktile.sl:33:#define fnoise(p,width) (noise(p) * (1-smoothstep (0.2,0.75,width)))
k3d/share/shaders/k3d_corktile.sl:35:/* Bias function - Perlin and Hoffert 1989 */
k3d/share/shaders/k3d_corktile.sl:44:							float txtscale, filtwidth)
k3d/share/shaders/k3d_corktile.sl:46:		/* 	the pattern is built up of the sum of two offset noise functions, perturbed slightly
k3d/share/shaders/k3d_corktile.sl:47:		and used to select a color from a spline, combined with an overlay of the dark 
k3d/share/shaders/k3d_corktile.sl:51:		point P2 = transform("shader",PP);
k3d/share/shaders/k3d_corktile.sl:53:		float fw = filtwidth * txtscale;
k3d/share/shaders/k3d_corktile.sl:69:		/* Overlay the dark markings */
k3d/share/shaders/k3d_corktile.sl:79:k3d_corktile( 	float	Ka = 1;
k3d/share/shaders/k3d_corktile.sl:80:          	float	Kd = .75;
k3d/share/shaders/k3d_corktile.sl:94:	uniform float tilewidth = 1 / (tiles * txtscale); 
k3d/share/shaders/k3d_corktile.sl:95:	float disp, adjust;
k3d/share/shaders/k3d_corktile.sl:96:	point PP = transform("shader",P);
k3d/share/shaders/k3d_corktile.sl:97:	float filtwidth = filterwidthp(PP),
k3d/share/shaders/k3d_corktile.sl:98:			swidth = abs(Du(s)*du) + abs(Dv(s)*dv),
k3d/share/shaders/k3d_corktile.sl:99:			twidth = abs(Du(t)*du) + abs(Dv(t)*dv),
k3d/share/shaders/k3d_corktile.sl:100:			stfiltwidth = max(swidth, twidth) / tilewidth,
k3d/share/shaders/k3d_corktile.sl:104:	float ingap = tile(s, t, tilewidth, tilewidth, swidth, twidth, gap, gap, sw, tw, so, to);
k3d/share/shaders/k3d_corktile.sl:106:	Ct = cork( P, txtscale, filtwidth);	
k3d/share/shaders/k3d_corktile.sl:108:	Cg = color( .20, 0, 0) + filteredsnoise(PP * txtscale, filtwidth * txtscale) * .2;
k3d/share/shaders/k3d_corktile.sl:111:	adjust = (1 - min(smoothstep(gap * .3, gap * .7, so), smoothstep(gap * .3, gap * .7, to))) * 
k3d/share/shaders/k3d_corktile.sl:112:		(1  - smoothstep(.2 * gap, gap * .8, stfiltwidth));  
k3d/share/shaders/k3d_corktile.sl:113:	disp = (tileheight + fnoise(PP * txtscale * bumpfreq + 3, filtwidth * txtscale) * (1 - tileheight)) 
k3d/share/shaders/k3d_corktile.sl:114:		* bumpheight * (1 - adjust);
k3d/share/shaders/k3d_corktile.sl:115:	Nf = faceforward(calculatenormal(P + disp *	normalize(N)), I);
k3d/share/shaders/k3d_corktile.sl:119:	Ci = Os * (mix( Ct, Cg, ingap) * (Ka*ambient() + Kd*diffuse(Nf)) +
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:10:#include "k3d_noises.h"
k3d/share/shaders/k3d_craters.sl:11:#include "k3d_patterns.h"
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: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: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: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:46:	scellctr = floor(s*sc/swidth);
k3d/share/shaders/k3d_craters.sl:47:	tcellctr = floor(t*sc/swidth);
k3d/share/shaders/k3d_craters.sl:48:	cellsizescale = swidth/sc;
k3d/share/shaders/k3d_craters.sl:49:	rrad1 = 0;
k3d/share/shaders/k3d_craters.sl:50:	rrad2 = 0;
k3d/share/shaders/k3d_craters.sl:59:		  /* if ( fBm_default(xp) < pitfactor)  *//* I like this distribution better - pitf = -1 -> 1 */
k3d/share/shaders/k3d_craters.sl:65:		    r = ss*ss + tt*tt; /* r is distance from center squared */
k3d/share/shaders/k3d_craters.sl: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:72:		      rrad2 = rrad1;
k3d/share/shaders/k3d_craters.sl:74:		      rrad1 = rad;
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:82:		      rrad2 = rad;
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:95:	if (rrad1 > 0 && rmax1 > 0) 
k3d/share/shaders/k3d_craters.sl:97:	    r = smoothstep(0,rrad1,rmax1);
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: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: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:32:#define snoise(x,y) ((noise(x,y) - 0.5) * 2)
k3d/share/shaders/k3d_crayon.sl:35:aanoise(float sp, tp, width)
k3d/share/shaders/k3d_crayon.sl:37:	/* an antaliased noise function, which returns noise of a wavelenth always greater than
k3d/share/shaders/k3d_crayon.sl: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:41:	f = ceil(width /.5);
k3d/share/shaders/k3d_crayon.sl:44:	ns  = mag * snoise(sp / f, tp / f) * (1 - smoothstep(0, .5, width / f))
k3d/share/shaders/k3d_crayon.sl:45:		+ snoise(sp / (f * 1.33), tp / (f * 1.33)) * mag * .25 * smoothstep(0, .5, width / f);
k3d/share/shaders/k3d_crayon.sl:50:#define MINFILTWIDTH 1.0e-6
k3d/share/shaders/k3d_crayon.sl:51:#define filterwidth(x)  max (abs(Du(x)*du) + abs(Dv(x)*dv), MINFILTWIDTH)
k3d/share/shaders/k3d_crayon.sl:55:k3d_crayon (	float Ka = 1;
k3d/share/shaders/k3d_crayon.sl:56:        	float Kd = .5;
k3d/share/shaders/k3d_crayon.sl:61:			float width = .05;
k3d/share/shaders/k3d_crayon.sl:64:			float density0 = .5;
k3d/share/shaders/k3d_crayon.sl:65:			float density1 = .5;
k3d/share/shaders/k3d_crayon.sl:71:    float density = density0 + t * (density1 - density0);
k3d/share/shaders/k3d_crayon.sl:72:	/* work out the density for the current t */
k3d/share/shaders/k3d_crayon.sl:73:	float trs = spline(1 - density, 0 , -0.195997, -0.128361, -0.0738346,	-0.0316483,
k3d/share/shaders/k3d_crayon.sl: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:84:		txtscale * fw / width) + 1) / 2;
k3d/share/shaders/k3d_crayon.sl:91:    Ci = Os * ( Csurf * (Ka*ambient() + Kd*diffuse(Nf)) +
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:11: * idea was to make one color dependable of the other but is

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

k3d/share/shaders/k3d_crayontoon.sl:17:                         Kd = .33;)

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:1:#define TWOPI (2*PI)
k3d/share/shaders/k3d_cyclone.sl:3:/* Use signed Perlin noise */
k3d/share/shaders/k3d_cyclone.sl:4:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_cyclone.sl:5:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_cyclone.sl:6:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_cyclone.sl:7:#define VERY_SMALL 0.001
k3d/share/shaders/k3d_cyclone.sl:10:surface k3d_cyclone(float Ka = 0.5, Kd = 0.75; float max_radius = 1;
k3d/share/shaders/k3d_cyclone.sl:15:  float radius, dist, angle, sine, cosine, eye_weight, value;
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:21:  /* Transform to texture coordinates */
k3d/share/shaders/k3d_cyclone.sl:22:  Pt = transform("shader", P);
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:29:    {				/* inside of cyclone */
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: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:68:  /* Thin the density of the clouds */
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:4:// Contact: tshead@k-3d.com
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:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_decalplastic.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_decalplastic.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_decalplastic.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_decalplastic.sl:18:// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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:26:	float Kd = 0.5;
k3d/share/shaders/k3d_decalplastic.sl:46:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_decalplastic.sl:49:	Ci = Oi * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_defaultsurface.sl:1:/* defaultsurface.sl - just color the surface, don't even look at lights
k3d/share/shaders/k3d_defaultsurface.sl:3: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_defaultsurface.sl: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: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_defaultsurface.sl:12:  Ci = Os * Cs * (Ka + Kd * d * d);
k3d/share/shaders/k3d_dented.sl:2: * dented.sl -- displacement shader for dents
k3d/share/shaders/k3d_dented.sl:5: *   Makes a surface appear worn and dented.
k3d/share/shaders/k3d_dented.sl:8: *   Km 	   	the amplitude of the dents
k3d/share/shaders/k3d_dented.sl:9: *   power	   	controls the fractal dimension of the dents (1 looks
k3d/share/shaders/k3d_dented.sl:10: *                         like previously crumpled paper or cloth, 3 looks
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: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:33:	float magnitude = 0;
k3d/share/shaders/k3d_dented.sl:37:	PP = transform ("shader", P);
k3d/share/shaders/k3d_dented.sl:41:			magnitude += abs(0.5 - noise(PP*size)) / size;
k3d/share/shaders/k3d_dented.sl:44:	P = P - (Km * pow(magnitude, power)) * normalize(N);
k3d/share/shaders/k3d_depthcue.sl:1:/* depthcue.sl - Standard depthcue volume shader for RenderMan Interface.
k3d/share/shaders/k3d_depthcue.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_depthcue.sl: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:9:volume k3d_depthcue(float mindistance = 0, maxdistance = 1;
k3d/share/shaders/k3d_depthcue.sl:10:		    color background = 0;)
k3d/share/shaders/k3d_depthcue.sl:12:  float d;
k3d/share/shaders/k3d_depthcue.sl:14:  d = clamp((depth(P) - mindistance) / (maxdistance - mindistance), 0, 1);
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:8:float mindistance = 0, maxdistance = 1, CScale=1000;
k3d/share/shaders/k3d_depthcue_surf.sl:9:string debug="y";
k3d/share/shaders/k3d_depthcue_surf.sl:12:  float d;
k3d/share/shaders/k3d_depthcue_surf.sl:13:  d = clamp((depth(P) - mindistance) / (maxdistance - mindistance), 0, 1);
k3d/share/shaders/k3d_depthcue_surf.sl:15:  Ci = 1 - mix(Ci, (1,1,1), d)*CScale;
k3d/share/shaders/k3d_depthcue_surf.sl:16:	if (debug=="y")
k3d/share/shaders/k3d_depthcue_surf.sl:18:			printf("<debug shadername='k3d_depthcue_surf' shadertype='surface'>%p\t%f\t%f\t%c</debug>\n", P, depth(P), d, Ci);
k3d/share/shaders/k3d_displacementmap.sl:1:displacement k3d_displacementmap(float Km = 1;
k3d/share/shaders/k3d_distant_shadow.sl:1:light k3d_distant_shadow(
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:15:			if (shadowname != "") {
k3d/share/shaders/k3d_distant_shadow.sl:16:				Cl *= 1 - shadow(shadowname, Ps, "samples", samples,
k3d/share/shaders/k3d_distantlight.sl:1:/* distantlight.sl - Standard distant light source for RenderMan Interface.
k3d/share/shaders/k3d_distantlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_distantlight.sl: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:9:light k3d_distantlight(float intensity = 1;
k3d/share/shaders/k3d_distantlight.sl:11:		       point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_distantlight.sl:12:		       point to = point "shader"(0, 0, 1);)
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:8:#define M_E 2.7182818284590452354	/* e */
k3d/share/shaders/k3d_droop.sl:10:displacement 
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_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: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:24:  fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_dturb.sl:25:  turb += fade * abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_dturb.sl:29:  magnitude = pow(turb, flatness);
k3d/share/shaders/k3d_dturb.sl:33:  P += Km * magnitude * normalize(N);
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:9:k3d_easysurface(
k3d/share/shaders/k3d_easysurface.sl:10:	float	Kd	= .8, 
k3d/share/shaders/k3d_easysurface.sl:14:	float diffuse ;
k3d/share/shaders/k3d_easysurface.sl:18:	diffuse = II.NN / (II.II * NN.NN);
k3d/share/shaders/k3d_easysurface.sl:19:	diffuse = pow(diffuse, falloff);
k3d/share/shaders/k3d_easysurface.sl:21:	Ci = Cs * (Ka + Kd * diffuse ) ;
k3d/share/shaders/k3d_ember.sl:1:/* Glowing ember shader 2002 Graeme Nattress & NOITAMINANIMATION Inc.
k3d/share/shaders/k3d_ember.sl:5: * It is designed for use with particle systems where the particle is scaled
k3d/share/shaders/k3d_ember.sl:6: * to represent it's life. The desired effect is that of glowing particles that
k3d/share/shaders/k3d_ember.sl:7: * dim and fade as they die.
k3d/share/shaders/k3d_ember.sl:9: * baseSize = the basic diameter of the particle sphere before scaling
k3d/share/shaders/k3d_ember.sl:15:k3d_ember (	float baseSize = 2;
k3d/share/shaders/k3d_ember.sl:20:	point PP = transform ("world", P);
k3d/share/shaders/k3d_ember.sl:21:	point QQ = transform ("world", point "object" (0, 0, 0));
k3d/share/shaders/k3d_ember.sl:23:	float size = distance (PP, QQ) / baseSize;
k3d/share/shaders/k3d_ember.sl:25:	//size now represents the size of the sphere particle normalised into 0,1.
k3d/share/shaders/k3d_ember.sl:33:	Nf = faceforward(NN,I);
k3d/share/shaders/k3d_ember.sl:37:	// angle for edge opacity falloff
k3d/share/shaders/k3d_ember.sl:40:	// basically, the standard specular function, but so that the highlight is
k3d/share/shaders/k3d_ember.sl:63:	//only back face shade...
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:7: * 	map as sdixon() to define the lettering.
k3d/share/shaders/k3d_emboss.sl:9:displacement
k3d/share/shaders/k3d_emboss.sl:10:k3d_emboss(	
k3d/share/shaders/k3d_envsurf.sl:1:surface k3d_envsurf (string envname = "", envspace = "world")
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:9:k3d_eroded (
k3d/share/shaders/k3d_eroded.sl:16:	      magnitude = 0.0,
k3d/share/shaders/k3d_eroded.sl:25:		magnitude += 4.0 * abs (.5 - noise (W * size)) / size;
k3d/share/shaders/k3d_eroded.sl:30:	magnitude = magnitude * magnitude * magnitude * Km;
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:35:	Oi = smoothstep (0.0001, 0.003, magnitude);
k3d/share/shaders/k3d_eyeball.sl:2: * eyeball.sl -- RenderMan compatible shader for an eyeball.
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:15: *   bloodcolor - color of the blood vessels
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:22: *           non-identical eyeballs.
k3d/share/shaders/k3d_eyeball.sl:24: * ANTIALIASING: basic antialiasing of the boundaries between tissue types
k3d/share/shaders/k3d_eyeball.sl:25: *               is performed.
k3d/share/shaders/k3d_eyeball.sl:30: *      Nov 1991 - crude written of "eye" by lg for Herman's eyes for
k3d/share/shaders/k3d_eyeball.sl:31: *                 "Graphic Violence".  Original version hard coded in C.
k3d/share/shaders/k3d_eyeball.sl:32: *      Dec 1993 - "eye" modified by lg to clean up a bit.
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:40: * last modified  8 Jan 95 by Michael B. Johnson (wave)
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:52:	 color bloodcolor = color(.8,.05,.05);
k3d/share/shaders/k3d_eyeball.sl:55:	 float bloodshot = 1.0;
k3d/share/shaders/k3d_eyeball.sl:57:	 float index = 0;
k3d/share/shaders/k3d_eyeball.sl:60:#define snoise(P) (2*noise(P)-1)
k3d/share/shaders/k3d_eyeball.sl:61:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_eyeball.sl:66:  float displayed, newdisp;
k3d/share/shaders/k3d_eyeball.sl:69:  float bloody, tt;
k3d/share/shaders/k3d_eyeball.sl:71:  float twidth, cutoff;
k3d/share/shaders/k3d_eyeball.sl:73:  /* Calculate an appropriate filter width for antialiasing */
k3d/share/shaders/k3d_eyeball.sl:74:  twidth = max (abs(Du(t)*du) + abs(Dv(t)*dv), MINFILTERWIDTH);
k3d/share/shaders/k3d_eyeball.sl:75:  PO = transform ("object", P) + index;
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:84:  pupilstat = smoothstep (pupilsize, pupilsize+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:89:   * of the whites.  The veining pattern is essentially summed zero sets
k3d/share/shaders/k3d_eyeball.sl:90:   * of turbulence functions.  Some stretching is done to get it to look
k3d/share/shaders/k3d_eyeball.sl:93:  if (irisstat * bloody > 0.001) {
k3d/share/shaders/k3d_eyeball.sl:94:      turb = bloody;  freq = veinfreq;
k3d/share/shaders/k3d_eyeball.sl:95:      displayed = 0;
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:103:      Cball = mix (eyeballcolor, bloodcolor, smoothstep(0,.75,displayed));
k3d/share/shaders/k3d_eyeball.sl:109:   * just a stretched turbulence function.
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:126:  /* Make the eye a little glossier on the iris and pupil */
k3d/share/shaders/k3d_eyeball.sl:130:  /* Now shade like plastic, but using our calculated surface color and
k3d/share/shaders/k3d_eyeball.sl:131:   * our modified values for roughness and Ks.
k3d/share/shaders/k3d_eyeball.sl:134:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_eyeball.sl:135:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_ez.sl:2:k3d_ez(){
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:9:surface k3d_fakesky(vector up = (0,0,1); color skycolor = (.5, .6, 1.)) {

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:9:k3d_filament ( 
k3d/share/shaders/k3d_filament.sl:12:		width		= 0.3 )
k3d/share/shaders/k3d_filament.sl:14:	/* Calculate the distance of (s,t) from a spiral as a fraction [0,1] */
k3d/share/shaders/k3d_filament.sl:15:	float offset = mod((t*frequency + s + phase), 1.0);
k3d/share/shaders/k3d_filament.sl:17:	/* Threshold the fraction against the fractional filament width */
k3d/share/shaders/k3d_filament.sl:18:	if (offset < width) {
k3d/share/shaders/k3d_fill.sl:2: *simple toon fill shader with shadows
k3d/share/shaders/k3d_fill.sl:6:k3d_fill( 
k3d/share/shaders/k3d_fill.sl:7:	float	Kd			=   1, 
k3d/share/shaders/k3d_fill.sl:12:	normal Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_fill.sl:13:	Ci = Cs * (Ka*ambient() + Kd*(smoothstep(min,max,comp(diffuse(Nf),0))));
k3d/share/shaders/k3d_fire.sl: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: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: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:37:  fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_fire.sl:38:  turb += fade * abs(snoise2(ss * f, tt * f)) / f;
k3d/share/shaders/k3d_fire.sl:41:  /* index into color spline using turbulence */
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_flame.sl:2: * flame.sl -- RenderMan compatible surface shader for a flame-like texture.
k3d/share/shaders/k3d_flame.sl:8: *    distortion - 
k3d/share/shaders/k3d_flame.sl:10: *    flameheight, flameamplitude - scaling factors
k3d/share/shaders/k3d_flame.sl:13: *    None, but should be easy to add antialiasing simply by adaptively
k3d/share/shaders/k3d_flame.sl:14: *    setting the "octaves" parameter based on distance from eye point.
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: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:32:#define snoise(p) (2 * float noise(p) - 1)
k3d/share/shaders/k3d_flame.sl:33:#define DNoise(p) (2 * (point noise(p)) - point(1, 1, 1))
k3d/share/shaders/k3d_flame.sl:34:#define VLNoise(p, scale) (snoise(p + scale * DNoise(p)))
k3d/share/shaders/k3d_flame.sl:36:surface k3d_flame(float distortion = 0;
k3d/share/shaders/k3d_flame.sl:39:		  float flameamplitude = 2.0; float phase = 0.0)
k3d/share/shaders/k3d_flame.sl:52:      chaos += VLNoise(freq * PQ, distortion) / freq;
k3d/share/shaders/k3d_flame.sl:57:  cmap = 0.85 * chaos + flameoffset + (flameamplitude * ycomp(PP));
k3d/share/shaders/k3d_fog.sl:1:/* fog.sl - Standard fog volume shader for RenderMan Interface.
k3d/share/shaders/k3d_fog.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_fog.sl: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:11:  float d = 1 - exp(-length(I) / distance);
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: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:12:#define snoise(x) (2.5*(noise(x)-0.5))

k3d/share/shaders/k3d_fractal.sl:14:displacement

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:18:	point PP =transform("shader",P);

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: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_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:21:#define CHKTX(tx) \
k3d/share/shaders/k3d_fresnelplastic.sl:23:#endif
k3d/share/shaders/k3d_fresnelplastic.sl:25:surface k3d_fresnelplastic (
k3d/share/shaders/k3d_fresnelplastic.sl:27:			 desc {Base color for surface if 
k3d/share/shaders/k3d_fresnelplastic.sl:30:			    desc {Optional color map.  Replaces 'Csurf'.} */
k3d/share/shaders/k3d_fresnelplastic.sl: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:36:   float Ka= 1;       /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:37:   float Kd= 0.5;     /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:38:   float Ks= 0.5;     /* desc { Usual } */
k3d/share/shaders/k3d_fresnelplastic.sl:39:   float roughness= 0.1;  /* desc {Specular roughness} */
k3d/share/shaders/k3d_fresnelplastic.sl: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:43:   /* cat Reflection desc {Name of reflection map. } type texture */
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: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:63:    normal Nf = normalize (faceforward( normalize(N), I ));
k3d/share/shaders/k3d_fresnelplastic.sl:67:    /* Parametric space adjustments */
k3d/share/shaders/k3d_fresnelplastic.sl:81:    /* Calculate fresnel index of refraction */
k3d/share/shaders/k3d_fresnelplastic.sl:89:      /* fresnel turned off */
k3d/share/shaders/k3d_fresnelplastic.sl:109:    Ci = Os * ( fKt * Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_funkyglass.sl:1:/* funkyglass.sl - randomly colored "glass" (transparent, but no refl/refr).
k3d/share/shaders/k3d_funkyglass.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_funkyglass.sl: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:19:  Nf = faceforward(normalize(N), V);
k3d/share/shaders/k3d_funkyglass.sl:20:  PP = transform("shader", P);
k3d/share/shaders/k3d_funkyglass.sl:26:    (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_fur1.sl:3: *   - Simple algorithm: checkerboard

k3d/share/shaders/k3d_fur1.sl:10:displacement

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

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

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

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

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

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

k3d/share/shaders/k3d_fur2.sl:1:/* Renamed to SIG2k_srf_fur to be consistent with the RMR 
k3d/share/shaders/k3d_fur2.sl: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:13:fnc_diffuselgt (color Cin;       /* Light Colour */
k3d/share/shaders/k3d_fur2.sl:26:    /* diffuse calculation */
k3d/share/shaders/k3d_fur2.sl:35:#define luminance(c) comp(c,0)*0.299 + comp(c,1)*0.587 + comp(c,2)*0.114
k3d/share/shaders/k3d_fur2.sl:39:k3d_fur2( /* Hair Shading... */
k3d/share/shaders/k3d_fur2.sl:41:	 float Kd   = 0.77;
k3d/share/shaders/k3d_fur2.sl:48:	 float   end_spec = 0.95;
k3d/share/shaders/k3d_fur2.sl:49:	 float spec_size_fade  = 0.1;
k3d/share/shaders/k3d_fur2.sl:50:	 float illum_width  = 180;
k3d/share/shaders/k3d_fur2.sl:51:	 float var_fade_start = 0.005;
k3d/share/shaders/k3d_fur2.sl:52:	 float var_fade_end = 0.001;
k3d/share/shaders/k3d_fur2.sl:53:	 float clump_dark_strength = 0.0;
k3d/share/shaders/k3d_fur2.sl:61:	 /* Variables Passed from the rib... */
k3d/share/shaders/k3d_fur2.sl:66:	 uniform float hair_id   = 0.0; /* Watch Out... Across Patches */
k3d/share/shaders/k3d_fur2.sl:70:    vector T = normalize (dPdv); /* tangent along length of hair */
k3d/share/shaders/k3d_fur2.sl:72:    color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
k3d/share/shaders/k3d_fur2.sl:76:    vector S = nSN^T;     /* Cross product of the tangent along the hair and surface normal */
k3d/share/shaders/k3d_fur2.sl:77:    vector N_hair = (T^S); /* N_hair is a normal for the hair oriented "away" from the surface */
k3d/share/shaders/k3d_fur2.sl:79:    float  l = clamp(nSN.T,0,1);  /* Dot of surface_normal and T, used for blending */
k3d/share/shaders/k3d_fur2.sl:80:    float clump_darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:86:    float darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:93:    /* When the hair is exactly perpendicular to the surface, use the
k3d/share/shaders/k3d_fur2.sl:95:       surface, use the hair normal Otherwise, blend between the two
k3d/share/shaders/k3d_fur2.sl:104:    Kspec *= min( smoothstep( start_spec, start_spec + spec_size_fade, v),  
k3d/share/shaders/k3d_fur2.sl:105:		  1 - smoothstep( end_spec, end_spec - spec_size_fade, v ) );
k3d/share/shaders/k3d_fur2.sl:108:    /* Loop over lights, catch highlights as if this was a thin cylinder,
k3d/share/shaders/k3d_fur2.sl:110:       Specular illumination model from:
k3d/share/shaders/k3d_fur2.sl:111:       James T. Kajiya and Timothy L.  Kay (1989) "Rendering Fur with Three 
k3d/share/shaders/k3d_fur2.sl:115:    illuminance (P, norm_hair, radians(illum_width)) {
k3d/share/shaders/k3d_fur2.sl:125:	/* calculate diffuse component */
k3d/share/shaders/k3d_fur2.sl:126:	if ( clump_dark_strength > 0.0 ) {
k3d/share/shaders/k3d_fur2.sl:127:	    clump_darkening = 1 - ( clump_dark_strength * 
k3d/share/shaders/k3d_fur2.sl:130:	    clump_darkening = 1.0;
k3d/share/shaders/k3d_fur2.sl:139:	Cspec += (1-nonspecular) * SpecularColor * clump_darkening * 
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:153:    Ci =  ((Ka*ambient() + Kd*Cdiff + static_ambient) * final_c
k3d/share/shaders/k3d_glass.sl:6: *   reflections and refractions of the environment.
k3d/share/shaders/k3d_glass.sl:9: *    Ka, Kd, Ks, roughness, specularcolor - The usual meaning
k3d/share/shaders/k3d_glass.sl:12: *    envname, envspace, envrad - controls for using environment maps
k3d/share/shaders/k3d_glass.sl:14: *    Kt - coefficient for refracted transmission
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: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_gloop.sl:5: * an example of nonlinear displacements 
k3d/share/shaders/k3d_gloop.sl:6: * generated from the gradient of a noise function.
k3d/share/shaders/k3d_gloop.sl:8: * the "stupid renderman tricks" section of the 1998
k3d/share/shaders/k3d_gloop.sl:9: * Renderman Users Group meeting at siggraph.
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:16: * magnitude - how far to displace. probably fine set where it is.
k3d/share/shaders/k3d_gloop.sl:18: * displacement bounds can be computed with the following 
k3d/share/shaders/k3d_gloop.sl:19: * wildly complex formula:
k3d/share/shaders/k3d_gloop.sl:21: * 10*magnitude/freq
k3d/share/shaders/k3d_gloop.sl:25:displacement
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: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:57:    DdPdu = normalize(DdPdu+(step*chu));
k3d/share/shaders/k3d_gloop.sl:58:    DdPdv = normalize(DdPdv+(step*chv));
k3d/share/shaders/k3d_gloop.sl:59:    step = DdPdu^DdPdv;
k3d/share/shaders/k3d_gloop.sl:62:  /* wash your hands after displacing P*/
k3d/share/shaders/k3d_glow.sl:1:surface k3d_glow(float attenuation = 2.0;
k3d/share/shaders/k3d_glow.sl: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:8:  incidence = I.N;
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:12:      incidence = incidence * incidence / (I.I * N.N);
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_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:12: *   darkcolor, lightcolor - colors of the underlying substrate
k3d/share/shaders/k3d_gmarbtile_polish.sl:17: *   groovewidth - the width of the grooves
k3d/share/shaders/k3d_gmarbtile_polish.sl:23:#include "k3d_noises.h"
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:32:			     color darkcolor = color(0.01, 0.12, 0.004);
k3d/share/shaders/k3d_gmarbtile_polish.sl:39:			     float groovewidth = 0.015;
k3d/share/shaders/k3d_gmarbtile_polish.sl:41:			     uniform float envrad = 100, rayjitter =
k3d/share/shaders/k3d_gmarbtile_polish.sl:47:  vector refldir;
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: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: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:84:  dPP *= veinfreq;
k3d/share/shaders/k3d_gmarbtile_polish.sl:87:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
k3d/share/shaders/k3d_gmarbtile_polish.sl:94:	       filteredsnoise(2 * (PP + vector(-4.4, 8.34, 27.1)), 2 * dPP));
k3d/share/shaders/k3d_gmarbtile_polish.sl:100:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_gmarbtile_polish.sl:108:  Ci = Oi * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) + env);
k3d/share/shaders/k3d_gooch.sl:1:/* Renamed to MKgooch.sl for RMR -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_gooch.sl: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:13: *  Kd           : diffuse 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:27:k3d_gooch (float Ka = 0;
k3d/share/shaders/k3d_gooch.sl:28:         float Kd = 1;
k3d/share/shaders/k3d_gooch.sl:37:    normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_gooch.sl:42:    float ldotn, blendval;
k3d/share/shaders/k3d_gooch.sl:48:        ldotn = (normalize(L)).Nf;
k3d/share/shaders/k3d_gooch.sl:49:        blendval = 0.5*(1+ldotn);
k3d/share/shaders/k3d_gooch.sl:50:        Cgooch += mix(kcool,kwarm,blendval); 
k3d/share/shaders/k3d_gooch.sl:55:                Kd*Cgooch +
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:8:displacement
k3d/share/shaders/k3d_gouge.sl:9:k3d_gouge(
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_gradient_t.sl:1:surface k3d_gradient_t(
k3d/share/shaders/k3d_gradient_t.sl:3:	color end_color = color(1, 1, 0);
k3d/share/shaders/k3d_gradient_t.sl:4:	float additive = 0.0;
k3d/share/shaders/k3d_gradient_t.sl:7:	color C = mix(start_color, end_color, t);
k3d/share/shaders/k3d_gradient_t.sl:9:	if(additive != 0.0)
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:9:k3d_granite(
k3d/share/shaders/k3d_granite.sl:10:	float	Kd	= .8,
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:4:        float Kd=1.0;
k3d/share/shaders/k3d_graphic_lines.sl:18:        float randomness_highlight=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:33:				float Kd_highlight=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:41:        float randomness_paint=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:56:				float Kd_paint=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:64:        float randomness_ink=0.0;
k3d/share/shaders/k3d_graphic_lines.sl:79:				float Kd_ink=0.70;
k3d/share/shaders/k3d_graphic_lines.sl:84:	/** Surface main-code start **/
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:117:		tt_highlight=mod(z_highlight,1);
k3d/share/shaders/k3d_graphic_lines.sl:122:		tt_highlight=mod(y_highlight,1);
k3d/share/shaders/k3d_graphic_lines.sl:126:		tt_highlight=mod(x_highlight,1);
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: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: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:159:	P_highlight+=0*Ndisp_highlight;
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: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:193:		tt_paint=mod(z_paint,1);
k3d/share/shaders/k3d_graphic_lines.sl:198:		tt_paint=mod(y_paint,1);
k3d/share/shaders/k3d_graphic_lines.sl:202:		tt_paint=mod(x_paint,1);
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: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: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:231:	P_paint+=0*Ndisp1;
k3d/share/shaders/k3d_graphic_lines.sl:232:	N_paint=normalize(calculatenormal(P_paint+(1-0)*Ndisp1));
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:265:		tt_ink=mod(z_ink,1);
k3d/share/shaders/k3d_graphic_lines.sl:270:		tt_ink=mod(y_ink,1);
k3d/share/shaders/k3d_graphic_lines.sl:274:		tt_ink=mod(x_ink,1);
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: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: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:303:	P_ink+=0*Ndisp2;
k3d/share/shaders/k3d_graphic_lines.sl:304:	N_ink=normalize(calculatenormal(P_ink+(1-0)*Ndisp2));
k3d/share/shaders/k3d_graphic_lines.sl:308:	/** blend 3 layers **/
k3d/share/shaders/k3d_graphic_lines.sl:310:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_graphic_lines.sl:311:#define union(a,b) ((a) + (b) - (a) * (b))
k3d/share/shaders/k3d_graphic_lines.sl:327:	float diff, spec;
k3d/share/shaders/k3d_graphic_lines.sl:334:	Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_graphic_lines.sl:337:	/* background layer  */
k3d/share/shaders/k3d_graphic_lines.sl:344:	diff = 0;
k3d/share/shaders/k3d_graphic_lines.sl:346:	diff += normalize(L).Nf;
k3d/share/shaders/k3d_graphic_lines.sl:349:	diff = smoothstep(paint_trans - paint_fuzz/2, paint_trans + paint_fuzz/2, diff);
k3d/share/shaders/k3d_graphic_lines.sl:351:	/* specular -- transition also antialiased */
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:358:	gline_color = blend(gline_color, layer_color, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:373:	gline_color = blend(gline_color, layer_color, layer_opac);
k3d/share/shaders/k3d_graphic_lines.sl:379:	/** Surface main-code end **/
k3d/share/shaders/k3d_grass_displace.sl:4: * I took used some of RManNotes function to assist in

k3d/share/shaders/k3d_grass_displace.sl: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:13:#include "k3d_rmannotes.h"

k3d/share/shaders/k3d_grass_displace.sl:15:displacement

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

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

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

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

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

k3d/share/shaders/k3d_grass_displace.sl:38:      y = (tmod - 0.5)*10;

k3d/share/shaders/k3d_grass_displace.sl:39:      x = smod*10; 

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

k3d/share/shaders/k3d_grass_displace.sl:50:      x = (smod - 0.5)*10;

k3d/share/shaders/k3d_grass_displace.sl:51:      y = tmod*10; 

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

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:17:  point Nf = faceforward(normalize(N),I);

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

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

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

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

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

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

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

k3d/share/shaders/k3d_grass_surface.sl: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: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:8: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic
k3d/share/shaders/k3d_greenmarble.sl:10: *   darkcolor, lightcolor - colors of the underlying substrate
k3d/share/shaders/k3d_greenmarble.sl:20:#include "k3d_noises.h"
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:27:			color darkcolor = color(0.01, 0.12, 0.004);
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: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:53:  PP += vector(35.2, -21.9, 6.25) + 0.5 * vfBm(PP, dPP, 6, 2, 0.5);
k3d/share/shaders/k3d_greenmarble.sl:61:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
k3d/share/shaders/k3d_greenmarble.sl:72:   * Shade like plastic
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:6:float K_diffuse=0.381; 
k3d/share/shaders/k3d_grids.sl:15:float G1L1_linewidth=0.579; 
k3d/share/shaders/k3d_grids.sl:16:float G1L1_Randomness=0;
k3d/share/shaders/k3d_grids.sl:18:color G1L1_GridColor=color(0,0,0); 
k3d/share/shaders/k3d_grids.sl:23:float G1L2_linewidth=0.209; 
k3d/share/shaders/k3d_grids.sl:24:float G1L2_Randomness=0;
k3d/share/shaders/k3d_grids.sl:26:color G1L2_GridColor=color(0,0,0); 
k3d/share/shaders/k3d_grids.sl:31:float G2L1_linewidth=0.281; 
k3d/share/shaders/k3d_grids.sl:32:float G2L1_Randomness=0;
k3d/share/shaders/k3d_grids.sl:34:color G2L1_GridColor=color(0,0,0); 
k3d/share/shaders/k3d_grids.sl:39:float G2L2_linewidth=0.149; 
k3d/share/shaders/k3d_grids.sl:40:float G2L2_Randomness=0;
k3d/share/shaders/k3d_grids.sl: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:48:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids.sl:49:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids.sl:50:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids.sl:51:#define snoise(x) (2*noise(x)-1) 
k3d/share/shaders/k3d_grids.sl:57:float blend_val=0.5; 
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: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: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: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: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: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:99:Oi = (blend_val*G2L1_Ct+(1-blend_val)*G2L2_Ct);
k3d/share/shaders/k3d_grids_disp.sl:4: Displace (normal dir; float amp; float truedisp;)
k3d/share/shaders/k3d_grids_disp.sl:7: float spacescale = length(vtransform("shader", dir));
k3d/share/shaders/k3d_grids_disp.sl: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:17:float linewidth0=0.368; 
k3d/share/shaders/k3d_grids_disp.sl:19:color GridColor=color(0,0,0); 
k3d/share/shaders/k3d_grids_disp.sl:23:float linewidth1=0.122; )
k3d/share/shaders/k3d_grids_disp.sl:26:#define repeat(x,freq) (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_grids_disp.sl:27:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids_disp.sl:28:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids_disp.sl:29:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids_disp.sl:33:rotate2d(s, t, radians(rotation0), 0.5, 0.5, ss0, tt0);
k3d/share/shaders/k3d_grids_disp.sl:37:color layer_opac0 = pulse(linewidth0, 1-linewidth0, fuzz0, tt0);
k3d/share/shaders/k3d_grids_disp.sl:38:color Ct0 = blend(SurfaceColor, GridColor, layer_opac0);
k3d/share/shaders/k3d_grids_disp.sl:39:#define repeat(x,freq) (mod((x) * (freq), 1.0))
k3d/share/shaders/k3d_grids_disp.sl:40:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_grids_disp.sl:41:#define rotate2d(x,y,rad,ox,oy,rx,ry) rx = ((x) - (ox)) * cos(rad) - ((y) - (oy)) * sin(rad) + (ox); ry = ((x) - (ox)) * sin(rad) + ((y) - (oy)) * cos(rad) + (oy)
k3d/share/shaders/k3d_grids_disp.sl:42:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_grids_disp.sl:46:rotate2d(s, t, radians(rotation1), 0.5, 0.5, ss1, tt1);
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_hair.sl:1:/** From RenderMan AppNote #19 */
k3d/share/shaders/k3d_hair.sl:3:surface k3d_hair(
k3d/share/shaders/k3d_hair.sl:5:	float Kd = .6;
k3d/share/shaders/k3d_hair.sl:13:	vector T = normalize (dPdv); /* tangent along length of hair */
k3d/share/shaders/k3d_hair.sl:15:	color Cspec = 0, Cdiff = 0;  /* collect specular & diffuse light */
k3d/share/shaders/k3d_hair.sl:18:	/* Loop over lights, catch highlights as if this was a thin cylinder */
k3d/share/shaders/k3d_hair.sl:23:			Cdiff += Cl * v;
k3d/share/shaders/k3d_hair.sl: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: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: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:44:	string envspace = "shader";

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

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

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

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

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

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

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

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

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

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

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

k3d/share/shaders/k3d_hdr_light.sl:77:				Ct = hdrenv(envname,R,blur);

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

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

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

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: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: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:43:	string envspace = "shader";

k3d/share/shaders/k3d_hdr_surface.sl:56:			Ct = hdrenv(envname,R,blur);

k3d/share/shaders/k3d_hdri1.sl:1:light k3d_hdri1 (string envname = "")
k3d/share/shaders/k3d_hdri2.sl:2:k3d_hdri2 (float intensity = 1;
k3d/share/shaders/k3d_hdri2.sl:5:       string envspace = "world";
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:9:       float shadowbias = 0.01;
k3d/share/shaders/k3d_hdri2.sl:10:       float shadowsamples = 1;)
k3d/share/shaders/k3d_hdri2.sl:17:        if (shadowname != "")
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:5:* A simple bump shader that tile a "Hexagon" pattern
k3d/share/shaders/k3d_hexatile_bump.sl:9:* 	string Name 	= "FGHexaTile_bump"	---	Name of the shader "do nothing".
k3d/share/shaders/k3d_hexatile_bump.sl:10:*	float Edge1	=.2 			---	Minvalue of Edge.
k3d/share/shaders/k3d_hexatile_bump.sl:11:*	float Edge2	=.5 			---	Maxvalue of Edge.
k3d/share/shaders/k3d_hexatile_bump.sl:12:*	float ScaleSS	= 3 			---	Scale the "s" direction.
k3d/share/shaders/k3d_hexatile_bump.sl:13:*	float ScaleTT	= 3 			---	Scale the "t" direction.
k3d/share/shaders/k3d_hexatile_bump.sl:14:*	float Rotate	= 180 			---	Rotate the tile default "Z-direction"
k3d/share/shaders/k3d_hexatile_bump.sl:16:*	point P2	= point(0,0,1) 		---	The x,y,z direction for Rotate.
k3d/share/shaders/k3d_hexatile_bump.sl:18:*	string Space	  = "shader" 		---	Space for projection.
k3d/share/shaders/k3d_hexatile_bump.sl:21:*	float C2	= 2 			---	Multiply of f2 the second closes future point.
k3d/share/shaders/k3d_hexatile_bump.sl:22:*	float Km	= -.015 		---	Diplacement amplitude.
k3d/share/shaders/k3d_hexatile_bump.sl:23:*	float Truedisp	= 1 			---	True Displacement 0 = off, 1 = on.
k3d/share/shaders/k3d_hexatile_bump.sl:28:* Author: Fredrik Gustafsson, gusten@SpamSucks_algonet.se
k3d/share/shaders/k3d_hexatile_bump.sl: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:41:void
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:56:/* Hexagon code */
k3d/share/shaders/k3d_hexatile_bump.sl:57:if ((hexagon != 0) && abs(mod(stestcell, 2)) < 1)
k3d/share/shaders/k3d_hexatile_bump.sl:60:	float spos = stestcell + jitter * (float cellnoise(stestcell,seed+ttestcell) - 0.5);
k3d/share/shaders/k3d_hexatile_bump.sl:61:	float tpos = ttestcell + jitter * (float cellnoise(stestcell+23,seed+ttestcell-87) - 0.5);
k3d/share/shaders/k3d_hexatile_bump.sl:64:	float dist = soffset*soffset + toffset*toffset;
k3d/share/shaders/k3d_hexatile_bump.sl:66:if (dist < f1) {
k3d/share/shaders/k3d_hexatile_bump.sl:68:	f1 = dist; spos1 = spos; tpos1 = tpos;
k3d/share/shaders/k3d_hexatile_bump.sl:69:} else if (dist < f2) {
k3d/share/shaders/k3d_hexatile_bump.sl:70:	f2 = dist;
k3d/share/shaders/k3d_hexatile_bump.sl:78:displacement k3d_hexatile_bump (
k3d/share/shaders/k3d_hexatile_bump.sl:80:	float Edge1	=.2; 
k3d/share/shaders/k3d_hexatile_bump.sl:81:	float Edge2	=.5; 
k3d/share/shaders/k3d_hexatile_bump.sl: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:112:float smoothp_20 = smoothpulse (0,Edge1,Edge2,1,SQRT_f2);
k3d/share/shaders/k3d_hexatile_bump.sl:118:float smoothp_22 = smoothpulse (0,Edge1,Edge2,1,SQRT_f1);
k3d/share/shaders/k3d_hexatile_bump.sl:120:/*** ----- True Displacement and bump ----- ***/
k3d/share/shaders/k3d_hexatile_bump.sl:122:Displace (normal dir; vector space; float amp; float truedisp;)
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:133:float disp = clamp(smoothp_20*smoothp_22,0,0.95);
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:7: *    places and such.
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:16: *    Ka, Kd, Ks, roughness, specularcolor - work just like plastic
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: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:36: * last modified 15 Feb 94 by Larry Gritz
k3d/share/shaders/k3d_hextile.sl:40:#define snoise(x) (2*noise(x)-1)
k3d/share/shaders/k3d_hextile.sl:41:#define snoise2(x,y) (2*noise((x),(y))-1)
k3d/share/shaders/k3d_hextile.sl:45:k3d_hextile (float Ka = .5;
k3d/share/shaders/k3d_hextile.sl:46:         float Kd = .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:63:  float tilewidth;
k3d/share/shaders/k3d_hextile.sl:68:  float swidth, twidth, sfuzz, tfuzz, fuzzmax;
k3d/share/shaders/k3d_hextile.sl:70:  float tileindex;
k3d/share/shaders/k3d_hextile.sl:74:  /* Determine how wide in s-t space one pixel projects to */
k3d/share/shaders/k3d_hextile.sl:75:  swidth = abs(Du(s)*du) + abs(Dv(s)*dv);
k3d/share/shaders/k3d_hextile.sl:76:  twidth = abs(Du(t)*du) + abs(Dv(t)*dv);
k3d/share/shaders/k3d_hextile.sl:77:  sfuzz = 0.5 * swidth;
k3d/share/shaders/k3d_hextile.sl:78:  tfuzz = 0.5 * twidth;
k3d/share/shaders/k3d_hextile.sl: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:84:  if (mod (ttile/2, 1) == 0.5)
k3d/share/shaders/k3d_hextile.sl:85:       ss = s + tilewidth/2;
k3d/share/shaders/k3d_hextile.sl:87:  stile = floor (ss / tilewidth);
k3d/share/shaders/k3d_hextile.sl:88:  ss = mod (ss, tilewidth);
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:93:		     (1 - smoothstep(tilewidth-mw2-sfuzz,tilewidth-mw2,ss)));
k3d/share/shaders/k3d_hextile.sl:96:      x = tilewidth/2 - abs (ss - tilewidth/2);
k3d/share/shaders/k3d_hextile.sl:97:      y = 1.7320508 * (tt - tileradius);
k3d/share/shaders/k3d_hextile.sl:99:	  if (mod (ttile/2, 1) == 0.5)
k3d/share/shaders/k3d_hextile.sl:102:	  if (ss > tilewidth/2)
k3d/share/shaders/k3d_hextile.sl:109:  tileindex = stile+41*ttile;
k3d/share/shaders/k3d_hextile.sl:110:  Ctile = tilecolor * (1 + tilevary * snoise(tileindex+0.5));
k3d/share/shaders/k3d_hextile.sl:120:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_hextile.sl:121:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_imagelayerclouds.sl:1:// Use signed Perlin noise
k3d/share/shaders/k3d_imagelayerclouds.sl:2:#define snoise(x) ((2 * noise(x)) - 1)
k3d/share/shaders/k3d_imagelayerclouds.sl:5:surface k3d_imagelayerclouds(float txtscale = 1;
k3d/share/shaders/k3d_imagelayerclouds.sl:7:			     color cloudcolor = color(1, 1, 1);
k3d/share/shaders/k3d_imagelayerclouds.sl:8:			     float octaves = 8, omega = 0.5, lambda = 2;
k3d/share/shaders/k3d_imagelayerclouds.sl:9:			     float threshold = 0.5;)
k3d/share/shaders/k3d_imagelayerclouds.sl: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:20:/*  value = fBm (PP, omega, lambda, octaves); */
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: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:4: * Este es un shader plastico con componente de

k3d/share/shaders/k3d_incandplastic.sl:5: * incandescencia como el contenido en un Blinn. 

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:11:k3d_incandplastic(color SurfaceColor = color(0, 0.25, 1);

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

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

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

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

k3d/share/shaders/k3d_incandplastic.sl:27:			 Incandescence);

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:16:#ifdef BMRT
k3d/share/shaders/k3d_indirect.sl:17:  /* Just in case this is ever compiled for BMRT, make it do nothing. */
k3d/share/shaders/k3d_indirect.sl:28:    Cl = rs_indirect(Ps, axis);
k3d/share/shaders/k3d_indirect.sl:30:#endif
k3d/share/shaders/k3d_leather.sl:4: * I have done this shader from JMredapple.sl for RMR

k3d/share/shaders/k3d_leather.sl: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:18:k3d_leather (

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

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:33:	float BLOTCH_SF = 5;		/*definis le s */

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

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

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

k3d/share/shaders/k3d_leather.sl: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:48:	float small_noise, blotch, speck, disp = 0, blackness;

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:66:	 * and patches of finely speckled red and green. These

k3d/share/shaders/k3d_leather.sl:68:	 * goes to 1 or 0) are colored more and more green.

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: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:107:	 * The blotch color is finally determined by mixing,

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

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

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

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

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

k3d/share/shaders/k3d_leather.sl: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: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:146:	#define BEDGE  .0

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

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

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

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:168:	 * un-dented).

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

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

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

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

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

k3d/share/shaders/k3d_leather.sl:175:	disp += noise(DISP_SF*sin(2*PI*s) + PI + label,

k3d/share/shaders/k3d_leather.sl:177:	disp += small_noise * DISP_SMNOISE_AMP * txtscale / TSCALE;

k3d/share/shaders/k3d_leather.sl:178:	disp -= speck * DISP_SPECK_AMP * txtscale / TSCALE;

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: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:194:#ifdef USE_LG_RAYTRACE

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:203:#endif

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

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

k3d/share/shaders/k3d_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: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:16: *   bloomradius, bloomfalloff - control the size & shape of the bloom
k3d/share/shaders/k3d_lensflare.sl:18: *          bloom effect (bloomstarry=0 means perfectly round bloom)
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:23: *   rainbowradius, rainbowwidth - size of the rainbow
k3d/share/shaders/k3d_lensflare.sl:24: *   nspots - number of "spots" splayed out on the axis joining the
k3d/share/shaders/k3d_lensflare.sl:26: *   disky, ringy, blotty, bloony - give the relative proportions of
k3d/share/shaders/k3d_lensflare.sl:27: *          the 4 different kinds of spots.
k3d/share/shaders/k3d_lensflare.sl:30: *   seed - random number seed for many of the computations
k3d/share/shaders/k3d_lensflare.sl:37: * Author: Larry Gritz & Tony Apodaca, 1999
k3d/share/shaders/k3d_lensflare.sl:45:#include "k3d_patterns.h"
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: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:91:		      float starburstradius = 0.5;
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: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:131:    nrand = 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:142:    float dist = length(Lvec);
k3d/share/shaders/k3d_lensflare.sl:146:	float radius = sqrt(brightness) * 5 * mix(.2, bloomradius, urand());
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:157:	float radius =
k3d/share/shaders/k3d_lensflare.sl:158:	  sqrt(brightness) * 5 * mix(.2, starburstradius, urand());
k3d/share/shaders/k3d_lensflare.sl:162:	  pow(1 - smoothstep(0.0, radius * star, dist), starburstfalloff);
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:180:    nrand = 20;			/* Reset on purpose! */
k3d/share/shaders/k3d_lensflare.sl:183:	uniform float alongaxis = urand();
k3d/share/shaders/k3d_lensflare.sl:185:	float axisdist = distance(cntr, Pndc);
k3d/share/shaders/k3d_lensflare.sl:186:	float radius = mix(0.04, .1,
k3d/share/shaders/k3d_lensflare.sl:187:			   pow(urand(), 2)) * distance(cntr, Plight);
k3d/share/shaders/k3d_lensflare.sl:190:	float bright = 1 - (2 * radius);
k3d/share/shaders/k3d_lensflare.sl:193:	uniform float alltypes = (disky + ringy + blotty + bloony);
k3d/share/shaders/k3d_lensflare.sl:194:	uniform float type = urand() * alltypes;
k3d/share/shaders/k3d_lensflare.sl:198:	if(type < disky)
k3d/share/shaders/k3d_lensflare.sl:199:	  {			/* Flat disk */
k3d/share/shaders/k3d_lensflare.sl:200:	    int = 1 - filterstep(radius, axisdist - dPndc / 2,
k3d/share/shaders/k3d_lensflare.sl:201:				 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:206:				axisdist, dPndc);
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:213:	  {			/* Spot with soft hole in middle */
k3d/share/shaders/k3d_lensflare.sl:214:	    int = smoothstep(0, radius, axisdist) - filterstep(radius,
k3d/share/shaders/k3d_lensflare.sl:215:							       axisdist -
k3d/share/shaders/k3d_lensflare.sl:216:							       dPndc / 2,
k3d/share/shaders/k3d_lensflare.sl:217:							       axisdist +
k3d/share/shaders/k3d_lensflare.sl:218:							       dPndc / 2);
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: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: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:25:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_luna.sl:28:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_luna.sl:29:#define VLNoise(Pt,scale) (snoise(Pt + scale*DNoise(Pt)))
k3d/share/shaders/k3d_luna.sl:30:#define TWOPI (6.28)
k3d/share/shaders/k3d_luna.sl:33:surface k3d_luna(float Ka = .5, Kd = 1;
k3d/share/shaders/k3d_luna.sl:37:		 color highland_color = .7;
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:45:		 float rayfade = 1;	/* arg11 */
k3d/share/shaders/k3d_luna.sl:48:  float radial_dist;
k3d/share/shaders/k3d_luna.sl:58:  float pd;			/* pole distance */
k3d/share/shaders/k3d_luna.sl:59:  float raydist;
k3d/share/shaders/k3d_luna.sl:62:  PP = transform("shader", P);
k3d/share/shaders/k3d_luna.sl:64:  radial_dist = sqrt(xcomp(PP) * xcomp(PP) + ycomp(PP) * ycomp(PP));
k3d/share/shaders/k3d_luna.sl:82:  temp1 = radial_dist * arg22;
k3d/share/shaders/k3d_luna.sl:86:  if(chaos > highland_threshold)
k3d/share/shaders/k3d_luna.sl:88:      PQ += chaos * highland_altitude * NN;
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:99:  /* Add crater */
k3d/share/shaders/k3d_luna.sl:100:  /* get normalized vector "v" */
k3d/share/shaders/k3d_luna.sl:101:  pd = 1 - 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:106:      uu = 1 - pd / peak_rad;
k3d/share/shaders/k3d_luna.sl:110:  else if(pd < inner_rad)
k3d/share/shaders/k3d_luna.sl:114:  else if(pd < rim_rad)
k3d/share/shaders/k3d_luna.sl:116:      uu = (pd - inner_rad) / (rim_rad - inner_rad);
k3d/share/shaders/k3d_luna.sl:120:  else if(pd < outer_rad)
k3d/share/shaders/k3d_luna.sl:122:      uu = 1 - (pd - rim_rad) / (outer_rad - rim_rad);
k3d/share/shaders/k3d_luna.sl:132:  /* Add some noise */
k3d/share/shaders/k3d_luna.sl:135:      if(pd < peak_rad)
k3d/share/shaders/k3d_luna.sl:147:/*	  ht = wrinkled (vv, 2, .833, 4); */
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:182:  /* Recalc normal since we changed P a whole bunch. */
k3d/share/shaders/k3d_luna.sl:185:  /* Shade like matte */
k3d/share/shaders/k3d_luna.sl:187:  Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N), I)));
k3d/share/shaders/k3d_lunette.sl:1:/* renamed JMlinette.sl for RMR.  -- tal */
k3d/share/shaders/k3d_lunette.sl:4: * lunette.sl -- A pretty surface shader ideal for "ground planes".
k3d/share/shaders/k3d_lunette.sl:7: *   A grid pattern overlaid upon an fBm noise.  This shader is good for
k3d/share/shaders/k3d_lunette.sl:8: *   surfaces placed beneath your scene which act as the ground.  The default
k3d/share/shaders/k3d_lunette.sl: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: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: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: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: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:38:#include "k3d_noises.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: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:62: *   colorBenhance - After the noise has been calculated, there exists the
k3d/share/shaders/k3d_lunette.sl:65: *                   colorA and colorB are present in equal amounts.
k3d/share/shaders/k3d_lunette.sl:67: *   gridDensity - Effective opacity of the grid pattern over the underlying
k3d/share/shaders/k3d_lunette.sl:69: *   baselinecolor - Base color of the grid lines.
k3d/share/shaders/k3d_lunette.sl:72:	float ss;		/* ss coordinate for the lunette pattern */
k3d/share/shaders/k3d_lunette.sl:73:	float tt;		/* tt coordinate for the lunette pattern */
k3d/share/shaders/k3d_lunette.sl:74:	float ssrepeats;	/* number of repeats in the ss direction */
k3d/share/shaders/k3d_lunette.sl:75:	float ttrepeats;	/* number of repeats in the tt direction */
k3d/share/shaders/k3d_lunette.sl:76:	float sslinewidth;	/* proportional width of lines in ss */
k3d/share/shaders/k3d_lunette.sl:77:	float ttlinewidth;	/* proportional width of lines in tt */
k3d/share/shaders/k3d_lunette.sl: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:86:	float gridDensity;	/* density of the grid pattern */
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: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: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:134:	float Kd = .5;
k3d/share/shaders/k3d_lunette.sl:138:	/* Grid pattern parameters. */	
k3d/share/shaders/k3d_lunette.sl:140:	float ulinewidth = 0.125;	/* Relative width of grid lines in u */
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:148:	float gridDensity = .5;		/* Effective opacity of the grid */
k3d/share/shaders/k3d_lunette.sl:151:	float noiseRandom = 0;
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:166:	 * apply a plastic illumination model
k3d/share/shaders/k3d_lunette.sl:168:	normal Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_lunette.sl:171:	Ci = Os * ( cc * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_map_pattern_1.sl:1:surface k3d_map_pattern_1 (
k3d/share/shaders/k3d_map_pattern_1.sl:4:float swidth1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl:5:float twidth1=1; 
k3d/share/shaders/k3d_map_pattern_1.sl: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:14:float Kd = .5; 
k3d/share/shaders/k3d_map_pattern_1.sl:20:/** Surface main-code start **/
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:51:PP = txtscale * transform ("shader", P);
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: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:10:		  float Kd = 1;)
k3d/share/shaders/k3d_matte.sl:12:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_matte.sl:14:  Ci = Os * Cs * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_metal.sl:1:/* metal.sl - Standard metal surface for RenderMan Interface.
k3d/share/shaders/k3d_metal.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_metal.sl: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:13:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_mondometal.sl:1:/* MondoMetal.sl   Felipe Esquivel, july 2001

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:12:k3d_mondometal(

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:44:    float Kd = 0.80;

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:62:    color Csurf, Cspec, Copac, Cincand, Crefl;

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

k3d/share/shaders/k3d_mondometal.sl: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:74:                            "swidth", abColorMapBlur,

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

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: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:104:        diff = abDiffuse;

k3d/share/shaders/k3d_mondometal.sl:107:    /* determine specular */

k3d/share/shaders/k3d_mondometal.sl:111:                            "swidth", abSpecularMapBlur,

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

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

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

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

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

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

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

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

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

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

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:161:    if(abIncandescenseMap != "")

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:169:        Cincand = abIncandescence;

k3d/share/shaders/k3d_mondometal.sl:173:    /* do the bump */

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: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:206:        D = vtransform("worldspace", 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: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:239:      Ci = Cmetal * Oi * (Ka * ambient() + Kd * diffuse(Nf) +

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

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

k3d/share/shaders/k3d_mysky.sl:7: *                   clouds.

k3d/share/shaders/k3d_mysky.sl:10: *    Makes nice looking cumulous clouds like you would see in the sky

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:15: *    easy to add the lighting.

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:24: *    None, but should be easy to add antialiasing simply by adaptively

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

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: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:47:#define snoise(x) ((2*noise(x))-1)

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

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

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

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

k3d/share/shaders/k3d_mysky.sl: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:67:  /*  value = fBm (PP, omega, lambda, octaves); */

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:1:#define snoise(p) (2*noise(p)-1)
k3d/share/shaders/k3d_noisysmoke.sl:4:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_noisysmoke.sl:5:#define GADD(PP,PW,li,g)                                                    \
k3d/share/shaders/k3d_noisysmoke.sl:21:             g = density * smoothstep(-1,1,smokevary*smoke);                \
k3d/share/shaders/k3d_noisysmoke.sl:22:         } else g = density;                                                \
k3d/share/shaders/k3d_noisysmoke.sl:30:volume k3d_noisysmoke(float density = 60;
k3d/share/shaders/k3d_noisysmoke.sl:31:		      float integstart = 0, integend = 100;
k3d/share/shaders/k3d_noisysmoke.sl:32:		      float stepsize = 0.1; float debug = 0;
k3d/share/shaders/k3d_noisysmoke.sl:40:  /* PRMan and BMRT used to have I reverse of each other, conflict in spec */
k3d/share/shaders/k3d_noisysmoke.sl:42:  vector incident = vtransform("shader", -I);
k3d/share/shaders/k3d_noisysmoke.sl:44:  /* But with BMRT 2.3.6 and later, they're the same... */
k3d/share/shaders/k3d_noisysmoke.sl:46:  vector incident = vtransform("shader", I);
k3d/share/shaders/k3d_noisysmoke.sl:47:#endif
k3d/share/shaders/k3d_noisysmoke.sl:48:  point origin = transform("shader", Worigin);
k3d/share/shaders/k3d_noisysmoke.sl:50:  float d, tau;
k3d/share/shaders/k3d_noisysmoke.sl:52:  color dC, dO;			/* differential color & opacity */
k3d/share/shaders/k3d_noisysmoke.sl:53:  float ss, dtau, last_dtau, end;
k3d/share/shaders/k3d_noisysmoke.sl:54:  float nsteps = 0;		/* record number of integration steps */
k3d/share/shaders/k3d_noisysmoke.sl:61:  end = min(length(incident), integend) - 0.0001;
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:65:  if(d < end)
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:71:      GADD(PP, PW, li, dtau) ss = min(stepsize, end - d);
k3d/share/shaders/k3d_noisysmoke.sl:72:      d += ss;
k3d/share/shaders/k3d_noisysmoke.sl:75:      while(d <= end)
k3d/share/shaders/k3d_noisysmoke.sl:77:	  last_dtau = dtau;
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:81:	  GADD(PP, PW, li, dtau)
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:85:	    tau = .5 * ss * (dtau + last_dtau);
k3d/share/shaders/k3d_noisysmoke.sl:86:	  lighttau = .5 * ss * (li * dtau + last_li * last_dtau);
k3d/share/shaders/k3d_noisysmoke.sl:89:	  dO =
k3d/share/shaders/k3d_noisysmoke.sl:92:	  dC = lighttau * dO;
k3d/share/shaders/k3d_noisysmoke.sl:94:	  /* Now we adjust Cv/Ov to account for dC and dO */
k3d/share/shaders/k3d_noisysmoke.sl:95:	  Cv += (1 - Ov) * dC;
k3d/share/shaders/k3d_noisysmoke.sl:96:	  Ov += (1 - Ov) * dO;
k3d/share/shaders/k3d_noisysmoke.sl:98:	  ss = max(min(ss, end - d), 0.005);
k3d/share/shaders/k3d_noisysmoke.sl:99:	  d += ss;
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:113:  if(debug > 0)
k3d/share/shaders/k3d_noisysmoke.sl:115:      printf("nsteps = %f, t1 = %f, end = %f\n", nsteps, integstart, end);
k3d/share/shaders/k3d_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:9:k3d_null()
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: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:19: *   ringunevenness - 0=equally spaced rings, larger is unequally spaced
k3d/share/shaders/k3d_oak.sl:21: *   ringnoise, ringnoisefreq - general warping of the domain
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: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:45:#include "k3d_project.h"
k3d/share/shaders/k3d_oak.sl:46:#include "k3d_pshad.h"
k3d/share/shaders/k3d_oak.sl:47:#include "k3d_material.h"
k3d/share/shaders/k3d_oak.sl:48:#include "k3d_displace.h"
k3d/share/shaders/k3d_oak.sl:50:#include "k3d_oak.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:61:		float divotdepth = 0.05;
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:65:		float truedisp = 0;
k3d/share/shaders/k3d_oak.sl:69:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_oak.sl:71:  float wood;
k3d/share/shaders/k3d_oak.sl:72:  wood =
k3d/share/shaders/k3d_oak.sl:73:    oaktexture(Pshad, dPshad, ringfreq, ringunevenness, grainfreq, ringnoise,
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:79:  /* Illumination model - just use plastic */
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:15: *   plankwidth, planklength - size of the planks
k3d/share/shaders/k3d_oakplank.sl:16: *   groovewidth, grooveheight - width of the grooves between planks
k3d/share/shaders/k3d_oakplank.sl: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: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:26: *   ringunevenness - 0=equally spaced rings, larger is unequally spaced
k3d/share/shaders/k3d_oakplank.sl:28: *   ringnoise, ringnoisefreq - general warping of the domain
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: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:42: *   envname, envspace, envrad - environment mapping controls
k3d/share/shaders/k3d_oakplank.sl:56:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_oakplank.sl:59:#include "k3d_rayserver.h"
k3d/share/shaders/k3d_oakplank.sl:61:#include "k3d_project.h"
k3d/share/shaders/k3d_oakplank.sl:62:#include "k3d_pshad.h"
k3d/share/shaders/k3d_oakplank.sl:63:#include "k3d_material.h"
k3d/share/shaders/k3d_oakplank.sl:64:#include "k3d_noises.h"
k3d/share/shaders/k3d_oakplank.sl:65:#include "k3d_displace.h"
k3d/share/shaders/k3d_oakplank.sl:66:#include "k3d_patterns.h"
k3d/share/shaders/k3d_oakplank.sl:68:#include "k3d_oak.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:77:		   float plankwidth, planklength;
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:84:  splank = ss - swhichplank * 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: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:97:						     dt);
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: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:116:		     float plankwidth = 2, planklength = 30;
k3d/share/shaders/k3d_oakplank.sl:117:		     float groovewidth = 0.05, grooveheight = 0.05;
k3d/share/shaders/k3d_oakplank.sl:119:		     float groovedepth = 0.03, edgewidth = 0.1;
k3d/share/shaders/k3d_oakplank.sl:124:  float ss = xcomp(Pshad), tt = ycomp(Pshad), height = zcomp(Pshad);
k3d/share/shaders/k3d_oakplank.sl:125:  float dss = filterwidth(ss), dtt = filterwidth(tt);
k3d/share/shaders/k3d_oakplank.sl: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:135:  float plankindex = swhichplank + 13 * twhichplank;
k3d/share/shaders/k3d_oakplank.sl:141:  float wood = oaktexture(Ppat, dPshad, ringfreq, ringunevenness, grainfreq,
k3d/share/shaders/k3d_oakplank.sl: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:150:  /* Displacement: the edges of the planks displace down a bit, as do
k3d/share/shaders/k3d_oakplank.sl:153:  float edgedisp = smoothpulse(0, edgewidth, plankwidth - edgewidth,
k3d/share/shaders/k3d_oakplank.sl:154:			       plankwidth, splank);
k3d/share/shaders/k3d_oakplank.sl:155:  edgedisp *=
k3d/share/shaders/k3d_oakplank.sl:156:    smoothpulse(0, edgewidth, planklength - edgewidth, planklength, tplank);
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:159:  disp +=
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:164:  /* Illumination model
k3d/share/shaders/k3d_oakplank.sl:165:   * Less specular in the grooves, more specular in the dark wood. 
k3d/share/shaders/k3d_oakplank.sl:167:  float specadjusted = 1 + .3 * wood - 0.8 * (1 - inplank);
k3d/share/shaders/k3d_oakplank.sl:169:    MaterialShinyPlastic(Nf, Cwood, Ka, Kd, specadjusted * Ks, roughness,
k3d/share/shaders/k3d_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: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:17: *	tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_orange.sl:20: *	Created: 9/4/96
k3d/share/shaders/k3d_orange.sl:23:#define BUMP_AMPLITUDE (1/30)
k3d/share/shaders/k3d_orange.sl:24:#define BUMP_FREQUENCY (35)
k3d/share/shaders/k3d_orange.sl:26:surface k3d_orange (
k3d/share/shaders/k3d_orange.sl:28:	float Kd = .8;
k3d/share/shaders/k3d_orange.sl:45:	Nf = faceforward (normalize (newP), I);
k3d/share/shaders/k3d_orange.sl:49:	Ci = Cs * (Ka * ambient() + Kd * diffuse (Nf)) + Ks * specular (Nf, V, roughness);
k3d/share/shaders/k3d_orennayar.sl: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:9: *   Lambert.  Based on Oren & Nayar's model (see Proc. SIGGRAPH 94).
k3d/share/shaders/k3d_orennayar.sl:13: *   tend to act more like retroreflectors than like isotropic scatterers.
k3d/share/shaders/k3d_orennayar.sl:16: *   Ka, Kd - just like matte.sl
k3d/share/shaders/k3d_orennayar.sl:22: *   Oren, Michael and Shree K. Nayar.  "Generalization of Lambert's
k3d/share/shaders/k3d_orennayar.sl:23: *         Reflectance Model," Computer Graphics Annual Conference
k3d/share/shaders/k3d_orennayar.sl:24: *         Series 1994 (Proceedings of SIGGRAPH '94), pp. 239-246.
k3d/share/shaders/k3d_orennayar.sl:28: *      light from the sources and applies Oren & Nayar's local reflectance
k3d/share/shaders/k3d_orennayar.sl: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:41:k3d_orennayar (float Ka = 1;
k3d/share/shaders/k3d_orennayar.sl:42:	   float Kd = .5;
k3d/share/shaders/k3d_orennayar.sl:50:    float alpha, beta, sigma2, cos_phi_diff;
k3d/share/shaders/k3d_orennayar.sl:52:    Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_orennayar.sl:61:	cos_phi_diff = normalize(Eye-Nf*(Eye.Nf)) . normalize(LN - Nf*(LN.Nf));
k3d/share/shaders/k3d_orennayar.sl:67:	if (cos_phi_diff >= 0)
k3d/share/shaders/k3d_orennayar.sl:71:	L1 = Cs * (cos_theta_i * (C1 + cos_phi_diff * C2 * tan(beta) +
k3d/share/shaders/k3d_orennayar.sl:72:				  (1 - abs(cos_phi_diff)) * C3 * tan((alpha+beta)/2)));
k3d/share/shaders/k3d_orennayar.sl:74:			  (1 - cos_phi_diff*(4*beta*beta)/(PI*PI)));
k3d/share/shaders/k3d_orennayar.sl:79:    Ci = Os * (Cs * (Ka*ambient()) + Kd*lightC);
k3d/share/shaders/k3d_outlet.sl:2: * outlet.sl -- surface shader for an electrical outlet
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: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:29:k3d_outlet ( float Ka = 1, Kd = 1, Km = 0.1;
k3d/share/shaders/k3d_outlet.sl:34:  float ks, kd, roughness;
k3d/share/shaders/k3d_outlet.sl:37:  /* defaults */
k3d/share/shaders/k3d_outlet.sl:38:  kd = Kd;
k3d/share/shaders/k3d_outlet.sl:49:      kd = 0;
k3d/share/shaders/k3d_outlet.sl:67:  /* Use the plastic illumination model */
k3d/share/shaders/k3d_outlet.sl:68:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_outlet.sl:70:  Ci = Os * ( Ct * (Ka*ambient() + kd*diffuse(Nf)) +
k3d/share/shaders/k3d_outline.sl:2: * it's the valdez algorithm. short and sweet.
k3d/share/shaders/k3d_outline.sl:3: * width sets the line width.
k3d/share/shaders/k3d_outline.sl:6:k3d_outline(float width = .05)
k3d/share/shaders/k3d_outline.sl:10:  float dot = Nn . normalize(I);
k3d/share/shaders/k3d_outline.sl:12:  P += Nn*width;
k3d/share/shaders/k3d_outline.sl:14:  Oi = smoothstep(-.01,0,dot);
k3d/share/shaders/k3d_painted_constant.sl:1:surface k3d_painted_constant(
k3d/share/shaders/k3d_paintedplastic.sl:1:/* paintedplastic.sl - Standard texture map surface for RenderMan Interface.
k3d/share/shaders/k3d_paintedplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_paintedplastic.sl: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:13: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
k3d/share/shaders/k3d_paintedplastic.sl:18:surface k3d_paintedplastic(
k3d/share/shaders/k3d_paintedplastic.sl:20:	float Kd = 0.5;
k3d/share/shaders/k3d_paintedplastic.sl:43:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_paintedplastic.sl:46:	Ci = Oi * Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_parquet_plank.sl:2: * parquet_plank.sl -- another surface shader for wood.
k3d/share/shaders/k3d_parquet_plank.sl:5: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_parquet_plank.sl:6: *   like oak plank parquet floor tiles.  The actual wood and plank pattern
k3d/share/shaders/k3d_parquet_plank.sl:7: *   is based on my "planks" shader.  This shader works best if "s" and "t"
k3d/share/shaders/k3d_parquet_plank.sl: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:13: *   plankwidth - width of each plank (in terms of s/t)
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:20: *   plankvary - controls how much wood color varies from plank to plank
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:25: *   even with low sampling densities.
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: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:39:			  float plankwidth = .05, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_plank.sl:43:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_plank.sl:44:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_plank.sl:45:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_plank.sl:50:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_plank.sl:51:  color Ct, woodcolor;
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:63:  swidth =
k3d/share/shaders/k3d_parquet_plank.sl:64:    (max(abs(Du(s) * du) + abs(Dv(s) * dv), MINFILTERWIDTH) / PGWIDTH) *
k3d/share/shaders/k3d_parquet_plank.sl:66:  twidth =
k3d/share/shaders/k3d_parquet_plank.sl:67:    (max(abs(Du(t) * du) + abs(Dv(t) * dv), MINFILTERWIDTH) / PGHEIGHT) *
k3d/share/shaders/k3d_parquet_plank.sl:69:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_parquet_plank.sl:71:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_parquet_plank.sl:77:  if(mod(whichrow / plankspertile + whichplank, 2) >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:83:      tmp = swidth;
k3d/share/shaders/k3d_parquet_plank.sl:84:      swidth = twidth;
k3d/share/shaders/k3d_parquet_plank.sl:85:      twidth = tmp;
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:96:  if(swidth >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:100:      clamp(boxstep(GWF - swidth, GWF, ss), max(1 - GWF / swidth, 0),
k3d/share/shaders/k3d_parquet_plank.sl:101:	    1) - clamp(boxstep(1 - GWF - swidth, 1 - GWF, ss), 0,
k3d/share/shaders/k3d_parquet_plank.sl:102:		       2 * GWF / swidth);
k3d/share/shaders/k3d_parquet_plank.sl:103:  if(twidth >= 1)
k3d/share/shaders/k3d_parquet_plank.sl:107:      clamp(boxstep(GHF - twidth, GHF, tt), max(1 - GHF / twidth, 0),
k3d/share/shaders/k3d_parquet_plank.sl:108:	    1) - clamp(boxstep(1 - GHF - twidth, 1 - GHF, tt), 0,
k3d/share/shaders/k3d_parquet_plank.sl:109:		       2 * GHF / twidth);
k3d/share/shaders/k3d_parquet_plank.sl:110:  /* This would be the non-antialiased version:
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:121:  if(fade < 0.999)
k3d/share/shaders/k3d_parquet_plank.sl:128:      r = (1 - fade) * r + 0.65 * fade;
k3d/share/shaders/k3d_parquet_plank.sl:133:      fade = smoothstep(2 / grainscale, 8 / grainscale, fwidth);
k3d/share/shaders/k3d_parquet_plank.sl:134:      if(fade < 0.999)
k3d/share/shaders/k3d_parquet_plank.sl:138:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_parquet_plank.sl: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:154:  Ct = mix(groovecolor, woodcolor, groovy);
k3d/share/shaders/k3d_parquet_plank.sl:156:  /* Use the plastic illumination model */
k3d/share/shaders/k3d_parquet_plank.sl:159:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
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:14: *   plankwidth - width of each plank (in terms of s/t)
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:21: *   plankvary - controls how much wood color varies from plank to plank
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:26: *   even with low sampling densities.
k3d/share/shaders/k3d_parquet_plank2.sl:29: *         email: gritz@SpamSucks_seas.gwu.edu
k3d/share/shaders/k3d_parquet_plank2.sl:31: *                801  22nd St. NW, Rm. T-624-G
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:36: *    10 Feb 1995 - modified by wave to change the name
k3d/share/shaders/k3d_parquet_plank2.sl:38: * last modified 10 Feb 1995 by wave
k3d/share/shaders/k3d_parquet_plank2.sl:45:k3d_parquet_plank2 (float Ka = 1, Kd = 0.75, Ks = .15, roughness = .025;
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:53:	       float plankwidth = .05, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_plank2.sl:57:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_plank2.sl:58:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_plank2.sl:59:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_plank2.sl:64:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_plank2.sl:65:  color Ct, woodcolor;
k3d/share/shaders/k3d_parquet_plank2.sl:68:  float tilewidth, whichtile, tmp, planklength;
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:77:  swidth = (max (abs(Du(s)*du) + abs(Dv(s)*dv), MINFILTERWIDTH) / PGWIDTH) * txtscale;
k3d/share/shaders/k3d_parquet_plank2.sl:78:  twidth = (max (abs(Du(t)*du) + abs(Dv(t)*dv), MINFILTERWIDTH) / PGHEIGHT) * txtscale;
k3d/share/shaders/k3d_parquet_plank2.sl:79:  fwidth = max(swidth,twidth);
k3d/share/shaders/k3d_parquet_plank2.sl:81:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_parquet_plank2.sl:87:  if (mod (whichrow/plankspertile + whichplank, 2) >= 1) {
k3d/share/shaders/k3d_parquet_plank2.sl:92:      tmp = swidth;  swidth = twidth;  twidth = tmp;
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:103:  if (swidth >= 1)
k3d/share/shaders/k3d_parquet_plank2.sl:105:  else w = clamp (boxstep(GWF-swidth,GWF,ss), max(1-GWF/swidth,0), 1)
k3d/share/shaders/k3d_parquet_plank2.sl:106:	 - clamp (boxstep(1-GWF-swidth,1-GWF,ss), 0, 2*GWF/swidth);
k3d/share/shaders/k3d_parquet_plank2.sl:107:  if (twidth >= 1)
k3d/share/shaders/k3d_parquet_plank2.sl:109:  else h = clamp (boxstep(GHF-twidth,GHF,tt), max(1-GHF/twidth,0),1)
k3d/share/shaders/k3d_parquet_plank2.sl:110:	 - clamp (boxstep(1-GHF-twidth,1-GHF,tt), 0, 2*GHF/twidth);
k3d/share/shaders/k3d_parquet_plank2.sl:111:  /* This would be the non-antialiased version:
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:122:  if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_plank2.sl:127:      r = (1-fade)*r + 0.65*fade;
k3d/share/shaders/k3d_parquet_plank2.sl:132:      fade = smoothstep (2/grainscale, 8/grainscale, fwidth);
k3d/share/shaders/k3d_parquet_plank2.sl:133:      if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_plank2.sl:136:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_plank2.sl: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:151:  /* Use the plastic illumination model */
k3d/share/shaders/k3d_parquet_plank2.sl:153:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
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:15: *   plankwidth - width of each plank (in terms of s/t)
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:22: *   plankvary - controls how much wood color varies from plank to plank
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:27: *   even with low sampling densities.
k3d/share/shaders/k3d_parquet_tile.sl:30: *         email: gritz@SpamSucks_seas.gwu.edu
k3d/share/shaders/k3d_parquet_tile.sl:32: *                801  22nd St. NW, Rm. T-624-G
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:37: *    10 Feb 1995 - modified by wave to change the name
k3d/share/shaders/k3d_parquet_tile.sl:39: * last modified 10 Feb 1995 by wave
k3d/share/shaders/k3d_parquet_tile.sl:42: * modified again by Dan Weeks <dan@SpamSucks_mango.sfasu.edu> on 08 Dec 1996
k3d/share/shaders/k3d_parquet_tile.sl:43: *   - made one plank per tile like the flooring in our lab
k3d/share/shaders/k3d_parquet_tile.sl: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:52: * changed:
k3d/share/shaders/k3d_parquet_tile.sl:57: *   - plankwidth from .05 to .2
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: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:68:	       float plankwidth = .2, groovewidth = 0.001;
k3d/share/shaders/k3d_parquet_tile.sl:72:#define snoise(x) (2 * noise((x)) - 1)
k3d/share/shaders/k3d_parquet_tile.sl:73:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_parquet_tile.sl:74:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_parquet_tile.sl:79:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_parquet_tile.sl:80:  color Ct, woodcolor;
k3d/share/shaders/k3d_parquet_tile.sl:83:  float tilewidth, whichtile, tmp, planklength;
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:92:  swidth = (max (abs(Du(s)*du) + abs(Dv(s)*dv), MINFILTERWIDTH) / PGWIDTH) * txtscale;
k3d/share/shaders/k3d_parquet_tile.sl:93:  twidth = (max (abs(Du(t)*du) + abs(Dv(t)*dv), MINFILTERWIDTH) / PGHEIGHT) * txtscale;
k3d/share/shaders/k3d_parquet_tile.sl:94:  fwidth = max(swidth,twidth);
k3d/share/shaders/k3d_parquet_tile.sl:96:  Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_parquet_tile.sl:102:  if (mod (whichrow/plankspertile + whichplank, 2) >= 1) {
k3d/share/shaders/k3d_parquet_tile.sl:107:      tmp = swidth;  swidth = twidth;  twidth = tmp;
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:118:  if (swidth >= 1)
k3d/share/shaders/k3d_parquet_tile.sl:120:  else w = clamp (boxstep(GWF-swidth,GWF,ss), max(1-GWF/swidth,0), 1)
k3d/share/shaders/k3d_parquet_tile.sl:121:	 - clamp (boxstep(1-GWF-swidth,1-GWF,ss), 0, 2*GWF/swidth);
k3d/share/shaders/k3d_parquet_tile.sl:122:  if (twidth >= 1)
k3d/share/shaders/k3d_parquet_tile.sl:124:  else h = clamp (boxstep(GHF-twidth,GHF,tt), max(1-GHF/twidth,0),1)
k3d/share/shaders/k3d_parquet_tile.sl:125:	 - clamp (boxstep(1-GHF-twidth,1-GHF,tt), 0, 2*GHF/twidth);
k3d/share/shaders/k3d_parquet_tile.sl:126:  /* This would be the non-antialiased version:
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:137:  if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_tile.sl:142:      r = (1-fade)*r + 0.65*fade;
k3d/share/shaders/k3d_parquet_tile.sl:147:      fade = smoothstep (2/grainscale, 8/grainscale, fwidth);
k3d/share/shaders/k3d_parquet_tile.sl:148:      if (fade < 0.999) {
k3d/share/shaders/k3d_parquet_tile.sl:151:	  r *= (1-fade)*r2 + (0.75*fade);
k3d/share/shaders/k3d_parquet_tile.sl: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:166:  /* Use the plastic illumination model */
k3d/share/shaders/k3d_parquet_tile.sl:168:  Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
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: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:14: *    Ka, Kd - the usual meaning
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:27: *      the view of the planet, but also shadow it.  The way to do this
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:31: *             Attribute "render" "casts_shadows" "shade"
k3d/share/shaders/k3d_planetclouds.sl:32: *             Surface "planetclouds"
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: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:56:#define TWOPI (2*PI)
k3d/share/shaders/k3d_planetclouds.sl:58:/* Use signed Perlin noise */
k3d/share/shaders/k3d_planetclouds.sl:59:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_planetclouds.sl:60:#define DNoise(p) (2*(point noise(p)) - point(1,1,1))
k3d/share/shaders/k3d_planetclouds.sl:61:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_planetclouds.sl:62:#define VERY_SMALL 0.001
k3d/share/shaders/k3d_planetclouds.sl:66:surface k3d_planetclouds(float Ka = 0.5, Kd = 0.75;
k3d/share/shaders/k3d_planetclouds.sl:67:			 float distortionscale = 1; float omega = 0.7;
k3d/share/shaders/k3d_planetclouds.sl:68:			 float lambda = 2; float octaves = 9;
k3d/share/shaders/k3d_planetclouds.sl:71:  point Pdistortion;		/* "distortion" vector */
k3d/share/shaders/k3d_planetclouds.sl:72:  point PP;			/* Point after distortion */
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:91:      l *= lambda;
k3d/share/shaders/k3d_planetclouds.sl:96:  /* Adjust zero crossing (where the clouds disappear) */
k3d/share/shaders/k3d_planetclouds.sl:102:  /* Scale density */
k3d/share/shaders/k3d_planetclouds.sl:105:  /* Modulate surface opacity by the cloud value */
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:13: *   plankwidth - width 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:18: *   plankvary - controls how much wood color varies from plank to plank
k3d/share/shaders/k3d_plank.sl:22: * ANTIALIASING: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_plank.sl:23: *   even with low sampling densities.
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: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:36:		  float plankwidth = .05, planklength = .75, groovewidth =
k3d/share/shaders/k3d_plank.sl:40:#define snoise(x) (2 * (float noise((x))) - 1)
k3d/share/shaders/k3d_plank.sl:41:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_plank.sl:42:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_plank.sl:47:  float swidth, twidth, fwidth, ss, tt, w, h, fade, ttt;
k3d/share/shaders/k3d_plank.sl:48:  color Ct, woodcolor;
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:58:  swidth =
k3d/share/shaders/k3d_plank.sl:59:    max(abs(Du(s) * du) + abs(Dv(s) * dv),
k3d/share/shaders/k3d_plank.sl:61:  twidth =
k3d/share/shaders/k3d_plank.sl:62:    max(abs(Du(t) * du) + abs(Dv(t) * dv),
k3d/share/shaders/k3d_plank.sl:64:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_plank.sl:66:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plank.sl:79:   * are grooves, 1 where the wood grain is visible.  Do some simple
k3d/share/shaders/k3d_plank.sl:82:  if(swidth >= 1)
k3d/share/shaders/k3d_plank.sl:86:      clamp(boxstep(GWF - swidth, GWF, ss), max(1 - GWF / swidth, 0),
k3d/share/shaders/k3d_plank.sl:87:	    1) - clamp(boxstep(1 - GWF - swidth, 1 - GWF, ss), 0,
k3d/share/shaders/k3d_plank.sl:88:		       2 * GWF / swidth);
k3d/share/shaders/k3d_plank.sl:89:  if(twidth >= 1)
k3d/share/shaders/k3d_plank.sl:93:      clamp(boxstep(GHF - twidth, GHF, tt), max(1 - GHF / twidth, 0),
k3d/share/shaders/k3d_plank.sl:94:	    1) - clamp(boxstep(1 - GHF - twidth, 1 - GHF, tt), 0,
k3d/share/shaders/k3d_plank.sl:95:		       2 * GHF / twidth);
k3d/share/shaders/k3d_plank.sl:96:  /* This would be the non-antialiased version:
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:107:  if(fade < 0.999)
k3d/share/shaders/k3d_plank.sl:114:      r = (1 - fade) * r + 0.65 * fade;
k3d/share/shaders/k3d_plank.sl:119:      fade = smoothstep(2 / grainscale, 8 / grainscale, fwidth);
k3d/share/shaders/k3d_plank.sl:120:      if(fade < 0.999)
k3d/share/shaders/k3d_plank.sl:124:	  r *= (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_plank.sl: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:140:  Ct = mix(groovecolor, woodcolor, groovy);
k3d/share/shaders/k3d_plank.sl:143:   * Use the plastic illumination model
k3d/share/shaders/k3d_plank.sl:147:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_plastic.sl:1:/* plastic.sl - Standard plastic surface for RenderMan Interface.
k3d/share/shaders/k3d_plastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_plastic.sl: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: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: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:15:k3d_plastic2(float Ka = 1, Kd = 0.5, Ks = 0.5;
k3d/share/shaders/k3d_plastic2.sl:19:    point Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_plastic2.sl:23:    Ci = Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf))
k3d/share/shaders/k3d_pointlight.sl:1:/* pointlight.sl - Standard point light source for RenderMan Interface.
k3d/share/shaders/k3d_pointlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_pointlight.sl: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:9:light k3d_pointlight(float intensity = 3000;
k3d/share/shaders/k3d_pointlight.sl:11:		     point from = point "shader"(0, 0, 0);)
k3d/share/shaders/k3d_projectionmap_plastic.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
k3d/share/shaders/k3d_projectionmap_plastic.sl:4:// Contact: tshead@k-3d.com
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:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_projectionmap_plastic.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_projectionmap_plastic.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_projectionmap_plastic.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_projectionmap_plastic.sl:18:// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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:26:	float Kd = 0.5;
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:59:	normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_projectionmap_plastic.sl:62:	Ci = Oi * Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * Ks * specular(Nf, V, roughness);
k3d/share/shaders/k3d_puffyclouds.sl:1:/* I took wave's lead and renamed starfield to KMPuffyclouds.sl -- tal@SpamSucks_cs.caltech.edu */
k3d/share/shaders/k3d_puffyclouds.sl:4: * puffyclouds.sl -- RenderMan compatible surface shader for puffy
k3d/share/shaders/k3d_puffyclouds.sl:5: *                   clouds.
k3d/share/shaders/k3d_puffyclouds.sl:8: *    Makes nice looking cumulous clouds like you would see in the sky
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:13: *    easy to add the lighting.
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:22: *    None, but should be easy to add antialiasing simply by adaptively
k3d/share/shaders/k3d_puffyclouds.sl:23: *    setting the "octaves" parameter based on distance from eye point.
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: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:44:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_puffyclouds.sl:48:k3d_puffyclouds (float Ka = 0, Kd = 0;
k3d/share/shaders/k3d_puffyclouds.sl:51:	     color cloudcolor = color(1,1,1);
k3d/share/shaders/k3d_puffyclouds.sl:52:	     float octaves = 8, omega = 0.5, lambda = 2;
k3d/share/shaders/k3d_puffyclouds.sl:53:	     float threshold = 0;
k3d/share/shaders/k3d_puffyclouds.sl: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:64:/*  value = fBm (PP, omega, lambda, octaves); */
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:79:/*  Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward(N,I))); */
k3d/share/shaders/k3d_redapple.sl:2: * Renamed to JMredapple.sl for RMR -- talrmr@SpamSucks_pacbell.net  7/18/99
k3d/share/shaders/k3d_redapple.sl:4: * redapple.sl - A nice shader for reddy-green apples.
k3d/share/shaders/k3d_redapple.sl:7: * Feel free to use this shader to create apples anywhere and
k3d/share/shaders/k3d_redapple.sl:10: * This shader creates a nice skin for red-green apples. It _is_ tuned
k3d/share/shaders/k3d_redapple.sl:11: * for specific geometry, but can very easily be adjusted to fit any
k3d/share/shaders/k3d_redapple.sl: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: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:31:/*#define USE_LG_RAYTRACE */
k3d/share/shaders/k3d_redapple.sl:33:#ifdef USE_LG_RAYTRACE
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:36:#endif
k3d/share/shaders/k3d_redapple.sl:38:#ifndef snoise
k3d/share/shaders/k3d_redapple.sl:39:#define snoise(x) (2*noise(x)-1)  /* 1-D signed noise */
k3d/share/shaders/k3d_redapple.sl:40:#endif
k3d/share/shaders/k3d_redapple.sl:42:#define TSCALE .05
k3d/share/shaders/k3d_redapple.sl:45:k3d_redapple (
k3d/share/shaders/k3d_redapple.sl:47:	float Kd = .5;            /* Diffuse reflection coeff.     */
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:55:	float txtscale = .05;     /* Ugly kludge (see above...)    */
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:65:	float small_noise, blotch, speck, disp = 0, blackness;
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:80:	 * Standard settings
k3d/share/shaders/k3d_redapple.sl:82:	PP = transform("shader", P);
k3d/share/shaders/k3d_redapple.sl:90:	 * and patches of finely speckled red and green. These
k3d/share/shaders/k3d_redapple.sl:92:	 * goes to 1 or 0) are colored more and more green.
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: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:131:	 * The blotch color is finally determined by mixing,
k3d/share/shaders/k3d_redapple.sl:136:	#define BLOTCH_SF          20   /* s-factor for blotches  */
k3d/share/shaders/k3d_redapple.sl:137:	#define BLOTCH_TF          15   /* t-factor for blotches  */
k3d/share/shaders/k3d_redapple.sl:138:	#define BLOTCH_TCF         2.5  /* scaling kludge         */
k3d/share/shaders/k3d_redapple.sl:139:	#define BLOTCH_DELTA       0.1  /* 'nother scaling kludge */
k3d/share/shaders/k3d_redapple.sl:140:	#define BLOTCH_SPECK_COEFF 0.3  /* blotch specking coeff  */
k3d/share/shaders/k3d_redapple.sl: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: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:170:	#define BEDGE  .01
k3d/share/shaders/k3d_redapple.sl:171:	#define BWIDTH .01
k3d/share/shaders/k3d_redapple.sl:180:	cs = mix(base_color, dred, blotch);
k3d/share/shaders/k3d_redapple.sl:186:	 * Set the shading surface normal.
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:192:	 * un-dented).
k3d/share/shaders/k3d_redapple.sl:194:	#define DISP_SF     10             /* s-factor for dent noise */
k3d/share/shaders/k3d_redapple.sl:195:	#define DISP_TF     30             /* t-factor for dent noise */
k3d/share/shaders/k3d_redapple.sl:196:	#define DISP_DENT_AMP     (1/15)   /* dent amplitude          */
k3d/share/shaders/k3d_redapple.sl:197:	#define DISP_SMNOISE_AMP  (1/1000) /* small noise amplitude   */
k3d/share/shaders/k3d_redapple.sl:198:	#define DISP_SPECK_AMP    (1/40)   /* speckle disp. amplitude */
k3d/share/shaders/k3d_redapple.sl:199:	disp += noise(DISP_SF*sin(2*PI*s) + PI + label,
k3d/share/shaders/k3d_redapple.sl:201:	disp += small_noise * DISP_SMNOISE_AMP * txtscale / TSCALE;
k3d/share/shaders/k3d_redapple.sl:202:	disp -= speck * DISP_SPECK_AMP * txtscale / TSCALE;
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: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:217:#ifdef USE_LG_RAYTRACE
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:226:#endif
k3d/share/shaders/k3d_redapple.sl:230:	 * Combine everything to get Ci, in the standard form.
k3d/share/shaders/k3d_redapple.sl:233:	Ci = Os * (cs * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_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:12:#define snoise(x) (2.5*(noise(x)-0.5))

k3d/share/shaders/k3d_ridged_multifractal.sl:14:displacement

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:18:	point PP =transform("shader",P);

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: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_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:12:displacement

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

k3d/share/shaders/k3d_ripple.sl:20:  P += 1 + N * amplitude * (2 - abs (sin(2*PI*(s/wavelength))));

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:9:displacement
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:24:		dpdu = dPdu;
k3d/share/shaders/k3d_round.sl:27:		dpdu = -dPdu;
k3d/share/shaders/k3d_round.sl:31:		dpdv = dPdv;
k3d/share/shaders/k3d_round.sl:34:		dpdv = -dPdv;
k3d/share/shaders/k3d_round.sl:37:	/* Find the distances from the edges in the current space. */
k3d/share/shaders/k3d_round.sl:38:	lu = length(dPdu*uu);
k3d/share/shaders/k3d_round.sl:39:	lv = length(dPdv*vv);
k3d/share/shaders/k3d_round.sl:41:	if (lu < radius || lv < radius) {	/* only if within radius of 
k3d/share/shaders/k3d_round.sl:42:	                                                     an edge...  */
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:48:	 *  edge along u and/or v.
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:59:		P = center + radius*normalize( P-center );
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:10:k3d_rubber( 
k3d/share/shaders/k3d_rubber.sl:12:		Kd		= 1.0, 
k3d/share/shaders/k3d_rubber.sl:15:	point	Nf = faceforward(normalize(N),I), 
k3d/share/shaders/k3d_rubber.sl:16:		Ploc = transform("shader", P);  /* Move to shader space */
k3d/share/shaders/k3d_rubber.sl:19:	/* Mix in some white dust. */
k3d/share/shaders/k3d_rubber.sl:24:	Ci = Os * cout * ( Ka*ambient() + Kd*diffuse(Nf) ) ;
k3d/share/shaders/k3d_ruledpaper.sl:6: *   the margin, binder holes and writing (as an image texture).
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: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:25: * last modified 15 Nov 1997 by Emil Mikulic
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:42:k3d_ruledpaper(float Ka = 1, Kd = 0.5, Ks = 0.5;
k3d/share/shaders/k3d_ruledpaper.sl:49:	// Paper width
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:64:	// Where does the vertical line (margin) start and end?
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:70:	// Circle radius in ss/tt coord. system
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:79:// becomes black and the opacity becomes 0.
k3d/share/shaders/k3d_ruledpaper.sl:81:#define circle(sm,tm) { \
k3d/share/shaders/k3d_ruledpaper.sl:84:		if (distance( point(ss,tt,0), point(sm,tm,0) ) <= circr)	\
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:98:	// Use a nice handwrititng font and you can make it look like
k3d/share/shaders/k3d_ruledpaper.sl:105:	// If we're inside the borders/margins
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:113:	// Bounding box for circle calcs
k3d/share/shaders/k3d_ruledpaper.sl:114:	if ((s>boundl) && (s<boundr)) 
k3d/share/shaders/k3d_ruledpaper.sl:121:		// Find bounding boxes first to speed up calcs
k3d/share/shaders/k3d_ruledpaper.sl:122:		// I wrote this handy macro to automate it!
k3d/share/shaders/k3d_ruledpaper.sl:132:	// Check if it actually needs shading
k3d/share/shaders/k3d_ruledpaper.sl:135:			// If inside plasticky reinforcement strip then
k3d/share/shaders/k3d_ruledpaper.sl:136:			// use plastic shading model.
k3d/share/shaders/k3d_ruledpaper.sl:137:			Ci = Oi * (tex * (Ka * ambient() + Kd * diffuse(Nf)) + 
k3d/share/shaders/k3d_ruledpaper.sl:140:			// Else shade diffuse paper
k3d/share/shaders/k3d_ruledpaper.sl:141:			Ci = Oi * tex * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_rustymetal.sl: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:13: *   rustKa, rustKd, rustcolor - control the appearance of the rust.
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:27: *   19 Jan 1995 - gritz - created
k3d/share/shaders/k3d_rustymetal.sl:29: *   last modified 19 Jan 95 
k3d/share/shaders/k3d_rustymetal.sl:34:/* Signed noise varies from -1 to 1 (like Perlin uses) */
k3d/share/shaders/k3d_rustymetal.sl:35:#define snoise(x) (2*noise(x)-1)
k3d/share/shaders/k3d_rustymetal.sl:38:#define MAXOCTAVES 8
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: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:54:  point PP;                    /* shade space point */
k3d/share/shaders/k3d_rustymetal.sl:56:  float alimit;                /* Limit sum to do simple antialiasing */
k3d/share/shaders/k3d_rustymetal.sl:58:  color Cmetal = 0, Crust = 0; /* Computed colors of metal & rust */
k3d/share/shaders/k3d_rustymetal.sl:61:   * number of octaves by the estimated change in PP between adjacent
k3d/share/shaders/k3d_rustymetal.sl:62:   * shading samples.
k3d/share/shaders/k3d_rustymetal.sl:64:  PP = txtscale * transform ("shader", P);
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:74:  /* Scale the rust appropriately, modulate it by another noise 
k3d/share/shaders/k3d_rustymetal.sl:82:   * account the perturbed normal and shading like matte.
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:89:   * original (smooth) normal and the usual metal illumination model.
k3d/share/shaders/k3d_rustymetal.sl:92:      Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_rustymetal.sl:97:  /* Now blend the metal and rust colors depending on the computed value
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:10: *   Saturn-like.  The shader works by using a variety of fractal 
k3d/share/shaders/k3d_saturn.sl:15: *    Ka, Kd - the usual meaning
k3d/share/shaders/k3d_saturn.sl:16: *    dist_scale - scaling for multifractal distortion
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: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:37: *        tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_saturn.sl:39: * last modified 23 May 1995 by Tal
k3d/share/shaders/k3d_saturn.sl:43:k3d_saturn (float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_saturn.sl:44:	  float dist_scale = .2;
k3d/share/shaders/k3d_saturn.sl:51:  float latitude;
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:64:  latitude = abs (zcomp (PtN));
k3d/share/shaders/k3d_saturn.sl:67:       latitude = lat_scale * pow(latitude,map_exp);
k3d/share/shaders/k3d_saturn.sl:68:  else latitude *= lat_scale;
k3d/share/shaders/k3d_saturn.sl:71:      Ct = spline (latitude,
k3d/share/shaders/k3d_saturn.sl:84:  /* Shade using matte model */
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:9: *	Ka, Kd - the usual
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:19: *	tal@SpamSucks_cs.caltech.edu
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:32:#ifdef BMRT
k3d/share/shaders/k3d_saturnring.sl:33:#define snoise(x) (2 * noise(x) - 1)	
k3d/share/shaders/k3d_saturnring.sl:36:#define snoise(x) (2.5 * (noise(x) - 1))
k3d/share/shaders/k3d_saturnring.sl:37:#endif /* BMRT */	
k3d/share/shaders/k3d_saturnring.sl:39:surface k3d_saturnring (float Ka = 1.0, Kd = 1.0,
k3d/share/shaders/k3d_saturnring.sl:40:	cutoff = 0.55, ringrad = 1.0, opacity = 0.5;)
k3d/share/shaders/k3d_saturnring.sl:42:	point PP;       /* Transformed point */
k3d/share/shaders/k3d_saturnring.sl:43:	point Nf;       /* Forward facing Normalized vector of incident light */
k3d/share/shaders/k3d_saturnring.sl: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:57:#define DEBUG 0
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:61:#endif
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:69:		relpos =  val / ringrad;
k3d/share/shaders/k3d_saturnring.sl:72:#define DEBUG2 0
k3d/share/shaders/k3d_saturnring.sl:75:#endif
k3d/share/shaders/k3d_saturnring.sl:89:			cs = dgrey;
k3d/share/shaders/k3d_saturnring.sl:96:			cs = dyellow;	
k3d/share/shaders/k3d_saturnring.sl:99:			cs = dpink;	
k3d/share/shaders/k3d_saturnring.sl:101:			cs = mutedgreen;	
k3d/share/shaders/k3d_saturnring.sl:105:			/* A Matte model */
k3d/share/shaders/k3d_saturnring.sl:106:			Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_saturnring.sl:107:			Ci = Oi * (cs * (Ka*ambient() + Kd*diffuse(Nf) ));
k3d/share/shaders/k3d_scartissue.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_scartissue.sl:7:k3d_scartissue(
k3d/share/shaders/k3d_scartissue.sl:9:		Kd			= .5, 
k3d/share/shaders/k3d_scartissue.sl:18:	color dark = color (.015,.02,.02);
k3d/share/shaders/k3d_scartissue.sl:21:	normal Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_scartissue.sl:29:	base = mix(dark,light,nz);
k3d/share/shaders/k3d_scartissue.sl:32:	Nf = faceforward(normalize(N), I );
k3d/share/shaders/k3d_scartissue.sl:34:	Ci = ( base * (Ka + Kd*diffuse(Nf)) + 
k3d/share/shaders/k3d_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:7: *   parallel to lines of s and t.  You can adjust the Ka, Kd, Ks, etc.
k3d/share/shaders/k3d_screen.sl:11: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader
k3d/share/shaders/k3d_screen.sl:13: *   density - how much of each cycle is opaque?
k3d/share/shaders/k3d_screen.sl:16: *   No antialiasing is performed here.
k3d/share/shaders/k3d_screen.sl:18: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_screen.sl: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:26:		   float density = 0.25, frequency = 20;)
k3d/share/shaders/k3d_screen.sl:30:  if(mod(s * frequency, 1) < density || mod(t * frequency, 1) < density)
k3d/share/shaders/k3d_screen.sl:33:      Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_screen.sl:35:	Os * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_screen_aa.sl:2: * screen_aa.sl -- RenderMan compatible shader for a metalic screen.
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:11: *   Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader
k3d/share/shaders/k3d_screen_aa.sl:13: *   density - how much of each cycle is opaque?
k3d/share/shaders/k3d_screen_aa.sl:17: * last modified  31 Jan 1994 by Larry Gritz
k3d/share/shaders/k3d_screen_aa.sl:20: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_screen_aa.sl: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:25:#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
k3d/share/shaders/k3d_screen_aa.sl:26:#define MINFILTERWIDTH 1.0e-7
k3d/share/shaders/k3d_screen_aa.sl:30:surface k3d_screen_aa(float Ka = 1, Kd = 0.75, Ks = 0.4, roughness = 0.1;
k3d/share/shaders/k3d_screen_aa.sl:32:		      float density = 0.25, frequency = 20;)
k3d/share/shaders/k3d_screen_aa.sl:34:  normal Nf;			/* Forward facing Normal vector */
k3d/share/shaders/k3d_screen_aa.sl:35:  vector IN;			/* normalized incident vector */
k3d/share/shaders/k3d_screen_aa.sl:36:  float d;			/* Density at the sample point */
k3d/share/shaders/k3d_screen_aa.sl:38:  float swidth, twidth, GWF, w, h;
k3d/share/shaders/k3d_screen_aa.sl:40:  /* Compute a forward facing normal */
k3d/share/shaders/k3d_screen_aa.sl:42:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_screen_aa.sl: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: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:53:  GWF = density * 0.5;
k3d/share/shaders/k3d_screen_aa.sl:54:  if(swidth >= 1)
k3d/share/shaders/k3d_screen_aa.sl:58:      clamp(boxstep(GWF - swidth, GWF, ss), max(1 - GWF / swidth, 0),
k3d/share/shaders/k3d_screen_aa.sl:59:	    1) - clamp(boxstep(1 - GWF - swidth, 1 - GWF, ss), 0,
k3d/share/shaders/k3d_screen_aa.sl:60:		       2 * GWF / swidth);
k3d/share/shaders/k3d_screen_aa.sl:61:  if(twidth >= 1)
k3d/share/shaders/k3d_screen_aa.sl:65:      clamp(boxstep(GWF - twidth, GWF, tt), max(1 - GWF / twidth, 0),
k3d/share/shaders/k3d_screen_aa.sl:66:	    1) - clamp(boxstep(1 - GWF - twidth, 1 - GWF, tt), 0,
k3d/share/shaders/k3d_screen_aa.sl:67:		       2 * GWF / twidth);
k3d/share/shaders/k3d_screen_aa.sl:68:  /* This would be the non-antialiased version:
k3d/share/shaders/k3d_screen_aa.sl:72:  d = 1 - w * h;
k3d/share/shaders/k3d_screen_aa.sl:74:  Oi = d;
k3d/share/shaders/k3d_screen_aa.sl:75:  if(d > 0)
k3d/share/shaders/k3d_screen_aa.sl:78:	Oi * (Cs * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_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:6: * sdixon(): Paint the body of a pencil.
k3d/share/shaders/k3d_sdixon.sl:9:k3d_sdixon(
k3d/share/shaders/k3d_sdixon.sl:11:		Kd		= 1.0, 
k3d/share/shaders/k3d_sdixon.sl:18:	point Nf = faceforward(normalize(N),I);
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:29: 	/* Use ink to mix yellow and green */
k3d/share/shaders/k3d_sdixon.sl:33:	   one, the diffuse component goes to zero and the specular 
k3d/share/shaders/k3d_sdixon.sl:34:	   component is increased. This has the effect of transitioning
k3d/share/shaders/k3d_sdixon.sl:35:	   from a matte surface to a metallic one as ink is added. */
k3d/share/shaders/k3d_sdixon.sl:37:	Ci = Os * cout * ( Ka*ambient() + (1-ink)*Kd*diffuse(Nf) +
k3d/share/shaders/k3d_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: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:11:    float width=1;
k3d/share/shaders/k3d_shadowdistant_rim.sl:14:    float __nondiffuse = 1;
k3d/share/shaders/k3d_shadowdistant_rim.sl:19:        if (shadowname != "") {
k3d/share/shaders/k3d_shadowdistant_rim.sl:20:                Cl *= 1 - shadow(shadowname, Ps, "samples", samples,
k3d/share/shaders/k3d_shadowdistant_rim.sl:21:                        "swidth", width, "twidth", width);
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:3:/* Listing 16.33  Spotlight using shadow map*/
k3d/share/shaders/k3d_shadowspot.sl:6: *  shadowspot(): spotlight with an optional shadow map
k3d/share/shaders/k3d_shadowspot.sl:8:light k3d_shadowspot( 
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:21:	point A = (to - from) / length(to - from); /* direction */
k3d/share/shaders/k3d_shadowspot.sl:22:	float	cosoutside= cos(coneangle),
k3d/share/shaders/k3d_shadowspot.sl:23:			cosinside = cos(coneangle-conedeltaangle);
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:30:		attenuation *= smoothstep( cosoutside, cosinside, cosangle );
k3d/share/shaders/k3d_shadowspot.sl:31:		if( shadowfile != "" )
k3d/share/shaders/k3d_shadowspot.sl:32:		    attenuation *= (1.0 - shadow( shadowfile, Ps, "samples", samples, "blur", blur, "bias", bias ));
k3d/share/shaders/k3d_shifteddrtile.sl:2: * TLShiftedD_RTile.sl -- generates a surface of alternating disks and rings
k3d/share/shaders/k3d_shifteddrtile.sl:5: *	Will generate alternating and shifted rows of disks and rings
k3d/share/shaders/k3d_shifteddrtile.sl:9: *	Ka, Kd, Ks - the usual
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:16: *	cstate1 - foreground color
k3d/share/shaders/k3d_shifteddrtile.sl:20: *	The center varible should really be placed in the parameter list 
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:28: *	tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_shifteddrtile.sl:31: *	Created: 8/12/95
k3d/share/shaders/k3d_shifteddrtile.sl:33:#define smoothPulse(a, b, fuzz, loc) \
k3d/share/shaders/k3d_shifteddrtile.sl:37:#define repeat(pos, freq) \
k3d/share/shaders/k3d_shifteddrtile.sl:38:	(mod (pos * freq, 1) )
k3d/share/shaders/k3d_shifteddrtile.sl:40:#define whichtile(pos, freq) \
k3d/share/shaders/k3d_shifteddrtile.sl:43:#define isOdd(x) \
k3d/share/shaders/k3d_shifteddrtile.sl:44:	((mod(x,2) == 1) ? 1 : 0)
k3d/share/shaders/k3d_shifteddrtile.sl:47:k3d_shifteddrtile (
k3d/share/shaders/k3d_shifteddrtile.sl:49:	uniform float Kd = .5;
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:57:	uniform color cstate1 = color(1, 0, 0);  /* foreground color */
k3d/share/shaders/k3d_shifteddrtile.sl:61:	uniform point center;      /* Center of disk */
k3d/share/shaders/k3d_shifteddrtile.sl:64:	float ss, tt;      /* tiled s, t */
k3d/share/shaders/k3d_shifteddrtile.sl:65:	float row, col;    /* used to determine which tile we are in */
k3d/share/shaders/k3d_shifteddrtile.sl:66:	float d;           /* distance from center of current tile */
k3d/share/shaders/k3d_shifteddrtile.sl:67:	float wasOdd;      /* True if test was odd */
k3d/share/shaders/k3d_shifteddrtile.sl:69:	Nf = faceforward (normalize(N),I);
k3d/share/shaders/k3d_shifteddrtile.sl:72:	center = (0.5, 0.5, 0);  /* This should really be */
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:79:		wasOdd = 0;
k3d/share/shaders/k3d_shifteddrtile.sl:83:		wasOdd = 1;
k3d/share/shaders/k3d_shifteddrtile.sl:87:	d = distance (center, (ss, tt, 0));
k3d/share/shaders/k3d_shifteddrtile.sl:89:	if (wasOdd == 1)
k3d/share/shaders/k3d_shifteddrtile.sl:91:		mix_opacity = smoothPulse (innerRadius, outerRadius, fuzz, d);
k3d/share/shaders/k3d_shifteddrtile.sl:93:		/* Do disk */
k3d/share/shaders/k3d_shifteddrtile.sl:94:		mix_opacity = 1 - smoothstep (outerRadius-fuzz, outerRadius+fuzz, d);
k3d/share/shaders/k3d_shifteddrtile.sl:100:	Ci = Os * (surfColor * (Ka*ambient() + Kd*diffuse(Nf)) +
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:8: *	Ka, Kd, Ks - the usual
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:14: *	eclipseCenter - Center of obscuring disk
k3d/share/shaders/k3d_shiftedmoontile.sl:15: *	cstate1 - Color of disk
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:23: *	tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_shiftedmoontile.sl:26: *	Created: 8/12/95
k3d/share/shaders/k3d_shiftedmoontile.sl:28:#define smoothPulse(a, b, fuzz, loc) \
k3d/share/shaders/k3d_shiftedmoontile.sl:32:#define repeat(pos, freq) \
k3d/share/shaders/k3d_shiftedmoontile.sl:33:	(mod (pos * freq, 1) )
k3d/share/shaders/k3d_shiftedmoontile.sl:35:#define whichtile(pos, freq) \
k3d/share/shaders/k3d_shiftedmoontile.sl:38:#define isOdd(x) \
k3d/share/shaders/k3d_shiftedmoontile.sl:39:	((mod(x,2) == 1) ? 1 : 0)
k3d/share/shaders/k3d_shiftedmoontile.sl:41:#define difference(a, b) ((a) - (a) * b)
k3d/share/shaders/k3d_shiftedmoontile.sl:44:k3d_shiftedmoontile (
k3d/share/shaders/k3d_shiftedmoontile.sl:46:	uniform float Kd = .5;
k3d/share/shaders/k3d_shiftedmoontile.sl:50:	uniform float radius = 0.45;
k3d/share/shaders/k3d_shiftedmoontile.sl:58:	uniform point center;            /* Center of disk */
k3d/share/shaders/k3d_shiftedmoontile.sl:62:	float ss, tt;            /* Tile coordinates */
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:68:	center = (0.5, 0.5, 0);  /* This should really be moved */
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: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:88:	Ci = Os * (surfColor * (Ka*ambient() + Kd*diffuse(Nf)) +
k3d/share/shaders/k3d_shiny.sl:5: *    Ka, Kd, Ks, roughness - The usual meaning
k3d/share/shaders/k3d_shiny.sl:8: *    envname, envspace, envrad - controls for using environment maps
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: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:35:		  float twosided = 0;)
k3d/share/shaders/k3d_shiny.sl:37:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_shiny.sl:39:    MaterialShinyMetal(Nf, Cs, Ka, Kd, Ks, roughness, Kr, blur, twosided,
k3d/share/shaders/k3d_shinymetal.sl:1:/* shinymetal.sl - Standard metal with environment mapping for
k3d/share/shaders/k3d_shinymetal.sl:2: * RenderMan Interface.
k3d/share/shaders/k3d_shinymetal.sl:5: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_shinymetal.sl: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:19:  Nf = faceforward(normalize(N), V);
k3d/share/shaders/k3d_shinymetal.sl:21:  D = vtransform("world", D);
k3d/share/shaders/k3d_shinyplastic.sl:5: *    Ka, Kd, Ks, roughness - The usual meaning
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: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: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:30:			 float twosided = 0;
k3d/share/shaders/k3d_shinyplastic.sl:33:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_shinyplastic.sl:35:    MaterialShinyPlastic(Nf, Cs, Ka, Kd, Ks, roughness, Kr, blur, ior,
k3d/share/shaders/k3d_shinyplastic.sl:36:			 twosided, ENVPARAMS);
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:9:k3d_show_st()
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: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:20: * sheencolor, shinmap = the color of the skin at grazing angles. Using a map overrides
k3d/share/shaders/k3d_skin1.sl:22: * blemishfreq, blemishthresh,blemhishopac = control the freqency, threshold and opacity
k3d/share/shaders/k3d_skin1.sl:25: * xdir, angle = control the direction of the specular highlights.
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:33: * You can replace the header functions by using
k3d/share/shaders/k3d_skin1.sl:34: * #include "locilum.h" and #include "noises.h".
k3d/share/shaders/k3d_skin1.sl:40: * Modification history:
k3d/share/shaders/k3d_skin1.sl:42: *     Renamed RudyCSkin for RMR.
k3d/share/shaders/k3d_skin1.sl:43: *     Made changes so would compile.
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:61:LocIllumWardAnisotropic (normal N;  vector V;
k3d/share/shaders/k3d_skin1.sl:62:                         vector xdir;  float xroughness, yroughness;)
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:73:  /* Must declare extern L & Cl because we're in a function */
k3d/share/shaders/k3d_skin1.sl:89:}    /*---locillum.h ends---*/
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: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:111:   a one-dimensional volumetric surface.  Given incident and outgoing
k3d/share/shaders/k3d_skin1.sl:112:   directions wi and wo, surface normal n, asymmetry value g (see above),
k3d/share/shaders/k3d_skin1.sl:113:   scattering albedo (between 0 and 1 for physically-valid volumes),
k3d/share/shaders/k3d_skin1.sl:114:   and the thickness of the volume, use the closed-form single-scattering
k3d/share/shaders/k3d_skin1.sl:117:float singleScatter(vector wi, wo; normal n; float g, albedo, thickness) {
k3d/share/shaders/k3d_skin1.sl:121:    return albedo * phase(wo, wi, g) / (win + won) *
k3d/share/shaders/k3d_skin1.sl:133:/* Implements overall skin subsurface shading model.  Takes viewing and
k3d/share/shaders/k3d_skin1.sl:160:}    /* subsurfaceSkin --ends */
k3d/share/shaders/k3d_skin1.sl:164:#define snoise(p) (2 * (float noise(p)) - 1)
k3d/share/shaders/k3d_skin1.sl:167: *shader beggins here.
k3d/share/shaders/k3d_skin1.sl:170:surface k3d_skin1(
k3d/share/shaders/k3d_skin1.sl:171:  float Kd = .1;
k3d/share/shaders/k3d_skin1.sl:182:  varying vector xdir = dPdu;
k3d/share/shaders/k3d_skin1.sl:190:        poresdepth = -0.001;)
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:216:  turb = pow(turb,poresthresh) * poresdepth;
k3d/share/shaders/k3d_skin1.sl:219:  /* displace normals*/
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:238:  PP = transform ("shader",P) * blemishfreq;
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: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: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:283:  lc = LocIllumWardAnisotropic(Nf,Vf,anisoDir,xroughness,yroughness);
k3d/share/shaders/k3d_skin1.sl:296:  Ci = sc + Kd * diffuse(Nf) ;
k3d/share/shaders/k3d_skin2.sl:6: * This software is placed in the public domain and is provided as is 
k3d/share/shaders/k3d_skin2.sl: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: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:30:   a one-dimensional volumetric surface.  Given incident and outgoing
k3d/share/shaders/k3d_skin2.sl:31:   directions wi and wo, surface normal n, asymmetry value g (see above),
k3d/share/shaders/k3d_skin2.sl:32:   scattering albedo (between 0 and 1 for physically-valid volumes),
k3d/share/shaders/k3d_skin2.sl:33:   and the thickness of the volume, use the closed-form single-scattering
k3d/share/shaders/k3d_skin2.sl:36:float singleScatter(vector wi, wo; normal n; float g, albedo, thickness) {
k3d/share/shaders/k3d_skin2.sl:40:    return albedo * phase(wo, wi, g) / (win + won) *
k3d/share/shaders/k3d_skin2.sl:54:/* Implements overall skin subsurface shading model.  Takes viewing and
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:88:/* Basic surface shader that uses the skin reflection model implemented
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_skymetal.sl:1:/* skymetal shader 
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:12: * tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_skymetal.sl:15:surface k3d_skymetal (
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: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:40:		refl = mix (land_horiz, land_zenith, -costheta);
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:13: 	Kd: Coefficient of diffuse light;
k3d/share/shaders/k3d_slateroof.sl:14:   sfreq: number of tiles on the s direction
k3d/share/shaders/k3d_slateroof.sl:15:   tfreq: number of tiles in the t direction
k3d/share/shaders/k3d_slateroof.sl:16: 	maxadd: the maximum amount of overlap of one tile and another
k3d/share/shaders/k3d_slateroof.sl:17: 	ramp: the amount of a tile used for the initial rise to the maximum height
k3d/share/shaders/k3d_slateroof.sl:18: 		a value between 0 and 1
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:21: 		and 1)
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:28: 		different random patterning. A value > 20 works best
k3d/share/shaders/k3d_slateroof.sl:37:	Nb. This shader would normally be used with the slateroofd shader to
k3d/share/shaders/k3d_slateroof.sl:38:	produce an appropriate displacement and message passing from the
k3d/share/shaders/k3d_slateroof.sl:39:	displacement shader would eliminate the need for a lot of the
k3d/share/shaders/k3d_slateroof.sl: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:48:k3d_slateroof(  float 	Ka = .2,
k3d/share/shaders/k3d_slateroof.sl:49: 							Kd = .8,
k3d/share/shaders/k3d_slateroof.sl:52:				   		maxadd = .5,
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: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:75:			temp_t_offset, newadd;			 
k3d/share/shaders/k3d_slateroof.sl:76:   uniform 	float colorfactor = 3.276 * factor;	/* Used in noise calculations */	
k3d/share/shaders/k3d_slateroof.sl:78:	float 	colorvary = 0,				    	/* the random amount by which a tile is lightened or darkened */
k3d/share/shaders/k3d_slateroof.sl:82:	normal Nf = normalize(faceforward(N,I));
k3d/share/shaders/k3d_slateroof.sl:85:	/* Work out which tile we are in, and the offset within that tile */
k3d/share/shaders/k3d_slateroof.sl:86:   ttile = tcoord / twidth;
k3d/share/shaders/k3d_slateroof.sl:87:	if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroof.sl:88:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroof.sl:89:   stile = scoord / swidth;
k3d/share/shaders/k3d_slateroof.sl:95:	/* Work out the displacement assuming the point is in 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:102:    * of the tile is used */
k3d/share/shaders/k3d_slateroof.sl:105:	if ((mod(ct,2) >= 1)  && ((stile == 0) || (stile == sfreq)))
k3d/share/shaders/k3d_slateroof.sl:106:	/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroof.sl:109:		add = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroof.sl:111:		add = 0;
k3d/share/shaders/k3d_slateroof.sl:114:	/* now calculate the displacement */
k3d/share/shaders/k3d_slateroof.sl:115:	temp_t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroof.sl:116:	if (1 - temp_t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:117:   	dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - temp_t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:119:	   dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), temp_t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:124:	if (temp_s_offset < gap * (1 + add))
k3d/share/shaders/k3d_slateroof.sl:125:	   disps = smoothstep(0, gap * (1 + add), temp_s_offset) * Km;
k3d/share/shaders/k3d_slateroof.sl:127:   	disps = Km;
k3d/share/shaders/k3d_slateroof.sl:128:	dispo = min(disps, dispt);
k3d/share/shaders/k3d_slateroof.sl:133:	 * storing the new tile in stile, ttile and new offset
k3d/share/shaders/k3d_slateroof.sl:135:	if ((t_offset <= maxadd) && (ttile >= 1))
k3d/share/shaders/k3d_slateroof.sl:138:			if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroof.sl:139:			/* We are in an offset tile row adjust the scoord appropriately for
k3d/share/shaders/k3d_slateroof.sl:141:				newscoord = scoord - offset;
k3d/share/shaders/k3d_slateroof.sl:143:				newscoord = scoord + offset;
k3d/share/shaders/k3d_slateroof.sl:144:			newstile = newscoord / swidth;
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:155:			if (t_offset <= newadd)
k3d/share/shaders/k3d_slateroof.sl:156:				/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroof.sl:163:					add = newadd;
k3d/share/shaders/k3d_slateroof.sl:167:	/* calculate the displacement again */
k3d/share/shaders/k3d_slateroof.sl:168:	t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroof.sl:169:	if (1 - t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:170:			dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:172:		    dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroof.sl:175:	if (s_offset < gap / (1 + add))
k3d/share/shaders/k3d_slateroof.sl:176:		disps = Km * smoothstep(0, gap / (1 + add), s_offset);
k3d/share/shaders/k3d_slateroof.sl:178:		disps = Km;
k3d/share/shaders/k3d_slateroof.sl:179:	disp = min(disps, dispt);
k3d/share/shaders/k3d_slateroof.sl:180:	if (dispo > disp)
k3d/share/shaders/k3d_slateroof.sl:182:	/*printf("#dispo = %f, disp = %f, colorvary = %f\n",dispo,disp,colorvary); */
k3d/share/shaders/k3d_slateroof.sl:199:	Ci = Ct * (Ka * ambient() + Kd * diffuse(faceforward( normalize(N), I )));
k3d/share/shaders/k3d_slateroofd.sl:1:/* Renamed to PQslateroofd.sl for RMR -- talrmr@SpamSucks_pacbell.net */
k3d/share/shaders/k3d_slateroofd.sl:4:  slateroofd.sl - a displacement shader to produce tiles on a roof
k3d/share/shaders/k3d_slateroofd.sl:9:    	Km: Maximum displacement of tiles;
k3d/share/shaders/k3d_slateroofd.sl:10:    	sfreq: number of tiles on the s direction
k3d/share/shaders/k3d_slateroofd.sl:11:    	tfreq: number of tiles in the t direction
k3d/share/shaders/k3d_slateroofd.sl:12: 		maxadd: the maximum amount of overlap of one tile and another
k3d/share/shaders/k3d_slateroofd.sl:13: 		ramp: the amount of a tile used for the initial rise to the maximum height
k3d/share/shaders/k3d_slateroofd.sl:14: 			a value between 0 and 1
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:17: 		and 1)
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:20: 			different random patterning. A value > 20 works best
k3d/share/shaders/k3d_slateroofd.sl:24:		This routine produces a random tiled effect. In the s direction the
k3d/share/shaders/k3d_slateroofd.sl:25:		tiles are regular, with every other row offset by half a tile width, as
k3d/share/shaders/k3d_slateroofd.sl:26:		normal roof tiles would be. Each tile is expanded by a random amount in
k3d/share/shaders/k3d_slateroofd.sl: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:43: displacement
k3d/share/shaders/k3d_slateroofd.sl:44:k3d_slateroofd(  float 	Km = 1.0,
k3d/share/shaders/k3d_slateroofd.sl:47:							maxadd = .5,
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: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:67:			temp_t_offset, newadd;			 
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:78:	if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroofd.sl:79:      scoord = scoord + offset; /* Displace alternate rows */
k3d/share/shaders/k3d_slateroofd.sl:80:   stile = scoord / swidth;
k3d/share/shaders/k3d_slateroofd.sl:86:	/* Work out the displacement assuming the point is in 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:94:			of the tile is used */
k3d/share/shaders/k3d_slateroofd.sl:97:   		if ((mod(ct,2) >= 1)  && ((stile == 0) || (stile == sfreq)))
k3d/share/shaders/k3d_slateroofd.sl:98:			/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroofd.sl:100:   		add = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroofd.sl:103: 		/* the very bottom row cannot expand */
k3d/share/shaders/k3d_slateroofd.sl:104:		add = 0;
k3d/share/shaders/k3d_slateroofd.sl:105:	/* now calculate the displacement */
k3d/share/shaders/k3d_slateroofd.sl:106:	temp_t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroofd.sl:107:	/* the above adjusts t_offset so that it runs from 0 to 1 within the expanded tile */
k3d/share/shaders/k3d_slateroofd.sl:108:   if (1 - temp_t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:109:		dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - temp_t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:111:	   dispt = Km / 2 + smoothstep( 0, 1 - ramp /(1 + add), temp_t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:116:	if (temp_s_offset < gap * (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:117:	   disps = smoothstep(0, gap * (1 + add), temp_s_offset) * Km;
k3d/share/shaders/k3d_slateroofd.sl:119:     	disps = Km;
k3d/share/shaders/k3d_slateroofd.sl:120:	dispo = min(disps, dispt);
k3d/share/shaders/k3d_slateroofd.sl:121:	disp = dispo;
k3d/share/shaders/k3d_slateroofd.sl:125:		storing the new tile in stile, ttile and new offset
k3d/share/shaders/k3d_slateroofd.sl:127:	if ((t_offset <= maxadd) && (ttile >= 1))
k3d/share/shaders/k3d_slateroofd.sl:130:			if (mod(ttile,2) >= 1)
k3d/share/shaders/k3d_slateroofd.sl:131:				/* We are in an offset tile row adjust the scoord appropriately for
k3d/share/shaders/k3d_slateroofd.sl:133:				newscoord = scoord - offset;
k3d/share/shaders/k3d_slateroofd.sl:135:				newscoord = scoord + offset;
k3d/share/shaders/k3d_slateroofd.sl:136:			newstile = newscoord / swidth;
k3d/share/shaders/k3d_slateroofd.sl:142:			if ((mod(ct,2) >= 1) && ((newstile == 0) || (newstile == sfreq)))
k3d/share/shaders/k3d_slateroofd.sl:143:				/* An offset row, so we must deal with the half tiles */
k3d/share/shaders/k3d_slateroofd.sl:145:			newadd = noise(cs * factor, ct * factor) * maxadd;
k3d/share/shaders/k3d_slateroofd.sl:146:			if (t_offset <= newadd)
k3d/share/shaders/k3d_slateroofd.sl:147:			/* if t_offset <= newadd we are actually in the overlapping tile */
k3d/share/shaders/k3d_slateroofd.sl:154:					add = newadd;
k3d/share/shaders/k3d_slateroofd.sl:156:			/* calculate the displacement again */
k3d/share/shaders/k3d_slateroofd.sl:157:			t_offset = t_offset / (1 + add); 
k3d/share/shaders/k3d_slateroofd.sl:158:			if (1 - t_offset <= ramp / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:160:					dispt = Km / 2 + smoothstep(0, ramp / (1 + add), (1 - t_offset)) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:163:				dispt = Km / 2 +  smoothstep( 0, 1 - ramp, t_offset) * Km / 2;
k3d/share/shaders/k3d_slateroofd.sl:166:			if (s_offset < gap / (1 + add))
k3d/share/shaders/k3d_slateroofd.sl:167:				disps = Km * smoothstep(0, gap / (1 + add), s_offset);
k3d/share/shaders/k3d_slateroofd.sl:169:				disps = Km;
k3d/share/shaders/k3d_slateroofd.sl:170:			disp = min(disps, dispt);
k3d/share/shaders/k3d_slateroofd.sl:171:			disp = max(dispo,disp);
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:176:	P += Nf * (disp / max(spacescale, 1e-6));
k3d/share/shaders/k3d_slateroofd.sl:177:	/*printf("disp = %f\n",disp);*/
k3d/share/shaders/k3d_slideprojector.sl:1:light k3d_slideprojector(float intensity = 2000;
k3d/share/shaders/k3d_slideprojector.sl:6:			 float conedeltaangle = 5; float beamdistribution = 2;
k3d/share/shaders/k3d_slideprojector.sl:7:			 string slidename = "")
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: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:41:    if(slidename == "")
k3d/share/shaders/k3d_slideprojector.sl:47:	Ct = color texture(slidename, sloc, tloc);
k3d/share/shaders/k3d_smoke.sl:5: *    This is a volume shader for smoke.  Trapezoidal integration is
k3d/share/shaders/k3d_smoke.sl:6: *    used to find scattering and extinction.
k3d/share/shaders/k3d_smoke.sl:9: *   opacdensity - overall smoke density control as it affects its ability
k3d/share/shaders/k3d_smoke.sl:10: *          to block light from behind it.
k3d/share/shaders/k3d_smoke.sl:11: *   lightdensity - smoke density control as it affects light scattering
k3d/share/shaders/k3d_smoke.sl: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:19: *   scatter - when non-1, can be used to give wavelength-dependent
k3d/share/shaders/k3d_smoke.sl:28:#include "k3d_noises.h"
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:32: * compute the smoke density at that point.  Only count lights tagged
k3d/share/shaders/k3d_smoke.sl:35:void smokedensity(point Pcur, Pshad;
k3d/share/shaders/k3d_smoke.sl:51:      point Psmoke = Pshad * smokefreq;
k3d/share/shaders/k3d_smoke.sl:77:volume k3d_smoke(float opacdensity = 1, lightdensity = 1;
k3d/share/shaders/k3d_smoke.sl:78:		 float integstart = 0, integend = 100;
k3d/share/shaders/k3d_smoke.sl:84:  point origin = transform("shader", Worigin);
k3d/share/shaders/k3d_smoke.sl:85:  float dtau, last_dtau;
k3d/share/shaders/k3d_smoke.sl:88:  /* Integrate forwards from the start point */
k3d/share/shaders/k3d_smoke.sl:89:  float d = integstart + random() * stepsize;
k3d/share/shaders/k3d_smoke.sl:90:  vector IN = normalize(vtransform("shader", I));
k3d/share/shaders/k3d_smoke.sl:91:  vector WIN = vtransform("shader", "current", IN);
k3d/share/shaders/k3d_smoke.sl:94:  float end = min(length(I), integend) - 0.0001;
k3d/share/shaders/k3d_smoke.sl:95:  float ss = min(stepsize, end - d);
k3d/share/shaders/k3d_smoke.sl:96:  /* Get the in-scattered light and the local smoke density for the
k3d/share/shaders/k3d_smoke.sl:99:  smokedensity(Worigin + d * WIN, origin + d * IN, smokevary, smokefreq,
k3d/share/shaders/k3d_smoke.sl:100:	       smokeoctaves, ss, last_li, last_dtau);
k3d/share/shaders/k3d_smoke.sl:103:  while(d <= end)
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:106:      ss = clamp(ss, 0.005, end - d);
k3d/share/shaders/k3d_smoke.sl:107:      d += ss;
k3d/share/shaders/k3d_smoke.sl:108:      smokedensity(Worigin + d * WIN, origin + d * IN, smokevary, smokefreq,
k3d/share/shaders/k3d_smoke.sl:109:		   smokeoctaves, ss, li, dtau);
k3d/share/shaders/k3d_smoke.sl:111:      /* Find the blocking and light scattering contribution of 
k3d/share/shaders/k3d_smoke.sl:112:       * the portion of the volume covered by this step.
k3d/share/shaders/k3d_smoke.sl:114:      float tau = opacdensity * ss / 2 * (dtau + last_dtau);
k3d/share/shaders/k3d_smoke.sl:116:	lightdensity * ss / 2 * (li * dtau + last_li * last_dtau);
k3d/share/shaders/k3d_smoke.sl:118:      /* Composite with exponential extinction of background light */
k3d/share/shaders/k3d_smoke.sl:121:      last_dtau = dtau;
k3d/share/shaders/k3d_smoke.sl:125:  /* Ci & Oi are the color and opacity of the background element.
k3d/share/shaders/k3d_smoke.sl:126:   * Now Cv is the light contributed by the volume itself, and Ov is the
k3d/share/shaders/k3d_smoke.sl:127:   * opacity of the volume, i.e. (1-Ov)*Ci is the light from the background
k3d/share/shaders/k3d_smoke2.sl:3: * random() as it made my animation look to funky -- tal 9/4/96
k3d/share/shaders/k3d_smoke2.sl:6: *    This is a volume shader for smoke.  Trapezoidal integration is
k3d/share/shaders/k3d_smoke2.sl:7: *    used to integrate the GADD to find scattering and extinction.
k3d/share/shaders/k3d_smoke2.sl: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: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:24: *   9/4/96 tal -- took out random call and renamed to TLSmoke
k3d/share/shaders/k3d_smoke2.sl:28: * $Log: k3d_smoke2.sl,v $
k3d/share/shaders/k3d_smoke2.sl:29: * Revision 1.1  2004/05/19 18:15:20  tshead
k3d/share/shaders/k3d_smoke2.sl:30: * * Moved scripts & shaders to the share directory
k3d/share/shaders/k3d_smoke2.sl:36: * Eliminated duplicate local variable declarations
k3d/share/shaders/k3d_smoke2.sl:39: * Compute only one octave of noise when not lit (big speedup)
k3d/share/shaders/k3d_smoke2.sl:47:#define snoise(p) (2*noise(p)-1)
k3d/share/shaders/k3d_smoke2.sl:50:/* Here is where we define the GADD. */
k3d/share/shaders/k3d_smoke2.sl:51:#define GADD(PP,PW,li,g)                                                    \
k3d/share/shaders/k3d_smoke2.sl:67:             g = density * smoothstep(-1,1,smokevary*smoke);                \
k3d/share/shaders/k3d_smoke2.sl:68:         } else g = density;                                                \
k3d/share/shaders/k3d_smoke2.sl:77:k3d_smoke2 (float density = 60;
k3d/share/shaders/k3d_smoke2.sl:78:	    float integstart = 0, integend = 100;
k3d/share/shaders/k3d_smoke2.sl:80:	    float debug = 0;
k3d/share/shaders/k3d_smoke2.sl:88:#ifdef BMRT
k3d/share/shaders/k3d_smoke2.sl:90:  point incident = vtransform ("shader", -I);
k3d/share/shaders/k3d_smoke2.sl:91:#else  /* PRMan and BMRT have I reverse of each other, conflict in spec */
k3d/share/shaders/k3d_smoke2.sl:93:  point incident = vtransform ("shader", I);
k3d/share/shaders/k3d_smoke2.sl:94:#endif
k3d/share/shaders/k3d_smoke2.sl:95:  point origin = transform ("shader", Worigin);
k3d/share/shaders/k3d_smoke2.sl:97:  float d, sigma, tau;
k3d/share/shaders/k3d_smoke2.sl:99:  color dC, dO;                   /* differential color & opacity */
k3d/share/shaders/k3d_smoke2.sl:100:  float ss, dtau, last_dtau, end;
k3d/share/shaders/k3d_smoke2.sl:101:  float nsteps = 0;          /* record number of integration steps */
k3d/share/shaders/k3d_smoke2.sl:107:  end = min (length (incident), integend) - 0.0001;
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:111:  if (d < end) {
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:116:      GADD (PP, PW, li, dtau)
k3d/share/shaders/k3d_smoke2.sl:117:      ss = min (stepsize, end-d);
k3d/share/shaders/k3d_smoke2.sl:118:      d += ss;
k3d/share/shaders/k3d_smoke2.sl:121:      while (d <= end) {
k3d/share/shaders/k3d_smoke2.sl:122:	  last_dtau = dtau;
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:126:	  GADD (PP, PW, li, dtau)
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:130:	  tau = .5 * ss * (dtau + last_dtau);
k3d/share/shaders/k3d_smoke2.sl:131:	  lighttau = .5 * ss * (li*dtau + last_li*last_dtau);
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:135:	  dC = lighttau * dO;
k3d/share/shaders/k3d_smoke2.sl:137:	  /* Now we adjust Cv/Ov to account for dC and dO */
k3d/share/shaders/k3d_smoke2.sl:138:	  Cv += (1-Ov)*dC;
k3d/share/shaders/k3d_smoke2.sl:139:	  Ov += (1-Ov)*dO;
k3d/share/shaders/k3d_smoke2.sl:141:	  ss = max (min (ss, end-d), 0.005);
k3d/share/shaders/k3d_smoke2.sl:142:	  d += ss;
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:156:  if (debug > 0) {
k3d/share/shaders/k3d_smoke2.sl:157:      printf ("nsteps = %f, t1 = %f, end = %f\n", nsteps, integstart, end);
k3d/share/shaders/k3d_softboxes.sl:10:* To do: accomodate negative widths. twosided/onesided cards.
k3d/share/shaders/k3d_softboxes.sl:14:** $Id: k3d_softboxes.sl,v 1.1 2004/05/19 18:15:20 tshead Exp $
k3d/share/shaders/k3d_softboxes.sl:16:** Derived from softbox3 v1.2 - Author Bjorke for all
k3d/share/shaders/k3d_softboxes.sl:23:#define BOOL float
k3d/share/shaders/k3d_softboxes.sl:24:#define ENUM float
k3d/share/shaders/k3d_softboxes.sl:26:#define SHAD_BOX_FILT 0
k3d/share/shaders/k3d_softboxes.sl:27:#define SHAD_GAUSSIAN_FILT 1
k3d/share/shaders/k3d_softboxes.sl:29:#define TEX_GAUSSIAN_FILT 0
k3d/share/shaders/k3d_softboxes.sl:30:#define TEX_BOX_FILT 1
k3d/share/shaders/k3d_softboxes.sl:31:#define TEX_RADIAL_FILT 2
k3d/share/shaders/k3d_softboxes.sl:32:#define TEX_DISK_FILT 3
k3d/share/shaders/k3d_softboxes.sl:34:#define HALFSIZE
k3d/share/shaders/k3d_softboxes.sl:36:#define OBEY_THIS "Reflectivity"
k3d/share/shaders/k3d_softboxes.sl:38:#define CLASSIC 0
k3d/share/shaders/k3d_softboxes.sl:39:#define SPHERICAL 1
k3d/share/shaders/k3d_softboxes.sl:41:#define CUBEFACE 0
k3d/share/shaders/k3d_softboxes.sl:42:#define LATLONG 1
k3d/share/shaders/k3d_softboxes.sl:51:/*      by  a,b and A,B for the inner and outer ellipses, respectively)	***/
k3d/share/shaders/k3d_softboxes.sl:53:/*   - 0 if Q was inside the inner ellipse				***/
k3d/share/shaders/k3d_softboxes.sl:54:/*   - 1 if Q was outside the outer ellipse				***/
k3d/share/shaders/k3d_softboxes.sl:58:/* this is the identical function used by sqLight etc */
k3d/share/shaders/k3d_softboxes.sl:64:    uniform float roundness;  /* Same roundness for both ellipses */
k3d/share/shaders/k3d_softboxes.sl:68:    if (roundness < 1.0e-6) {
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:85:void softbox_contrib2(
k3d/share/shaders/k3d_softboxes.sl:88:    uniform string	boxCoords;
k3d/share/shaders/k3d_softboxes.sl:93:			boxWidth,
k3d/share/shaders/k3d_softboxes.sl:95:			boxWEdge,
k3d/share/shaders/k3d_softboxes.sl:96:			boxHEdge,
k3d/share/shaders/k3d_softboxes.sl:97:			boxRoundness;
k3d/share/shaders/k3d_softboxes.sl:100:    uniform float	decayExp;
k3d/share/shaders/k3d_softboxes.sl:105:    uniform string filtTypes[4] = {"gaussian","box","radial-bspline","disk"};
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:115:#ifdef HALFSIZE
k3d/share/shaders/k3d_softboxes.sl:116:    uniform float bw2 = boxWidth/2;
k3d/share/shaders/k3d_softboxes.sl:119:#define bw2 boxWidth
k3d/share/shaders/k3d_softboxes.sl:120:#define bh2 boxHeight
k3d/share/shaders/k3d_softboxes.sl:121:#endif
k3d/share/shaders/k3d_softboxes.sl:122:    uniform float we = max(boxWEdge,-bw2);
k3d/share/shaders/k3d_softboxes.sl:123:    uniform float he = max(boxHEdge,-bh2);
k3d/share/shaders/k3d_softboxes.sl:135:	contrib = 1 - clipSuperellipse (Pplane, iW, iH, oW,oH, boxRoundness);
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:170:    theColor = contrib * ct * boxColor / pow(pDist,decayExp);	/* premultiplied!!!!! */
k3d/share/shaders/k3d_softboxes.sl:177:float sbShadow(
k3d/share/shaders/k3d_softboxes.sl:187:    varying float inShadow = shadow (theName,
k3d/share/shaders/k3d_softboxes.sl:193:    return(inShadow);
k3d/share/shaders/k3d_softboxes.sl:200:light k3d_softboxes(
k3d/share/shaders/k3d_softboxes.sl:202:#ifdef BMRT
k3d/share/shaders/k3d_softboxes.sl: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:208:#endif /* BMRT */
k3d/share/shaders/k3d_softboxes.sl:211:    float	decayRate	= 0;
k3d/share/shaders/k3d_softboxes.sl:214:    float	edgeRolloff = 0,
k3d/share/shaders/k3d_softboxes.sl:215:    		edgeAngle = 90,
k3d/share/shaders/k3d_softboxes.sl:216:		edgeExp = 1;
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:220:    float	boxWidth1	= 1,
k3d/share/shaders/k3d_softboxes.sl:221:		boxWEdge1	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:223:		boxHEdge1	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:224:		boxRoundness1	= 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:232:    float	boxWidth2	= 1,
k3d/share/shaders/k3d_softboxes.sl:233:		boxWEdge2	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:235:		boxHEdge2	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:236:		boxRoundness2	= 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:244:    float	boxWidth3	= 1,
k3d/share/shaders/k3d_softboxes.sl:245:		boxWEdge3	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:247:		boxHEdge3	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:248:		boxRoundness3	= 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:256:    float	boxWidth4	= 1,
k3d/share/shaders/k3d_softboxes.sl:257:		boxWEdge4	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:259:		boxHEdge4	= -0.1,
k3d/share/shaders/k3d_softboxes.sl:260:		boxRoundness4	= 0;
k3d/share/shaders/k3d_softboxes.sl:273:    color shadowcolor = 0;
k3d/share/shaders/k3d_softboxes.sl:274:    float shadowintensity = 1;
k3d/share/shaders/k3d_softboxes.sl:275:    string shadowname = "";
k3d/share/shaders/k3d_softboxes.sl:276:    ENUM	shadowfilt = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:277:    float   shadowblur = 0.01,
k3d/share/shaders/k3d_softboxes.sl:278:	    shadowbias = 0,
k3d/share/shaders/k3d_softboxes.sl:279:	    shadowsamples = 16;
k3d/share/shaders/k3d_softboxes.sl:280:    string shadownameb = "";
k3d/share/shaders/k3d_softboxes.sl:281:    ENUM	shadowfiltb = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:282:    float   shadowblurb = 0.01,
k3d/share/shaders/k3d_softboxes.sl:283:	    shadowbiasb = 0,
k3d/share/shaders/k3d_softboxes.sl:284:	    shadowsamplesb = 16;
k3d/share/shaders/k3d_softboxes.sl:285:    string shadownamec = "";
k3d/share/shaders/k3d_softboxes.sl:286:    ENUM	shadowfiltc = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:287:    float   shadowblurc = 0.01,
k3d/share/shaders/k3d_softboxes.sl:288:	    shadowbiasc = 0,
k3d/share/shaders/k3d_softboxes.sl:289:	    shadowsamplesc = 16;
k3d/share/shaders/k3d_softboxes.sl:290:    string shadownamed = "";
k3d/share/shaders/k3d_softboxes.sl:291:    ENUM	shadowfiltd = SHAD_BOX_FILT;
k3d/share/shaders/k3d_softboxes.sl:292:    float   shadowblurd = 0.01,
k3d/share/shaders/k3d_softboxes.sl:293:	    shadowbiasd = 0,
k3d/share/shaders/k3d_softboxes.sl:294:	    shadowsamplesd = 16;
k3d/share/shaders/k3d_softboxes.sl:299:    output varying float __nondiffuse = 1;
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:307:    normal Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_softboxes.sl:309:    uniform float edgeLimVal = cos(radians(90-clamp(edgeAngle,0,90)));
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: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:329:    __nondiffuse = NonDiffuse;
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:362:boxCoord1,boxTex1,boxTexStr1,
k3d/share/shaders/k3d_softboxes.sl:364:		    boxWidth1,boxHeight1,boxWEdge1,boxHEdge1,
k3d/share/shaders/k3d_softboxes.sl:365:		    boxRoundness1,boxColor1,boxOpacity1,decayRate,
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:374:boxCoord2,boxTex2,boxTexStr2,
k3d/share/shaders/k3d_softboxes.sl:376:		    boxWidth2,boxHeight2,boxWEdge2,boxHEdge2,
k3d/share/shaders/k3d_softboxes.sl:377:		    boxRoundness2,boxColor2,boxOpacity2,decayRate,
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:386:boxCoord3,boxTex3,boxTexStr3,
k3d/share/shaders/k3d_softboxes.sl:388:		    boxWidth3,boxHeight3,boxWEdge3,boxHEdge3,
k3d/share/shaders/k3d_softboxes.sl:389:		    boxRoundness3,boxColor3,boxOpacity3,decayRate,
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:398:boxCoord4,boxTex4,boxTexStr4,
k3d/share/shaders/k3d_softboxes.sl:400:		    boxWidth4,boxHeight4,boxWEdge4,boxHEdge4,
k3d/share/shaders/k3d_softboxes.sl:401:		    boxRoundness4,boxColor4,boxOpacity4,decayRate,
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: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: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:451:		    Cl = sortedColor[k]+(Cl*(1-sortedOpac[k]));
k3d/share/shaders/k3d_softboxes.sl:454:	    /* Apply shadow mapped shadows */
k3d/share/shaders/k3d_softboxes.sl:459:	    if (edgeRolloff > 0) {
k3d/share/shaders/k3d_softboxes.sl:461:		q = In.Nn/edgeLimVal;
k3d/share/shaders/k3d_softboxes.sl:462:		q = 1 - clamp(edgeRolloff*pow(clamp(abs(q),0,1),1/max(edgeExp,0.001)),0,1);
k3d/share/shaders/k3d_softboxes.sl:465:	    varying float shadowed;
k3d/share/shaders/k3d_softboxes.sl:466:	    if (shadowname != "") {
k3d/share/shaders/k3d_softboxes.sl:467:	    shadowed = sbShadow(shadowname,Ps,shadowfilt,
k3d/share/shaders/k3d_softboxes.sl:468:			shadowblur,shadowsamples,shadowbias);
k3d/share/shaders/k3d_softboxes.sl:469:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:471:	    if (shadownameb != "") {
k3d/share/shaders/k3d_softboxes.sl:472:	    shadowed = sbShadow(shadownameb,Ps,shadowfiltb,
k3d/share/shaders/k3d_softboxes.sl:473:			shadowblurb,shadowsamplesb,shadowbiasb);
k3d/share/shaders/k3d_softboxes.sl:474:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:476:	    if (shadownamec != "") {
k3d/share/shaders/k3d_softboxes.sl:477:	    shadowed = sbShadow(shadownamec,Ps,shadowfiltc,
k3d/share/shaders/k3d_softboxes.sl:478:			shadowblurc,shadowsamplesc,shadowbiasc);
k3d/share/shaders/k3d_softboxes.sl:479:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:481:	    if (shadownamed != "") {
k3d/share/shaders/k3d_softboxes.sl:482:	    shadowed = sbShadow(shadownamed,Ps,shadowfiltd,
k3d/share/shaders/k3d_softboxes.sl:483:			shadowblurd,shadowsamplesd,shadowbiasd);
k3d/share/shaders/k3d_softboxes.sl:484:	    fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_softboxes.sl:486:	    __inShadow = fullShad; 
k3d/share/shaders/k3d_softboxes.sl: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:12: *   endPulse -- end of pulse function
k3d/share/shaders/k3d_spacecloud.sl:13: *   fuzz -- amount to blur the edges of the pulse
k3d/share/shaders/k3d_spacecloud.sl:14: *   minAdjust -- amount that can be subtracted from value
k3d/share/shaders/k3d_spacecloud.sl:15: *   maxAdjust -- amount that can be added to the value
k3d/share/shaders/k3d_spacecloud.sl:19: *  Only tested on rectanglar patch.
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:33:#define  MINFREQ 1.1
k3d/share/shaders/k3d_spacecloud.sl:34:#define MAXFREQ 6
k3d/share/shaders/k3d_spacecloud.sl:36:#define snoise(x) (2 * noise(x) - 1)
k3d/share/shaders/k3d_spacecloud.sl:37:#define snoise2(x, y) (2 * noise(x, y) - 1)
k3d/share/shaders/k3d_spacecloud.sl:39:#define adjustNoise2(x, y, minVal, maxVal) \
k3d/share/shaders/k3d_spacecloud.sl:43:#define smoothPulse2Fuzz(a, b, afuzz, bfuzz, loc) \
k3d/share/shaders/k3d_spacecloud.sl:47:surface k3d_spacecloud(
k3d/share/shaders/k3d_spacecloud.sl:50:  float endPulse = .9; /* .9 .8 .7 .8 */
k3d/share/shaders/k3d_spacecloud.sl:53:  float minAdjust = -.4;
k3d/share/shaders/k3d_spacecloud.sl:54:  float maxAdjust = .4;
k3d/share/shaders/k3d_spacecloud.sl:63:  float adjust;
k3d/share/shaders/k3d_spacecloud.sl:78:#define  MINFREQ 1.1
k3d/share/shaders/k3d_spacecloud.sl:79:#define MAXFREQ 6
k3d/share/shaders/k3d_spacecloud.sl:80:	/* Old way */
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:86:	adjust = adjustNoise2 (u, v, minAdjust, maxAdjust);
k3d/share/shaders/k3d_spacecloud.sl:87:	ss = s + adjust;
k3d/share/shaders/k3d_spacecloud.sl:88:	tt = t + adjust;
k3d/share/shaders/k3d_spacecloud.sl:91:#endif
k3d/share/shaders/k3d_spacecloud.sl:92:	Oi = value * smoothPulse2Fuzz (startPulse, endPulse, afuzz, afuzz, ss) * 
k3d/share/shaders/k3d_spacecloud.sl:93:		smoothPulse2Fuzz (startPulse, endPulse, bfuzz, afuzz, tt);
k3d/share/shaders/k3d_spaceshiphull1.sl:1:#define snoise(x) (2 * noise(x) - 1)
k3d/share/shaders/k3d_spaceshiphull1.sl:17:surface k3d_spaceshiphull1(
k3d/share/shaders/k3d_spaceshiphull1.sl:19:	float Kd = 1;
k3d/share/shaders/k3d_spaceshiphull1.sl:22:	float width = .1; float height = .06;
k3d/share/shaders/k3d_spaceshiphull1.sl:33:  ss = s / width;
k3d/share/shaders/k3d_spaceshiphull1.sl:44:  // Add grime
k3d/share/shaders/k3d_spaceshiphull1.sl:47:  // Add specular contribution
k3d/share/shaders/k3d_spaceshiphull1.sl:50:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_spaceshiphull1.sl:53:  Ci = Os * platecolor * (Ka * ambient() + Kd * diffuse(Nf)) + specularcolor * platespecular * specular(Nf, V, roughness);
k3d/share/shaders/k3d_spotlight.sl:1:/* spotlight.sl - Standard spot light source for RenderMan Interface.
k3d/share/shaders/k3d_spotlight.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_spotlight.sl: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:9:light k3d_spotlight(float intensity = 1;
k3d/share/shaders/k3d_spotlight.sl:11:		    point from = point "shader"(0, 0, 0);
k3d/share/shaders/k3d_spotlight.sl: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:23:    atten = pow(cosangle, beamdistribution) / (L.L);
k3d/share/shaders/k3d_spotlight.sl:25:      smoothstep(cos(coneangle), cos(coneangle - conedeltaangle), cosangle);
k3d/share/shaders/k3d_square_ridges.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
k3d/share/shaders/k3d_square_ridges.sl:4:// Contact: tshead@k-3d.com
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:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_square_ridges.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_square_ridges.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_square_ridges.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_square_ridges.sl:18:// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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:26:#define MIN_FILTER_WIDTH 1.0e-6
k3d/share/shaders/k3d_square_ridges.sl:27:#define filter_width(x) max(abs(Du(x)*du) + abs(Dv(x)*dv), MIN_FILTER_WIDTH)
k3d/share/shaders/k3d_square_ridges.sl:30:float pulse(float edge0, edge1, x)
k3d/share/shaders/k3d_square_ridges.sl: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: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:57:displacement k3d_square_ridges(
k3d/share/shaders/k3d_square_ridges.sl:63:	float ridge_position = filtered_pulse_train(0.5 / Frequency, 1.0 / Frequency, t + (Offset / Frequency), filter_width(t));
k3d/share/shaders/k3d_square_ridges.sl:64://	float ridge_position = pulse_train(0.5 / Frequency, 1.0 / Frequency, u, filter_width(u));
k3d/share/shaders/k3d_square_ridges.sl:67:	P += Nn * ((Km * ridge_position) / length(vtransform("shader", Nn)));
k3d/share/shaders/k3d_square_ridges.sl:68://	P += Km * ridge_position * N;
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: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:18:   by Rob Bredow and Scott Stokdyk 
k3d/share/shaders/k3d_srfdeformation.sl:22:fnc_mydiffuse (color Cl; 
k3d/share/shaders/k3d_srfdeformation.sl:35:void 
k3d/share/shaders/k3d_srfdeformation.sl:39:    point Pndc = transform("NDC", P);
k3d/share/shaders/k3d_srfdeformation.sl:41:    X = xcomp(Pndc);
k3d/share/shaders/k3d_srfdeformation.sl:42:    Y = ycomp(Pndc);
k3d/share/shaders/k3d_srfdeformation.sl:47:k3d_srfdeformation(
k3d/share/shaders/k3d_srfdeformation.sl:49:    float debug = 0;            /* 0 = deformed lit image
k3d/share/shaders/k3d_srfdeformation.sl:50:				   1 = texture deformed with no lighting
k3d/share/shaders/k3d_srfdeformation.sl: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:62:    float illum_width = 180;
k3d/share/shaders/k3d_srfdeformation.sl:73:    /* Calculate shading difference between P and Porig*/
k3d/share/shaders/k3d_srfdeformation.sl:76:    N1 = faceforward(normalize(N),I);
k3d/share/shaders/k3d_srfdeformation.sl:78:    N2 = faceforward(normalize(N),I);
k3d/share/shaders/k3d_srfdeformation.sl:82:    /* These lighting loops can be enhanced to calculate
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:86:	Ci1 += Kd * fnc_mydiffuse(Cl,L,N1);
k3d/share/shaders/k3d_srfdeformation.sl:89:    illuminance(Porig, N2, radians(illum_width)) {
k3d/share/shaders/k3d_srfdeformation.sl:90:	Ci2 += Kd * fnc_mydiffuse(Cl,L,N2);
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: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:17:k3d_star(
k3d/share/shaders/k3d_star.sl:19:    uniform float Kd = 1;
k3d/share/shaders/k3d_star.sl:26:    point Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_star.sl:34:    uniform point d0 = p1 - p0;
k3d/share/shaders/k3d_star.sl:35:    point d1;
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:45:    in_out = step(0, zcomp(d0^d1));
k3d/share/shaders/k3d_star.sl:48:    /* diffuse ("matte") shading model */
k3d/share/shaders/k3d_star.sl:50:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_starfield.sl:2:	Makes a star field.  Best when used as a surface shader for the inside	of a large sphere.
k3d/share/shaders/k3d_starfield.sl: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: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:29:	Ci = intensity * star_intensity * inside_star * inside_star;
k3d/share/shaders/k3d_stones.sl:3: * RudyCstones.sl
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:18: * this code.
k3d/share/shaders/k3d_stones.sl:21: * ka, Kd, Ks, roughness = the usual
k3d/share/shaders/k3d_stones.sl:22: * Km = amount of displacement
k3d/share/shaders/k3d_stones.sl:23: * displace = should the surface be bumped(0) or displaced (1)?
k3d/share/shaders/k3d_stones.sl: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: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:34: * displacements.
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:46:#define fuzzpulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - \
k3d/share/shaders/k3d_stones.sl:49:#define snoise(x)    (noise(x) * 2 - 1)
k3d/share/shaders/k3d_stones.sl:50:#define snoise2(x,y) (noise(x,y) * 2 - 1)
k3d/share/shaders/k3d_stones.sl:51:#define whichtile(x,freq) (floor((x) * (freq)))
k3d/share/shaders/k3d_stones.sl:52:#define MINFILTERWIDTH  1e-7
k3d/share/shaders/k3d_stones.sl:53:#define filterwidth_point(p) (max(sqrt(area(p)), MINFILTERWIDTH))
k3d/share/shaders/k3d_stones.sl:54:#define udn(x,lo,hi) (smoothstep(.25, .75, noise(x)) * ((hi) - (lo)) + (lo))
k3d/share/shaders/k3d_stones.sl: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: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:82:surface k3d_stones (
k3d/share/shaders/k3d_stones.sl:83:    float Ka = .6, Kd = .85,
k3d/share/shaders/k3d_stones.sl:86:          displace = 0;
k3d/share/shaders/k3d_stones.sl:92:   color  groundcolor = color (.45,0.35,0.2);
k3d/share/shaders/k3d_stones.sl:101: float d,d0,d1;
k3d/share/shaders/k3d_stones.sl:109: surface_color = groundcolor;
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:125:   /*tile index to be use in vary each*/
k3d/share/shaders/k3d_stones.sl:126:   float stoneindex = stile + 13 * ttile;
k3d/share/shaders/k3d_stones.sl:138:   d = distance(p1, p2);
k3d/share/shaders/k3d_stones.sl:139:   /*mag= ((0.5 * .8 - abs(bub - 0.5)) / .8) * 60 *(.09 - d * d) *
k3d/share/shaders/k3d_stones.sl:141:   mag= (0.5 - abs(bub - 0.5)) * 90 *(.09 - d * d)*((maxfreq - freq)/maxfreq);
k3d/share/shaders/k3d_stones.sl:144:   /*create a diferent color for each rock*/
k3d/share/shaders/k3d_stones.sl:145:   layer_color = varyEach(stonecolor, stoneindex,varyhue,varysat,varylum);
k3d/share/shaders/k3d_stones.sl:149:   /*calculate displacement if Km > .01*/
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:167:        float fade = clamp(2 * (cutoff - f) / cutoff, 0, 1);
k3d/share/shaders/k3d_stones.sl:168:        turb += fade * abs(snoise(PP * f)) / f;
k3d/share/shaders/k3d_stones.sl:175:  if (displace == 1)
k3d/share/shaders/k3d_stones.sl:183: /*compute normals and vectors for shading*/
k3d/share/shaders/k3d_stones.sl:184:  Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_stones.sl:190:Ci = surface_color * Oi * (Ka * ambient() + Kd * diffuse(Nf))+
k3d/share/shaders/k3d_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:8: *    Ka, Kd - the usual meaning
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: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:35:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_strata.sl:37:surface k3d_strata(float Ka = 0.5, Kd = 1; float txtscale = 1;
k3d/share/shaders/k3d_strata.sl:47:  PP = txtscale * transform("shader", P);
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: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:8: *   Km 	   	the amplitude of the stucco pimples
k3d/share/shaders/k3d_stucco.sl:17:displacement k3d_stucco(float Km = 0.05, power = 5, frequency = 10;)
k3d/share/shaders/k3d_stucco.sl:19:  float magnitude;
k3d/share/shaders/k3d_stucco.sl:22:  PP = transform("shader", P);
k3d/share/shaders/k3d_stucco.sl:23:  magnitude = Km * pow(noise(PP * frequency), power);
k3d/share/shaders/k3d_stucco.sl:24:  P += magnitude * normalize(N);
k3d/share/shaders/k3d_superkagee.sl:3:#define BOOL    float
k3d/share/shaders/k3d_superkagee.sl:4:#define ENUM    float
k3d/share/shaders/k3d_superkagee.sl:6:#define FILT_BOX 0
k3d/share/shaders/k3d_superkagee.sl:7:#define FILT_GAUSS 1
k3d/share/shaders/k3d_superkagee.sl:13:float do_shadow6(
k3d/share/shaders/k3d_superkagee.sl:23:    float inShadow;
k3d/share/shaders/k3d_superkagee.sl:24:#define SHADPOINT thePoint
k3d/share/shaders/k3d_superkagee.sl:25:    inShadow = shadow (theName,
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:42:            ENUM        shadowfilta = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:43:            float       shadowblura = 0,
k3d/share/shaders/k3d_superkagee.sl:44:                        shadowbiasa = 0,
k3d/share/shaders/k3d_superkagee.sl:45:                        shadowsamplesa = 16,
k3d/share/shaders/k3d_superkagee.sl:46:                        shadowdensitya = 1;
k3d/share/shaders/k3d_superkagee.sl:48:    string     shadownameb = "";
k3d/share/shaders/k3d_superkagee.sl:49:            ENUM        shadowfiltb = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:50:            float       shadowblurb = 0,
k3d/share/shaders/k3d_superkagee.sl:51:                        shadowbiasb = 0,
k3d/share/shaders/k3d_superkagee.sl:52:                        shadowsamplesb = 16,
k3d/share/shaders/k3d_superkagee.sl:53:                        shadowdensityb = 1;
k3d/share/shaders/k3d_superkagee.sl:55:    string     shadownamec = "";
k3d/share/shaders/k3d_superkagee.sl:56:            ENUM        shadowfiltc = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:57:            float       shadowblurc = 0,
k3d/share/shaders/k3d_superkagee.sl:58:                        shadowbiasc = 0,
k3d/share/shaders/k3d_superkagee.sl:59:                        shadowsamplesc = 16,
k3d/share/shaders/k3d_superkagee.sl:60:                        shadowdensityc = 1;
k3d/share/shaders/k3d_superkagee.sl:62:    string     shadownamed = "";
k3d/share/shaders/k3d_superkagee.sl:63:            ENUM        shadowfiltd = FILT_BOX;
k3d/share/shaders/k3d_superkagee.sl:64:            float       shadowblurd = 0,
k3d/share/shaders/k3d_superkagee.sl:65:                        shadowbiasd = 0,
k3d/share/shaders/k3d_superkagee.sl:66:                        shadowsamplesd = 16,
k3d/share/shaders/k3d_superkagee.sl:67:                        shadowdensityd = 1;
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:75:    if (shadownamea != "") {
k3d/share/shaders/k3d_superkagee.sl:77:        shadowed = clamp(shadowdensitya,0,1) * do_shadow6(shadownamea,P,
k3d/share/shaders/k3d_superkagee.sl:78:                    shadowfilta,shadowblura,shadowsamplesa,shadowbiasa
k3d/share/shaders/k3d_superkagee.sl:81:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:82:    }if (shadownameb != "") {
k3d/share/shaders/k3d_superkagee.sl:84:        shadowed = clamp(shadowdensityb,0,1) * do_shadow6(shadownameb,P,
k3d/share/shaders/k3d_superkagee.sl:85:                    shadowfiltb,shadowblurb,shadowsamplesb,shadowbiasb
k3d/share/shaders/k3d_superkagee.sl:88:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:89:    }if (shadownamec != "") {
k3d/share/shaders/k3d_superkagee.sl:91:        shadowed = clamp(shadowdensityc,0,1) * do_shadow6(shadownamec,P,
k3d/share/shaders/k3d_superkagee.sl:92:                    shadowfiltc,shadowblurc,shadowsamplesc,shadowbiasc
k3d/share/shaders/k3d_superkagee.sl:95:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:96:    }if (shadownamed != "") {
k3d/share/shaders/k3d_superkagee.sl:98:        shadowed = clamp(shadowdensityd,0,1) * do_shadow6(shadownamed,P,
k3d/share/shaders/k3d_superkagee.sl:99:                    shadowfiltd,shadowblurd,shadowsamplesd,shadowbiasd
k3d/share/shaders/k3d_superkagee.sl:102:        fullShad = max(fullShad,shadowed);
k3d/share/shaders/k3d_superkagee.sl:105:    Ci = Oi * mix(Cs,shadColor,fullShad);
k3d/share/shaders/k3d_superplank.sl:2: * superplank.sl -- another surface shader for wood planks.
k3d/share/shaders/k3d_superplank.sl:5: *   Makes texture of wooden planks in s-t space.  This wood looks rather
k3d/share/shaders/k3d_superplank.sl: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: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: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: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: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:28: *   ringwidth - relative width of the dark ring parts
k3d/share/shaders/k3d_superplank.sl:32: *   graindepth - depth of grain and ring grooves
k3d/share/shaders/k3d_superplank.sl:36: * Antialiasing: this shader does a pretty good job of antialiasing itself,
k3d/share/shaders/k3d_superplank.sl:37: *   even with low sampling densities.
k3d/share/shaders/k3d_superplank.sl:40: *          current contact address: gritzl@acm.org
k3d/share/shaders/k3d_superplank.sl:46:#include "k3d_noises.h"
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: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:63:			color lightwood = color(.5, .2, .067);	/* light wood color */
k3d/share/shaders/k3d_superplank.sl:67:			float plankwidth = .05;	/* Width of a plank */
k3d/share/shaders/k3d_superplank.sl:69:			float groovewidth = 0.001;	/* Width of the grooves between planks */
k3d/share/shaders/k3d_superplank.sl:70:			float groovedepth = .0004;	/* Depth of the groove */
k3d/share/shaders/k3d_superplank.sl:72:			float plankstagger = 1;	/* How much should rows be staggered */
k3d/share/shaders/k3d_superplank.sl:73:			float plankvary = 0.8;	/* Wood color variation plank-to-plank */
k3d/share/shaders/k3d_superplank.sl:74:			/* Wood appearance */
k3d/share/shaders/k3d_superplank.sl:76:			float ringwidth = 1;	/* Relative ring width */
k3d/share/shaders/k3d_superplank.sl:80:			float graindepth = 0.0001;	/* Depth of divots where grains are */
k3d/share/shaders/k3d_superplank.sl:85:  /* mapping coordinates */
k3d/share/shaders/k3d_superplank.sl:89:  float swidth, twidth, fwidth;
k3d/share/shaders/k3d_superplank.sl:93:  float whichrow, whichplank;	/* Index for each row & plank within row */
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:99:  float fade, ttt;
k3d/share/shaders/k3d_superplank.sl:100:  float ring;			/* 1 in a ring darkening, 0 where not */
k3d/share/shaders/k3d_superplank.sl:101:  float grain;			/* 1 inside a grain bit, 0 elsewhere */
k3d/share/shaders/k3d_superplank.sl:102:  /* Illumination model */
k3d/share/shaders/k3d_superplank.sl:103:  float adjustedKs;
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: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:121:   * values used throughout the shader.
k3d/share/shaders/k3d_superplank.sl:124:  /* First, determine the basic mapping */
k3d/share/shaders/k3d_superplank.sl:128:  swidth = filterwidth(ss);
k3d/share/shaders/k3d_superplank.sl:129:  twidth = filterwidth(tt);
k3d/share/shaders/k3d_superplank.sl:130:  fwidth = max(swidth, twidth);
k3d/share/shaders/k3d_superplank.sl:132:  /* How much current space corresponds to a unit of s or t?
k3d/share/shaders/k3d_superplank.sl:133:   * We will use this later to help scale the displacement, this making
k3d/share/shaders/k3d_superplank.sl:135:   * strictly tied to the scale of the object.
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: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:160:      PGWIDTH = plankwidth + groovewidth;
k3d/share/shaders/k3d_superplank.sl:166:      if(mod((whichrow / plankspertile) + whichplank, 2) >= 1)
k3d/share/shaders/k3d_superplank.sl:175:	  tmp = swidth;
k3d/share/shaders/k3d_superplank.sl:176:	  swidth = twidth;
k3d/share/shaders/k3d_superplank.sl:177:	  twidth = tmp;
k3d/share/shaders/k3d_superplank.sl:180:  /* Now whichplank is a unique integer index for each plank */
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:190:  sw = swidth / PGWIDTH;
k3d/share/shaders/k3d_superplank.sl:191:  tw = twidth / 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: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:209:  /* Compute the filter width first, so we don't bother with more if
k3d/share/shaders/k3d_superplank.sl:212:  fwidth = max(swidth * ringscale, twidth * ringscale);
k3d/share/shaders/k3d_superplank.sl:213:  fade = smoothstep(.75, 4, fwidth);
k3d/share/shaders/k3d_superplank.sl:214:  if(fade < 0.999)
k3d/share/shaders/k3d_superplank.sl:222:	0.3 + 0.7 * smoothstep(.55 - .35 * ringwidth, 0.55,
k3d/share/shaders/k3d_superplank.sl:224:      ring = (1 - fade) * ring + 0.65 * fade;
k3d/share/shaders/k3d_superplank.sl:227:      fwidth = max(swidth * grainscale, twidth * grainscale);
k3d/share/shaders/k3d_superplank.sl:228:      fade = smoothstep(.75, 4, fwidth);
k3d/share/shaders/k3d_superplank.sl:229:      if(fade < 0.999)
k3d/share/shaders/k3d_superplank.sl:235:	  grain = (1 - fade) * r2 + (0.75 * fade);
k3d/share/shaders/k3d_superplank.sl: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: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: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:269:      disp = -groovedepth * (1 - groovy);
k3d/share/shaders/k3d_superplank.sl:270:      /* Random bumps on the varnish */
k3d/share/shaders/k3d_superplank.sl:272:	disp +=
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: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:291:   * Have some subtle interaction between grain and specularity.
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: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:321:	  Pndc = transform("NDC", P);
k3d/share/shaders/k3d_superplank.sl:323:	    fresnelKr * specularcolor * texture(reflmap, xcomp(Pndc),
k3d/share/shaders/k3d_superplank.sl:324:						1 - ycomp(Pndc));
k3d/share/shaders/k3d_superpplastic.sl:1:/* paintedplastic.sl - Standard texture map surface for RenderMan Interface.
k3d/share/shaders/k3d_superpplastic.sl:4: * The RenderMan (R) Interface Procedures and RIB Protocol are:
k3d/share/shaders/k3d_superpplastic.sl: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:13: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
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:24:			  float fidelity = 1; float samples = 1;
k3d/share/shaders/k3d_superpplastic.sl:25:			  float Swidth = 1; float Twidth = 1;)
k3d/share/shaders/k3d_superpplastic.sl:41:    filter = "disk";
k3d/share/shaders/k3d_superpplastic.sl:47:      color texture(texturename, s, t, "filter", filter, "fidelity", fidelity,
k3d/share/shaders/k3d_superpplastic.sl:48:		    "samples", samples, "swidth", Swidth, "twidth", Twidth,
k3d/share/shaders/k3d_superpplastic.sl:53:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_superpplastic.sl:57:    Os * (Cs * Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_supertexmap.sl:5: *    Apply a texture map (possibly with associated alpha) 
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:11: *    Ka, Kd, Ks, roughness, specularcolor - the usual meaning.
k3d/share/shaders/k3d_supertexmap.sl:14: *                 "perspective", "cylindrical", "spherical".
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: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: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:32:#include "k3d_displace.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:39:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:46:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:53:			"shader";
k3d/share/shaders/k3d_supertexmap.sl:58:			/* displacement */
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:61:			float dispmx[16] =
k3d/share/shaders/k3d_supertexmap.sl:64:			float dispblur = 0;
k3d/share/shaders/k3d_supertexmap.sl:65:			float truedisp = 1;
k3d/share/shaders/k3d_supertexmap.sl:68:  /* Start out with the regular plastic parameters, unless overridden
k3d/share/shaders/k3d_supertexmap.sl:73:  float disp = 0;
k3d/share/shaders/k3d_supertexmap.sl:93:  /* displacement mapping */
k3d/share/shaders/k3d_supertexmap.sl:94:  if(dispmapname != "")
k3d/share/shaders/k3d_supertexmap.sl:96:      disp =
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:102:  /* Illumination model - just use plastic */
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: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: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:30:surface k3d_supertoon(float Kd = 1,

k3d/share/shaders/k3d_supertoon.sl:33:                        delta = 0.015,   /* antialiasing level */

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

k3d/share/shaders/k3d_supertoon.sl:46:      especular = splitColor(especular, delta * 3, lim3, lim4, lim4);

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

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

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

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

k3d/share/shaders/k3d_terran.sl: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:7:#ifdef BMRT
k3d/share/shaders/k3d_terran.sl:8:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terran.sl:11:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terran.sl:12:#endif
k3d/share/shaders/k3d_terran.sl:14:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terran.sl:15:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terran.sl:16:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terran.sl:17:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terran.sl:20:surface k3d_terran(float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_terran.sl:23:		   float multifractal = 0; float dist_scale = .2;
k3d/share/shaders/k3d_terran.sl:30:		   float ice_caps = 0.9; float depth_scale = 1;
k3d/share/shaders/k3d_terran.sl:31:		   float depth_max = .5; float mottle_limit = 0.75;
k3d/share/shaders/k3d_terran.sl:32:		   float mottle_scale = 20; float mottle_dim = .25;
k3d/share/shaders/k3d_terran.sl:37:  float chaos, latitude, purt;
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: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:54:    {				/* use a "standard" 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:77:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terran.sl:85:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terran.sl:87:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran.sl:96:   * Step 2: Assign a climite type, roughly by latitude.
k3d/share/shaders/k3d_terran.sl:100:  latitude = abs(ycomp(PtN));
k3d/share/shaders/k3d_terran.sl:105:  latitude += chaos * (nonlinear * (1 - latitude) + purt_scale);
k3d/share/shaders/k3d_terran.sl:107:    latitude = lat_scale * pow(latitude, map_exp);
k3d/share/shaders/k3d_terran.sl:109:    latitude *= lat_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:120:      Ct = spline (latitude,
k3d/share/shaders/k3d_terran.sl:135:	spline(latitude, color(.5, .39, .2), color(.5, .39, .2),
k3d/share/shaders/k3d_terran.sl:142:      if(latitude < mottle_limit)
k3d/share/shaders/k3d_terran.sl:151:	      o *= mottle_dim;
k3d/share/shaders/k3d_terran.sl:160:      if(ice_caps > 0 && latitude > ice_caps)
k3d/share/shaders/k3d_terran.sl:164:	  /* Adjust color of water to darken deeper seas */
k3d/share/shaders/k3d_terran.sl:166:	  chaos *= depth_scale;
k3d/share/shaders/k3d_terran.sl:167:	  chaos = max(chaos, -depth_max);
k3d/share/shaders/k3d_terran.sl:172:  /* Shade using matte model */
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:2:  -- tal@SpamSucks_cs.caltech.edu */
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:16: *   in the middle of the ocean.
k3d/share/shaders/k3d_terran2.sl:20: *    Ka, Kd - the usual meaning
k3d/share/shaders/k3d_terran2.sl:25: *    dist_scale - scaling for multifractal distortion
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: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:57: *    May 28 1995 Didn't want polar caps so removed white from color spline --
k3d/share/shaders/k3d_terran2.sl:58: *       tal@SpamSucks_cs.caltech.edu
k3d/share/shaders/k3d_terran2.sl:63:#ifdef BMRT
k3d/share/shaders/k3d_terran2.sl:64:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terran2.sl:67:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terran2.sl:68:#endif
k3d/share/shaders/k3d_terran2.sl:70:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terran2.sl:71:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terran2.sl:72:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terran2.sl:73:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terran2.sl:77:k3d_terran2 (float Ka = .5, Kd = .7;
k3d/share/shaders/k3d_terran2.sl:82:	  float dist_scale = .2;
k3d/share/shaders/k3d_terran2.sl:91:	  float depth_scale = 1;
k3d/share/shaders/k3d_terran2.sl:92:	  float depth_max = .5;
k3d/share/shaders/k3d_terran2.sl:95:	  float mottle_dim = .25;
k3d/share/shaders/k3d_terran2.sl:100:  float chaos, latitude, purt;
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: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: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:133:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terran2.sl:141:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terran2.sl:143:  /* set bump for land masses (i.e., areas above "sea level") */
k3d/share/shaders/k3d_terran2.sl:151:   * Step 2: Assign a climite type, roughly by latitude.
k3d/share/shaders/k3d_terran2.sl:155:  latitude = abs (zcomp (PtN));
k3d/share/shaders/k3d_terran2.sl:160:  latitude += chaos*(nonlinear*(1-latitude) + purt_scale);
k3d/share/shaders/k3d_terran2.sl:162:       latitude = lat_scale * pow(latitude,map_exp);
k3d/share/shaders/k3d_terran2.sl:163:  else latitude *= lat_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:173:      Ct = spline (latitude,
k3d/share/shaders/k3d_terran2.sl:187:      Ct = spline (latitude,
k3d/share/shaders/k3d_terran2.sl:202:     if (latitude < mottle_limit) {
k3d/share/shaders/k3d_terran2.sl:208:	     o *= mottle_dim;
k3d/share/shaders/k3d_terran2.sl:216:      if (ice_caps > 0  &&  latitude > ice_caps)
k3d/share/shaders/k3d_terran2.sl:219:	  /* Adjust color of water to darken deeper seas */
k3d/share/shaders/k3d_terran2.sl:221:	  chaos *= depth_scale;
k3d/share/shaders/k3d_terran2.sl:222:	  chaos = max (chaos, -depth_max);
k3d/share/shaders/k3d_terran2.sl:227:  /* Shade using matte model */
k3d/share/shaders/k3d_terran2.sl:229:  Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(faceforward(normalize(N),I)));
k3d/share/shaders/k3d_terranbump.sl:3:#ifdef BMRT
k3d/share/shaders/k3d_terranbump.sl:4:#define snoise(x) (2*(noise(x)-0.5))
k3d/share/shaders/k3d_terranbump.sl:7:#define snoise(x) (2.5*(noise(x)-0.5))
k3d/share/shaders/k3d_terranbump.sl:8:#endif
k3d/share/shaders/k3d_terranbump.sl:10:#define DNoise(x) ((2*(point noise(x))) - point(1,1,1))
k3d/share/shaders/k3d_terranbump.sl:11:#define VLNoise(Pt,scale) (snoise(DNoise(Pt)+(scale*Pt)))
k3d/share/shaders/k3d_terranbump.sl:12:#define N_OFFSET 0.7
k3d/share/shaders/k3d_terranbump.sl:13:#define VERY_SMALL 0.0001
k3d/share/shaders/k3d_terranbump.sl:17:displacement k3d_terranbump(float spectral_exp = 0.5;
k3d/share/shaders/k3d_terranbump.sl:20:			    float dist_scale = .2; float offset = 0;
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:32:    {				/* use a "standard" 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:55:	  /* get subsequent values, weighted by previous value */
k3d/share/shaders/k3d_terranbump.sl:63:  /* get the "height" of the bump, displacing by offset */
k3d/share/shaders/k3d_terranbump.sl:66:  /* set bump for land masses (i.e., areas above "sea level") */
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:5:#include "k3d_displace.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:8:#include "k3d_locillum.h"
k3d/share/shaders/k3d_texblender.sl:9:#include "k3d_noises.h"
k3d/share/shaders/k3d_texblender.sl:12:                       float Ka, Kd, Ks, roughness,selft,Kr,Krfr;)
k3d/share/shaders/k3d_texblender.sl:15:    return (basecolor * ( Ka*ambient() + Kd*diffuse(Nf)+selft*selftcolor ) )
k3d/share/shaders/k3d_texblender.sl:29:            C = Environment (envname, envspace, envrad, P, R, blur, alpha);
k3d/share/shaders/k3d_texblender.sl:33:#if (defined(BMRT) || defined(RAYSERVER_H))
k3d/share/shaders/k3d_texblender.sl:36:#endif
k3d/share/shaders/k3d_texblender.sl:41:float myrand(point p;)
k3d/share/shaders/k3d_texblender.sl:50:	n=round(n);
k3d/share/shaders/k3d_texblender.sl:52:	hx=mod(x,1000000)/1000;
k3d/share/shaders/k3d_texblender.sl:53:	x=mod(x+hx+x*100,1000);
k3d/share/shaders/k3d_texblender.sl:57:float tex_clouds(point P;float depth)
k3d/share/shaders/k3d_texblender.sl:63:	for(i=0;i<depth;i=i+1)
k3d/share/shaders/k3d_texblender.sl:73:float tex_wood(point PP; float ringscale)
k3d/share/shaders/k3d_texblender.sl:99:	if (mapname=="clouds")
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:103:	else if (mapname=="wood")
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: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: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:132:k3d_texblender (float Ka = 1, Kd = .5, Ks = .2, roughness = .3, Kr=0,selft=0;
k3d/share/shaders/k3d_texblender.sl:151:		string Gmode[5]={"m","m","m","m","m"};
k3d/share/shaders/k3d_texblender.sl:158:    float disp = 0,i,Alpha=1;
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: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:175:		if((Alpha*sKmap[i])!=0) ks=BlendFloat(mode,Alpha*sKmap[i],MF,ks);
k3d/share/shaders/k3d_texblender.sl:176:		if((Alpha*mKmap[i])!=0) kr=BlendFloat(mode,Alpha*mKmap[i],MF,kr);
k3d/share/shaders/k3d_texblender.sl:177:		if((Alpha*rKmap[i])!=0) roughness=BlendFloat(mode,Alpha*rKmap[i],
k3d/share/shaders/k3d_texblender.sl:179:		if(aKmap[i]!=0) Alpha=BlendFloat("f",aKmap[i],MF,1);
k3d/share/shaders/k3d_texblender.sl:180:		if((Alpha*iKmap[i])!=0) selft=BlendFloat(mode,Alpha*iKmap[i],MF,selft);
k3d/share/shaders/k3d_texblender.sl:181:		if((Alpha*bKmap[i])!=0) disp=BlendFloat(mode,Alpha*bKmap[i],MF,disp);
k3d/share/shaders/k3d_texblender.sl:183:	if(disp!=0)
k3d/share/shaders/k3d_texblender.sl: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:194:	float olds=raysamples;
k3d/share/shaders/k3d_texblender.sl:205:		else raysamples=olds;
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:8:displacement 
k3d/share/shaders/k3d_threads.sl:9:k3d_threads ( 
k3d/share/shaders/k3d_threads.sl:14:		dampzone	=  .05 )
k3d/share/shaders/k3d_threads.sl:16:	float magnitude;
k3d/share/shaders/k3d_threads.sl:18:	/* Calculate the undamped displacement */
k3d/share/shaders/k3d_threads.sl:19:	magnitude = (sin( PI*2*(t*frequency + s + phase))+offset) * Km;
k3d/share/shaders/k3d_threads.sl:21:	/* Damp the displacement to 0 at each end */
k3d/share/shaders/k3d_threads.sl:22:	if( t > (1-dampzone)) 
k3d/share/shaders/k3d_threads.sl:23:		magnitude *= (1.0-t) / dampzone;
k3d/share/shaders/k3d_threads.sl:24:	else if( t < dampzone )
k3d/share/shaders/k3d_threads.sl:25:		magnitude *= t / dampzone;
k3d/share/shaders/k3d_threads.sl:27:	/* Do the displacement */
k3d/share/shaders/k3d_threads.sl:28:	P += normalize(N) * magnitude;
k3d/share/shaders/k3d_tooledsteel.sl:1:/*  tooledsteel.sl written 9/99 by Ivan DeWolf
k3d/share/shaders/k3d_tooledsteel.sl:3: *  feel free to copy, distribute, hack and/or abuse this code 
k3d/share/shaders/k3d_tooledsteel.sl: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:12: *  thanks to Jos Stam whose animated cube motivated this thing.
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:20: *  Kd			- coefficient of diffuse
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:39:  extern vector dPdu;
k3d/share/shaders/k3d_tooledsteel.sl:40:  extern vector dPdv;
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:66:  /*what is the shortest distance to a noised cell center?*/
k3d/share/shaders/k3d_tooledsteel.sl:74:	dist = distance(Po,nzcell);
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:77:	  valu = distance(Pou,nzcell);
k3d/share/shaders/k3d_tooledsteel.sl:78:	  valv = distance(Pov,nzcell);
k3d/share/shaders/k3d_tooledsteel.sl:84:  out  = normalize((udir*chu)+(vdir*chv));
k3d/share/shaders/k3d_tooledsteel.sl:89:anisospecular (vector VA; float specspread; float specwidth)
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: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:122:k3d_tooledsteel(
k3d/share/shaders/k3d_tooledsteel.sl:126:		Kd		= .01,
k3d/share/shaders/k3d_tooledsteel.sl:129:		specwidth	= .5,
k3d/share/shaders/k3d_tooledsteel.sl:130:		specspread 	= .5,
k3d/share/shaders/k3d_tooledsteel.sl:131:		mapspread 	= .2,
k3d/share/shaders/k3d_tooledsteel.sl:144:	float Jspread = PI*(1/numsamples)*mapspread;
k3d/share/shaders/k3d_tooledsteel.sl:149:	Nf = faceforward(normalize(N), -I);
k3d/share/shaders/k3d_tooledsteel.sl:154:	      jitter = (random()-.5)*Jspread;
k3d/share/shaders/k3d_tooledsteel.sl:155:	      angle = PI*((i/numsamples)-.5)*mapspread;
k3d/share/shaders/k3d_tooledsteel.sl:158:	      D = vtransform("world", D);
k3d/share/shaders/k3d_tooledsteel.sl:165:	Ci = Oi * (Cs * (Ka * ambient() + Kd * diffuse(-Nf)) + 
k3d/share/shaders/k3d_tooledsteel.sl:166:	specularcolor * Ks * anisospecular(VA, specspread*2, specwidth*.1)) +
k3d/share/shaders/k3d_toonmap.sl:3:surface k3d_toonmap (
k3d/share/shaders/k3d_toonmap.sl:6:float Kd=0.336; 
k3d/share/shaders/k3d_toonmap.sl:12:float swidth4=1; 
k3d/share/shaders/k3d_toonmap.sl:13:float twidth4=1; 
k3d/share/shaders/k3d_toonmap.sl:20:float swidth3=1; 
k3d/share/shaders/k3d_toonmap.sl:21:float twidth3=1; 
k3d/share/shaders/k3d_toonmap.sl:33:float swidth2=1; 
k3d/share/shaders/k3d_toonmap.sl:34:float twidth2=1; 
k3d/share/shaders/k3d_toonmap.sl:39:/** Surface main-code start **/
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: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: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:104:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_toonmap.sl:105:#define union(a,b) ((a) + (b) - (a) * (b))
k3d/share/shaders/k3d_toonmap.sl:121:float diff, spec;
k3d/share/shaders/k3d_toonmap.sl:128:Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_toonmap.sl:131:/* background layer (layer 0) */
k3d/share/shaders/k3d_toonmap.sl:138:diff = 0;
k3d/share/shaders/k3d_toonmap.sl:140:diff += normalize(L).Nf; 
k3d/share/shaders/k3d_toonmap.sl:143:diff = smoothstep(paint_trans - paint_fuzz/2, paint_trans + paint_fuzz/2, diff);
k3d/share/shaders/k3d_toonmap.sl:145:/* specular -- transition also antialiased */ 
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:152:toon_color = blend(toon_color, layer_color, layer_opac);
k3d/share/shaders/k3d_toonmap.sl:167:toon_color = blend(toon_color, layer_color, layer_opac);
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: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: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:26:* Shader birthdate: 31-08-2000
k3d/share/shaders/k3d_translucency.sl:31:#define SQR(A) ((A)*(A))
k3d/share/shaders/k3d_translucency.sl:33:surface k3d_translucency(float Ka = 1;
k3d/share/shaders/k3d_translucency.sl:34:			float Kd = 1;
k3d/share/shaders/k3d_translucency.sl:71:	normal Nf = faceforward(normalize(N),I);
k3d/share/shaders/k3d_translucency.sl:74:	/*Color texturing of different side*/
k3d/share/shaders/k3d_translucency.sl:94:	/*Translucency texturing of different side*/
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:5: *   Based on Ronen Barzel's paper "Lighting Controls for Computer
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: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: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: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:42: *       is actually given by:   I = (falloffdist / distance) ^ falloff
k3d/share/shaders/k3d_uberlight.sl:43: *   maxintensity - to prevent the light from becoming unboundedly
k3d/share/shaders/k3d_uberlight.sl:44: *       large when the distance < falloffdist, the intensity is
k3d/share/shaders/k3d_uberlight.sl:45: *       smoothly clamped to this maximum value.
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:52: * is actually described by a superellipse with the following
k3d/share/shaders/k3d_uberlight.sl:54: *   shearx, sheary - define the amount of shear applied to the light
k3d/share/shaders/k3d_uberlight.sl:55: *       cone direction.  Default is 0, meaning that the center of the
k3d/share/shaders/k3d_uberlight.sl:56: *       light cone is aligned with the z-axis in local light space.
k3d/share/shaders/k3d_uberlight.sl:57: *   width, height - define the dimensions of the "barn door" opening.
k3d/share/shaders/k3d_uberlight.sl:58: *       They are the cross-sectional dimensions at a distance of 1
k3d/share/shaders/k3d_uberlight.sl:59: *       from the light.  In other words, width==height==1 indicates a
k3d/share/shaders/k3d_uberlight.sl:60: *       90 degree cone angle for the light.
k3d/share/shaders/k3d_uberlight.sl:61: *   wedge, hedge - the amount of width and height edge fuzz,
k3d/share/shaders/k3d_uberlight.sl: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:67: *       perfect ellipse.  In-between values control the roundness of
k3d/share/shaders/k3d_uberlight.sl:69: *   beamdistribution - controls intensity falloff due to angle.
k3d/share/shaders/k3d_uberlight.sl:70: *       A value of 0 (the default) means no angle falloff.  A value
k3d/share/shaders/k3d_uberlight.sl:71: *       of 1 is roughly physically correct for a spotlight and 
k3d/share/shaders/k3d_uberlight.sl:72: *       corresponds to a cosine falloff.  For a BMRT area light, the
k3d/share/shaders/k3d_uberlight.sl: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: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:87: * Projected noise on the light:
k3d/share/shaders/k3d_uberlight.sl:88: *   noiseamp - amplitude of the noise.  A value of 0 (the default) 
k3d/share/shaders/k3d_uberlight.sl:90: *       of the projected noise.
k3d/share/shaders/k3d_uberlight.sl:92: *   noiseoffset - spatial offset of the noise.  This can be animated,
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:101: *   shadowmap - the name of the texture containing the shadow map.  If
k3d/share/shaders/k3d_uberlight.sl:102: *       this value is "" (the default), no shadow map will be used.
k3d/share/shaders/k3d_uberlight.sl:103: *   shadowblur - how soft to make the shadow edge, expressed as a
k3d/share/shaders/k3d_uberlight.sl:104: *       percentage of the width of the entire shadow map.
k3d/share/shaders/k3d_uberlight.sl:105: *   shadowbias - the amount of shadow bias to add to the lookup.
k3d/share/shaders/k3d_uberlight.sl:106: *   shadownsamps - the number of samples to use.
k3d/share/shaders/k3d_uberlight.sl:108: * Ray-traced shadows.  These options work only for BMRT:
k3d/share/shaders/k3d_uberlight.sl:109: *   raytraceshadow - if nonzero, cast rays to see if we are in shadow.
k3d/share/shaders/k3d_uberlight.sl:110: *       The default is zero, i.e., not to try raytracing.
k3d/share/shaders/k3d_uberlight.sl:111: *   nshadowrays - The number of rays to trace to determine shadowing.
k3d/share/shaders/k3d_uberlight.sl:112: *   shadowcheat - add this offset to the light source position.  This
k3d/share/shaders/k3d_uberlight.sl:113: *       allows you to cause the shadows to emanate as if the light
k3d/share/shaders/k3d_uberlight.sl:115: *       illuminated or the appearance of highlights, etc.
k3d/share/shaders/k3d_uberlight.sl:117: * "Fake" shadows from a blocker object.  A blocker is a superellipse
k3d/share/shaders/k3d_uberlight.sl: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: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: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:146: *       diffusely, without highlights.
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:154: *       NOTE: This depends on the surface shader looking for, and
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:160: *       to do this.
k3d/share/shaders/k3d_uberlight.sl:161: *   __nondiffuse - the analog to nonspecular; if this flag is set to
k3d/share/shaders/k3d_uberlight.sl:163: *       diffuse light.  This is useful for making a light that only
k3d/share/shaders/k3d_uberlight.sl:166: *       respect to the surface shader, as described above for
k3d/share/shaders/k3d_uberlight.sl:168: *   __foglight - the "noisysmoke" shader distributed with BMRT will add
k3d/share/shaders/k3d_uberlight.sl:170: *       parameter set to 1 (the default).  In other words, if you use
k3d/share/shaders/k3d_uberlight.sl:173: *       Note that the noisysmoke shader is distributed with BMRT but
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: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:209:/* Comment out the following line if you do *not* wish to use BMRT and
k3d/share/shaders/k3d_uberlight.sl:212://#include "k3d_rayserver.h"
k3d/share/shaders/k3d_uberlight.sl:220: *        a,b and A,B for the inner and outer ellipses, respectively)
k3d/share/shaders/k3d_uberlight.sl:222: *   - 0 if Q was inside the inner ellipse
k3d/share/shaders/k3d_uberlight.sl:223: *   - 1 if Q was outside the outer ellipse
k3d/share/shaders/k3d_uberlight.sl:229:		       float roundness;	/* Same roundness for both ellipses */
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:241:      else if(roundness > 0.9999)
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:270: *   - the point being shaded, in the local light space
k3d/share/shaders/k3d_uberlight.sl:271: *   - all information about the light shaping, including z smooth depth
k3d/share/shaders/k3d_uberlight.sl:272: *     clipping, superellipse x-y shaping, and distance falloff.
k3d/share/shaders/k3d_uberlight.sl:274: *   - attenuation factor based on the falloff and shaping
k3d/share/shaders/k3d_uberlight.sl:277:		       string lighttype;	/* what kind of light */
k3d/share/shaders/k3d_uberlight.sl:280:		       float nearedge, faredge;
k3d/share/shaders/k3d_uberlight.sl:281:		       float falloff, falloffdist;	/* distance falloff */
k3d/share/shaders/k3d_uberlight.sl:283:		       float shearx, sheary;	/* shear the direction */
k3d/share/shaders/k3d_uberlight.sl:284:		       float width, height;	/* xy superellipse */
k3d/share/shaders/k3d_uberlight.sl:285:		       float hedge, wedge, roundness;
k3d/share/shaders/k3d_uberlight.sl:286:		       float beamdistribution;	/* angle falloff */
k3d/share/shaders/k3d_uberlight.sl:289:  /* Examine the z depth of PL to apply the (possibly smooth) cuton and
k3d/share/shaders/k3d_uberlight.sl: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:310:      if(PLlen > falloffdist)
k3d/share/shaders/k3d_uberlight.sl:312:	  atten *= pow(falloffdist / PLlen, falloff);
k3d/share/shaders/k3d_uberlight.sl:318:	  atten *= (maxintensity * exp(s * pow(PLlen / falloffdist, beta)));
k3d/share/shaders/k3d_uberlight.sl:323:  if(lighttype != "omni" && beamdistribution > 0)
k3d/share/shaders/k3d_uberlight.sl: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:329:			     height, width + wedge, height + hedge,
k3d/share/shaders/k3d_uberlight.sl:330:			     roundness);
k3d/share/shaders/k3d_uberlight.sl:338:/* Evaluate the occlusion between two points, P1 and P2, due to a fake
k3d/share/shaders/k3d_uberlight.sl:339: * blocker.  Return 0 if the light is totally blocked, 1 if it totally
k3d/share/shaders/k3d_uberlight.sl: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:349:  float unoccluded = 1;
k3d/share/shaders/k3d_uberlight.sl:350:  /* Get the surface and light positions in blocker coords */
k3d/share/shaders/k3d_uberlight.sl:351:  point Pb1 = transform(blockercoords, P1);
k3d/share/shaders/k3d_uberlight.sl:352:  point Pb2 = transform(blockercoords, P2);
k3d/share/shaders/k3d_uberlight.sl:353:  /* Blocker works only if it's straddled by ray endpoints. */
k3d/share/shaders/k3d_uberlight.sl:358:      unoccluded *=
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:373:		     /* Z shaping and distance falloff */
k3d/share/shaders/k3d_uberlight.sl:374:		     float cuton = 0.01, cutoff = 1.0e6, nearedge =
k3d/share/shaders/k3d_uberlight.sl:375:		     0, faredge = 0;
k3d/share/shaders/k3d_uberlight.sl:376:		     float falloff = 0, falloffdist = 1, maxintensity = 1;
k3d/share/shaders/k3d_uberlight.sl:378:		     /* xy shaping of the cross-section and angle falloff */
k3d/share/shaders/k3d_uberlight.sl:380:		     float width = 1, height = 1, wedge = .1, hedge = .1;
k3d/share/shaders/k3d_uberlight.sl:381:		     float roundness = 1;
k3d/share/shaders/k3d_uberlight.sl:382:		     float beamdistribution = 0;
k3d/share/shaders/k3d_uberlight.sl: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:388:		     /* Shadow mapped shadows */
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:404:		     output float __nondiffuse = 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:416:#ifdef BMRT
k3d/share/shaders/k3d_uberlight.sl:417:  /* If it's an area light, we want the point and normal of the light
k3d/share/shaders/k3d_uberlight.sl:419:   * origin and z-axis of shader space.
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:427:#endif
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:440:    {				/* Omnidirectional light */
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: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:464:    if(slidename != "")
k3d/share/shaders/k3d_uberlight.sl:466:	point Pslide = PL / point(width + wedge, height + hedge, 1);
k3d/share/shaders/k3d_uberlight.sl:467:	float zslide = zcomp(Pslide);
k3d/share/shaders/k3d_uberlight.sl:468:	float xslide = 0.5 + 0.5 * xcomp(Pslide) / zslide;
k3d/share/shaders/k3d_uberlight.sl:469:	float yslide = 0.5 - 0.5 * ycomp(Pslide) / zslide;
k3d/share/shaders/k3d_uberlight.sl:470:	lcol *= color texture(slidename, xslide, yslide);
k3d/share/shaders/k3d_uberlight.sl:485:	/* Apply shadow mapped shadows */
k3d/share/shaders/k3d_uberlight.sl:486:	float unoccluded = 1;
k3d/share/shaders/k3d_uberlight.sl:487:	if(shadowmap != "")
k3d/share/shaders/k3d_uberlight.sl:488:	  unoccluded *=
k3d/share/shaders/k3d_uberlight.sl:489:	    1 - shadow(shadowmap, Ps, "blur", shadowblur, "samples",
k3d/share/shaders/k3d_uberlight.sl:490:		       shadownsamps, "bias", shadowbias);
k3d/share/shaders/k3d_uberlight.sl:491:	point shadoworigin;
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:496:#if (defined(BMRT) || defined(RAYSERVER_H))
k3d/share/shaders/k3d_uberlight.sl:497:	/* If we can, apply ray cast shadows.  Force a ray trace if
k3d/share/shaders/k3d_uberlight.sl: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: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:507:	    unoccluded *= (comp(vis, 0) + comp(vis, 1) + comp(vis, 2)) / 3;
k3d/share/shaders/k3d_uberlight.sl:509:#endif
k3d/share/shaders/k3d_uberlight.sl:510:	/* Apply blocker fake shadows */
k3d/share/shaders/k3d_uberlight.sl:511:	if(blockercoords != "")
k3d/share/shaders/k3d_uberlight.sl:513:	    unoccluded *=
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_urbermap.sl:3:surface k3d_urbermap (
k3d/share/shaders/k3d_urbermap.sl:18:string abRoughnessMap="I:/ArtWorks/Textures/Native_1.2.shadow.tif"; 
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:38:/** Surface main-code start **/
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:54:"swidth", abColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:55:"twidth", abColorMapBlur );
k3d/share/shaders/k3d_urbermap.sl:59:"swidth", abColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:60:"twidth", abColorMapBlur );
k3d/share/shaders/k3d_urbermap.sl:78:diff = abDiffuse * float texture(abDiffuseMap, ss, tt,
k3d/share/shaders/k3d_urbermap.sl:79:"swidth", abDiffuseMapBlur,
k3d/share/shaders/k3d_urbermap.sl:80:"twidth", abDiffuseMapBlur );
k3d/share/shaders/k3d_urbermap.sl:84:diff = abDiffuse;
k3d/share/shaders/k3d_urbermap.sl:91:"swidth", abSpecularMapBlur,
k3d/share/shaders/k3d_urbermap.sl:92:"twidth", abSpecularMapBlur );
k3d/share/shaders/k3d_urbermap.sl:103:"swidth", abSpecularColorMapBlur,
k3d/share/shaders/k3d_urbermap.sl:104:"twidth", abSpecularColorMapBlur );
k3d/share/shaders/k3d_urbermap.sl:115:"swidth", abRoughnessMapBlur,
k3d/share/shaders/k3d_urbermap.sl:116:"twidth", abRoughnessMapBlur );
k3d/share/shaders/k3d_urbermap.sl:129:"swidth", abTransparencyMapBlur,
k3d/share/shaders/k3d_urbermap.sl:130:"twidth", abTransparencyMapBlur );
k3d/share/shaders/k3d_urbermap.sl:135:"swidth", abTransparencyMapBlur,
k3d/share/shaders/k3d_urbermap.sl:136:"twidth", abTransparencyMapBlur ));
k3d/share/shaders/k3d_urbermap.sl:141:if(abIncandescenseMap != "")
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:149:Cincand = abIncandescence;
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: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:186:D = vtransform("worldspace", 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: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:10: *   Ka, Kd, Ks, roughness, specularcolor - same as plastic
k3d/share/shaders/k3d_veinedmarble.sl:12: *   veinlevels - how many "levels" of vein tendrills it has
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:27:#include "k3d_noises.h"
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:33:			 float Kd = .8;
k3d/share/shaders/k3d_veinedmarble.sl:50:  point PP = transform("shader", P);
k3d/share/shaders/k3d_veinedmarble.sl:51:  float dPP = filterwidthp(PP);
k3d/share/shaders/k3d_veinedmarble.sl:53:  PP += 0.5 * vfBm(PP, dPP, 6, 2, 0.5);
k3d/share/shaders/k3d_veinedmarble.sl:61:      turb = abs(filteredsnoise(PP * freq, dPP * freq));
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:1:/* Renamed to SHW_velvet.sl -- tal@SpamSucks_cs.caltech.edu */
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: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: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:29: *			defined SQR()
k3d/share/shaders/k3d_velvet.sl:31: * prev modified  28 January 1997 S. H. Westin
k3d/share/shaders/k3d_velvet.sl:34:#define SQR(A) ((A)*(A))
k3d/share/shaders/k3d_velvet.sl:37:k3d_velvet (float Ka = 0.05,
k3d/share/shaders/k3d_velvet.sl:38:              Kd = 0.1,
k3d/share/shaders/k3d_velvet.sl:41:	    edginess = 10;
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: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:53:  Nf = faceforward (normalize(N), I);
k3d/share/shaders/k3d_velvet.sl:66:    shiny += pow ( sine, edginess ) * Ln.Nf * Cl * sheen;
k3d/share/shaders/k3d_velvet.sl:70:  /* Add in diffuse color */
k3d/share/shaders/k3d_velvet.sl:71:  Ci = Os * (Ka*ambient() + Kd*diffuse(Nf)) * Cs + shiny;
k3d/share/shaders/k3d_venus.sl:2: * venus.sl - surface for a very cloudy planet like Venus.
k3d/share/shaders/k3d_venus.sl: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:10: *   simulated to give the twisting of clouds that is typically seen
k3d/share/shaders/k3d_venus.sl:15: *    Ka, Kd - the usual meaning
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: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:46:#define TWOPI (2*PI)
k3d/share/shaders/k3d_venus.sl:49:/* Use signed noise on [-1,1] */
k3d/share/shaders/k3d_venus.sl:50:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_venus.sl:54:surface k3d_venus(float Ka = 1, Kd = 1;
k3d/share/shaders/k3d_venus.sl: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:62:  float rsq;			/* Used in calculation of twist */
k3d/share/shaders/k3d_venus.sl:64:  float sine, cosine;		/* sin and cos of angle */
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: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:12: *   simulated to give the twisting of clouds that is typically seen
k3d/share/shaders/k3d_venus2.sl:17: *    Ka, Kd - the usual meaning
k3d/share/shaders/k3d_venus2.sl:18: *    offset, scale - control the linear scaling of the cloud value.
k3d/share/shaders/k3d_venus2.sl:19: *    twist - controls the twisting of the clouds due to Coriolis forces.
k3d/share/shaders/k3d_venus2.sl:20: *    omega - controls the fractal characteristics of the clouds
k3d/share/shaders/k3d_venus2.sl:21: *    octaves - the number of octaves of noise to sum for the clouds.
k3d/share/shaders/k3d_venus2.sl:22: *    radius - radius of planet
k3d/share/shaders/k3d_venus2.sl:26: *    Conversion to Shading Language and minor modifications by Larry Gritz.
k3d/share/shaders/k3d_venus2.sl: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:44:#define TWOPI (2*PI)
k3d/share/shaders/k3d_venus2.sl:47:/* Use signed noise on [-1,1] */
k3d/share/shaders/k3d_venus2.sl:48:#define snoise(x) ((2*noise(x))-1)
k3d/share/shaders/k3d_venus2.sl:53:k3d_venus2 (float Ka = 1, Kd = 1;
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:64:  float rsq;                /* Used in calculation of twist */
k3d/share/shaders/k3d_venus2.sl:66:  float sine, cosine;       /* sin and cos of angle */
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: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: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:5:   StepSize            - distance between sample points.
k3d/share/shaders/k3d_volcube.sl:8:   Epsilon             - offset for calculating gradient normal. 
k3d/share/shaders/k3d_volcube.sl:10:   Do_Shading          - if 1, shading will be calculated.
k3d/share/shaders/k3d_volcube.sl:11:   SurfNormalDepth     - the mixing depth from surface
k3d/share/shaders/k3d_volcube.sl:13:   Additive            - if 1 add samples, if 0 over samples . 
k3d/share/shaders/k3d_volcube.sl:14:   ShowActiveVol       - if 1 show the active volume instead of density.
k3d/share/shaders/k3d_volcube.sl:15:   RunShadowPass       - set to 1 if running a shadow pass.
k3d/share/shaders/k3d_volcube.sl:29:	      float idx;
k3d/share/shaders/k3d_volcube.sl:35:    vector Rd,Ro;
k3d/share/shaders/k3d_volcube.sl:45:    Rd = vtransform(refractSpace,IN);
k3d/share/shaders/k3d_volcube.sl:51:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:54:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:59:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:62:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:67:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:70:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:75:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:78:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:83:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:86:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:91:    T = -(Pn . Ro + D) / (Pn . Rd);
k3d/share/shaders/k3d_volcube.sl:94:	Ri = Ro + T*Rd;
k3d/share/shaders/k3d_volcube.sl:112:/* density function will return the final volume density */
k3d/share/shaders/k3d_volcube.sl:114:get_density(point Pos; float vol_mult, vol_offset;)
k3d/share/shaders/k3d_volcube.sl:116:    float dens = 0;
k3d/share/shaders/k3d_volcube.sl:121:    dens = pow(1-abs(noise(Pos*7)*2-1),3);
k3d/share/shaders/k3d_volcube.sl:122:    dens += pow(1-abs(noise((Pos+24.72)*7)*2-1),3);
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:133:				    zcomp(Pos)),vol_mult,vol_offset) - dens,
k3d/share/shaders/k3d_volcube.sl:134:		 get_density(point (xcomp(Pos),
k3d/share/shaders/k3d_volcube.sl:135:				    ycomp(Pos) - epsilon, zcomp(Pos)),vol_mult,vol_offset) - dens,
k3d/share/shaders/k3d_volcube.sl:136:		 get_density(point (xcomp(Pos),
k3d/share/shaders/k3d_volcube.sl:137:				    ycomp(Pos), zcomp(Pos) - epsilon),vol_mult,vol_offset) - dens);
k3d/share/shaders/k3d_volcube.sl:138:    Nd = ntransform("object","current",Nd);
k3d/share/shaders/k3d_volcube.sl:139:    return Nd;
k3d/share/shaders/k3d_volcube.sl:146:/* shading function returns diffuse ans specular */
k3d/share/shaders/k3d_volcube.sl:147:void get_shading (point Pos;
k3d/share/shaders/k3d_volcube.sl:151:		  output color diff;
k3d/share/shaders/k3d_volcube.sl:156:    diff = 0;
k3d/share/shaders/k3d_volcube.sl:158:    illuminance (Pos, Nf, radians(90)){
k3d/share/shaders/k3d_volcube.sl:159:	diff += Cl * max(0,normalize(L).Nf);
k3d/share/shaders/k3d_volcube.sl:160:	spec += Cl * specularbrdf(L, Nf, V, Roughness);
k3d/share/shaders/k3d_volcube.sl:185:/* main ray marching shader  */
k3d/share/shaders/k3d_volcube.sl:187:k3d_volcube(float  StepSize       = 1;
k3d/share/shaders/k3d_volcube.sl:193:	     float  Do_Shading     = 1;
k3d/share/shaders/k3d_volcube.sl:195:	     float  Additive       = 1;
k3d/share/shaders/k3d_volcube.sl:197:	     float  RunShadowPass  = 0;
k3d/share/shaders/k3d_volcube.sl:205:    color  diff	= 1;
k3d/share/shaders/k3d_volcube.sl:212:    float  density_sum  = 0;
k3d/share/shaders/k3d_volcube.sl:214:    float  shad_sum     = 0;
k3d/share/shaders/k3d_volcube.sl:215:    float  remainder    = 100;
k3d/share/shaders/k3d_volcube.sl:216:    float  cur_density  = 0;
k3d/share/shaders/k3d_volcube.sl:218:    float  density      = StepSize * Density;
k3d/share/shaders/k3d_volcube.sl:219:    float  jitter       = (random() - .5) * StepJitter;
k3d/share/shaders/k3d_volcube.sl:220:    float  cur_depth    = 0;
k3d/share/shaders/k3d_volcube.sl:229:    while(curStep < numOfSteps && density_sum < 1){
k3d/share/shaders/k3d_volcube.sl:230:	cur_density = 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:243:	    if(Do_Shading > 0){
k3d/share/shaders/k3d_volcube.sl:244:		if(cur_depth > 0){
k3d/share/shaders/k3d_volcube.sl:245:		    normal Vol_Nf = calcGradeNorm(Pcur_obj,Vol_Mult,Vol_Offset,
k3d/share/shaders/k3d_volcube.sl:246:						  cur_density,Epsilon);
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:264:	    if(Additive > 0){      
k3d/share/shaders/k3d_volcube.sl:265:                /* Just Add Up Density */
k3d/share/shaders/k3d_volcube.sl:266:		density_sum += max(0,cur_density);
k3d/share/shaders/k3d_volcube.sl:270:                /* Do Over Instead of Add */
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:278:            /* if Shadow Pass */
k3d/share/shaders/k3d_volcube.sl:279:	    if(Additive > 0){
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:286:	    if(shad_sum >= .5){
k3d/share/shaders/k3d_volcube.sl:287:		density_sum = 1;
k3d/share/shaders/k3d_volcube.sl:298:	cur_depth += StepSize;
k3d/share/shaders/k3d_volcube.sl:302:    Oi = density_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: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:14:#define NCELLS 10
k3d/share/shaders/k3d_wallpaper.sl:15:#define CELLSIZE (1/NCELLS)
k3d/share/shaders/k3d_wallpaper.sl:16:#define snoise(s,t)	(2*noise((s),(t))-1)
k3d/share/shaders/k3d_wallpaper.sl:19:k3d_wallpaper(
k3d/share/shaders/k3d_wallpaper.sl:21:    uniform float Kd = 1;
k3d/share/shaders/k3d_wallpaper.sl:37:    uniform point d0 = p1 - p0;
k3d/share/shaders/k3d_wallpaper.sl:38:    point d1;
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:63:                in_out += step(0, zcomp(d0^d1));
k3d/share/shaders/k3d_wallpaper.sl:69:    /* "matte" reflection model */
k3d/share/shaders/k3d_wallpaper.sl:70:    Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_wallpaper.sl:72:    Ci = Os * Ct * (Ka * ambient() + Kd * diffuse(Nf));
k3d/share/shaders/k3d_wallpaper_2stripe.sl:2: * wallpaper_2stripe.sl -- surface shader for double striped wall paper
k3d/share/shaders/k3d_wallpaper_2stripe.sl:5: *   Makes a double striped pattern appropriate for wall paper.  Stripes
k3d/share/shaders/k3d_wallpaper_2stripe.sl:6: *   are shaded in s-t space, and the stripes are parallel to lines of
k3d/share/shaders/k3d_wallpaper_2stripe.sl:7: *   equal s.  The background color is given by the surface color.
k3d/share/shaders/k3d_wallpaper_2stripe.sl:11: *   Ka, Kd, Ks, roughness	the usual
k3d/share/shaders/k3d_wallpaper_2stripe.sl:13: *   bgcolor, stripecolor       color of background and stripes
k3d/share/shaders/k3d_wallpaper_2stripe.sl:14: *   stripewidth                width of stripes, in s coordinates
k3d/share/shaders/k3d_wallpaper_2stripe.sl:15: *   stripespacing              dist between sets of stripes, in s coordinates
k3d/share/shaders/k3d_wallpaper_2stripe.sl:18: * ANTIALIASING:  should analytically antialias itself quite well.
k3d/share/shaders/k3d_wallpaper_2stripe.sl: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:32:			      float stripewidth = 0.05;
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:40:    (filteredpulsetrain(edge, 1, ss, ds) +
k3d/share/shaders/k3d_wallpaper_2stripe.sl:41:     filteredpulsetrain(edge, 1, ss + 2 * stripewidth, ds));
k3d/share/shaders/k3d_wallpaper_2stripe.sl:45:  normal Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_wallpaper_2stripe.sl:46:  Ci = MaterialPlastic(Nf, Ct, Ka, Kd, Ks, roughness);
k3d/share/shaders/k3d_warningstripes.sl:2:// Copyright (c) 1995-2004, Timothy M. Shead
k3d/share/shaders/k3d_warningstripes.sl:4:// Contact: tshead@k-3d.com
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:11:// This program is distributed in the hope that it will be useful,
k3d/share/shaders/k3d_warningstripes.sl:12:// but WITHOUT ANY WARRANTY; without even the implied warranty of
k3d/share/shaders/k3d_warningstripes.sl:14:// General Public License for more details.
k3d/share/shaders/k3d_warningstripes.sl:16:// You should have received a copy of the GNU General Public
k3d/share/shaders/k3d_warningstripes.sl:18:// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
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:26:#define MIN_FILTER_WIDTH 1.0e-6
k3d/share/shaders/k3d_warningstripes.sl:27:#define filter_width(x) max(abs(Du(x)*du) + abs(Dv(x)*dv), MIN_FILTER_WIDTH)
k3d/share/shaders/k3d_warningstripes.sl:29:float filtered_pulse_train(float edge, period, x, dx)
k3d/share/shaders/k3d_warningstripes.sl:31:	float w = dx / period;
k3d/share/shaders/k3d_warningstripes.sl:32:	float x0 = x/period - w/2;
k3d/share/shaders/k3d_warningstripes.sl:34:	float nedge = edge / period;
k3d/share/shaders/k3d_warningstripes.sl:38:		extern float nedge;
k3d/share/shaders/k3d_warningstripes.sl:39:		return ((1 - nedge) * floor(t) + max(0, t-floor(t)-nedge));
k3d/share/shaders/k3d_warningstripes.sl:45:surface k3d_warningstripes(
k3d/share/shaders/k3d_warningstripes.sl:50:	float stripe_position = filtered_pulse_train(0.5 / Frequency, 1.0 / Frequency, u+v, filter_width(u+v));
k3d/share/shaders/k3d_warningstripes.sl:54:	vector Nf = normalize(faceforward(N, I));
k3d/share/shaders/k3d_warningstripes.sl:57:	Ci = (Os * Ct * (ambient() + diffuse(Nf)));
k3d/share/shaders/k3d_water.sl:6: * note : This is very similar to shiny.sl with a slight modification to give it a

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

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

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

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:30:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - \

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

k3d/share/shaders/k3d_water.sl:36:k3d_water ( float Ka = 0, Kd = 0, Ks = 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:51:    vector R, Rdir;          /* Direction to cast the ray */

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

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

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: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:15:	float Kdiffuse = 0.91;

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

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

k3d/share/shaders/k3d_watercolor.sl:39:	dist = exp(-dist);

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

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

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

k3d/share/shaders/k3d_waterdisplacement.sl:8: *	dPdu,dPdv	change in position with u and v

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

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

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

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:16:	string shadowname="";
k3d/share/shaders/k3d_waterlight.sl:22:	solar(vector "shader" (0, -1, 0), 0)
k3d/share/shaders/k3d_waterlight.sl:27:	if(shadowname != "")
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: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:11: *   center - the spatial position of the center of the window
k3d/share/shaders/k3d_windowlight.sl:12: *   up, in - vectors which define the orientation of the window
k3d/share/shaders/k3d_windowlight.sl:13: *   from, to - the direction that the light falls
k3d/share/shaders/k3d_windowlight.sl:14: *   hpanes, vpanes - number of horizontal and vertical panes
k3d/share/shaders/k3d_windowlight.sl:15: *   panewidth, paneheight - width/height of the individual panes
k3d/share/shaders/k3d_windowlight.sl:16: *   fuzz - controls the fading out near the edges
k3d/share/shaders/k3d_windowlight.sl:17: *   framewidth, frameheight - how thick are the window frame "bars",
k3d/share/shaders/k3d_windowlight.sl:18: *               as percentage of panewidth/paneheight
k3d/share/shaders/k3d_windowlight.sl:26:#include "k3d_patterns.h"
k3d/share/shaders/k3d_windowlight.sl:28:light k3d_windowlight(float intensity = 1;
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:37:		      float panewidth = 6, paneheight = 6;
k3d/share/shaders/k3d_windowlight.sl:38:		      float framewidth = .1, frameheight = .1;
k3d/share/shaders/k3d_windowlight.sl:44:  float offset, modulus, yfract, xfract;
k3d/share/shaders/k3d_windowlight.sl:45:  float d;
k3d/share/shaders/k3d_windowlight.sl: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:56:  PL = Ps - path * (d / (path.inv));
k3d/share/shaders/k3d_windowlight.sl:63:	modulus = mod(offset, paneheight);
k3d/share/shaders/k3d_windowlight.sl:65:	  filteredpulse(frameheight / 2, paneheight - frameheight / 2,
k3d/share/shaders/k3d_windowlight.sl:66:			modulus, fuzz);
k3d/share/shaders/k3d_windowlight.sl:71:    offset = (PL - center).right + panewidth * (hpanes / 2);
k3d/share/shaders/k3d_windowlight.sl:72:    if(offset > 0 && (offset / panewidth) < hpanes)
k3d/share/shaders/k3d_windowlight.sl:74:	modulus = mod(offset, panewidth);
k3d/share/shaders/k3d_windowlight.sl:76:	  filteredpulse(framewidth / 2, panewidth - framewidth / 2, modulus,
k3d/share/shaders/k3d_windowlight.sl:81:    Cl = intensity * mix(darkcolor, lightcolor, yfract * xfract);
k3d/share/shaders/k3d_windywave.sl:1:#define snoise(Pt) (2*noise(Pt) - 1)
k3d/share/shaders/k3d_windywave.sl:3:displacement k3d_windywave(float Km = 0.1; float txtscale = 1;
k3d/share/shaders/k3d_windywave.sl:4:			   float windfreq = 0.5; float windamp = 1;
k3d/share/shaders/k3d_windywave.sl:5:			   float minwind = 0.3)
k3d/share/shaders/k3d_windywave.sl:9:  float wind;
k3d/share/shaders/k3d_windywave.sl:12:  PP = txtscale * windfreq * transform("shader", P);
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:11: *   lightwood, darkwood - surface colors for the wood itself
k3d/share/shaders/k3d_wood2.sl:21:surface k3d_wood2(float Ka = 1, Kd = .75, Ks = .4;
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:29:  point PP, PQ;			/* shading space point to be computed */
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:35:  /* Calculate in shader space */
k3d/share/shaders/k3d_wood2.sl:36:  PP = txtscale * transform("shader", P);
k3d/share/shaders/k3d_wood2.sl:47:  /* \/--  extra line added for fine grain */
k3d/share/shaders/k3d_wood2.sl:51:  Ct = mix(lightwood, darkwood, r * r2 * r2);
k3d/share/shaders/k3d_wood2.sl:55:   * Use the plastic illumination model
k3d/share/shaders/k3d_wood2.sl:57:  Nf = faceforward(normalize(N), I);
k3d/share/shaders/k3d_wood2.sl:60:    Os * (Ct * (Ka * ambient() + Kd * diffuse(Nf)) +
k3d/share/shaders/k3d_woodcut.sl:2: surface k3d_woodcut (
k3d/share/shaders/k3d_woodcut.sl:7:float random=0; 
k3d/share/shaders/k3d_woodcut.sl:9:#define snoise(x) (2*noise(x)-1) 
k3d/share/shaders/k3d_woodcut.sl:10:#define pulse(a,b,fuzz,x) (smoothstep((a)-(fuzz),(a),(x)) - smoothstep((b)-(fuzz),(b),(x)))
k3d/share/shaders/k3d_woodcut.sl:11:#define blend(a,b,x) ((a) * (1 - (x)) + (b) * (x))
k3d/share/shaders/k3d_woodcut.sl:23:float Kd = 0.70;
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:37:tt = mod(z,1);
k3d/share/shaders/k3d_woodcut.sl:42:tt = mod(y,1);
k3d/share/shaders/k3d_woodcut.sl:45:illumcolor = (Ka*ambient() + Kd*diffuse(Nf) + Ks*specular(Nf,V,roughness));
k3d/share/shaders/k3d_woodcut.sl:57:(brightness - 1.0) + n*random;
k3d/share/shaders/k3d_woodcut.sl:78:surface_color = blend(surface_color, layer_color, layer_opac);
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:89: P += 0 * Ndisp;
k3d/share/shaders/k3d_woodcut.sl:90: N = normalize (calculatenormal (P + (1-0)*Ndisp)); 
