Bouncingball.al scene data
;; bouncingball.al - animation example ;; ;; (render-it 10) renders frame 10 ;; (render-it 18) renders frame 18 ;; (render-it 21) renders frame 21 ;; (render-it 54) renders frame 54 ;; (render-it '(1 90)) renders frames 1-90 (define (ball-model size ballcolor) (model "ball" (pos.x pos.y pos.z squash) (translate (pos.x) (pos.y) (pos.z)) (scale (squash) (/ 1 (sqrt (squash))) (squash)) (uscale '0.3) (color #<0.46 0.58 0.42>) (opacity #<0.2 0.2 0.2>) (surface "glass" 'Ka 1.0 'Kd 0.5 'Ks 0.5 'roughness 0.10000000149 'Kr 1.5 'reflblur 0.0
'raysamples10 'Kt 1.5 ' refrraysamples 5 'refrblur 0.0 'eta 1.5 ) (sphere))) (define (ground size height) (separator (translate 0 height 0) (uscale size) (surface "LGAntialiasedChecks" 'Ka 1 'Kd 1.00 'frequency 20
'color1 #<0.48 0 0> 'color2 #<1.00 1.00 1.00> ) (patch "bilinear" 'P '(#<-1 0 1> #<1 0 1> #<-1 0 -1> #<1 0 -1>)))) (world (camera "main" "perspective" 'from '#<3 1 2> 'to '#<.27 .5 0> 'fov 45) (light "ambientlight" 'intensity .2) (light "distantlight" 'from '#<-1 1 2> 'to '#<0 0 0> 'intensity .5) (light-shadows #t) (light "spotlight" 'from '#<0 5 0> 'to '#<0 0 0> 'intensity 15 'conedeltaangle (radians 15) 'width 4) (ground 5 - 0.25) (ball-model 0.3 '#<0.46 0.58 0.42>) ) (define (render-it frames) (render 'format '(640 480 1) 'frame frames 'display-type "file" 'frame-padding 0 'motion-blur 0.5 'option '(ri-pixel-samples 5 5) ))
Bouncingball.xs animation data
;; AL Exposure Sheet ;; version 3.1f [1/9/96] ;; Written Tue Jan 16 14:15:03 1996 (model "world" (model "ball" (avar "pos.x" (3 -1.04024 -15 0 15 0 Z) (87 2.31423 L)) (avar "pos.y" (2.0 1.19997 -15.0515 0.0 10.2391 0.0 Z) (17.0 -0.0142874982588696 -1.10631 0.0 1.34116 0.0155841 Z) (34.0 1.1393019536927 -13.0446537396122 -0.0119542948388762 13.5986703601108 0.0119542948388764 Z) (53.0 -0.013375554976382 -0.702183 0.00640648 0.812918 -0.0403457 Z) (70.0 1.06159903724001 -13.367756232687 -0.00597714741943811 13.0468698060942 0.00597714741943811 Z) (88.0 0.00962109141888326 -1.06526315789473 0.0 0.649972299168979 0.0 Z) (97.0 0.954010383690118 -4.5 0.0 15.0 0.0 Z)) (avar "pos.z") (avar "squash" (2.0 0.607779 -12.4906371191136 0.010246575062282 17.2401108033241 -0.0107192203229165 Z) (19.0 1.71872983278519 -1.40703 -0.0286577 1.27353 -0.0169696 Z) (37.0 0.586576881984484 -16.8450969529086 0.010482897692599 19.632243767313 -0.0104828976925991 Z) (56.0 1.73969562817039 -1.08299168975068 0.0 0.517894736842109 -0.010482897692599 Z) (75.0 0.576093984291885 -16.5381717451524 0.0 18.5669806094183 0.0 Z) (92.0 1.77114432124818 -1.40609418282547 -0.020965795385198 0.76653739612189 0.010482897692599 Z) (103.0 0.628508472754881 -9.3186703601108 -0.0209657953851982 15.0376731301939 0.0314486930777972 Z))))
Glass.sl sphere shader
/**************************************************************************** * glass.sl -- Shiny reflective & refractive glass, using ray tracing. * * Description: * Makes semi-transparent glass, using ray tracing to calculate * reflections and refractions of the environment. * * Parameters: * Ka, Kd, Ks, roughness, specularcolor - The usual meaning * Kr - coefficient for mirror-like reflections of environment * blur - how blurry are the reflections? (0 = perfectly sharp) * envname, envspace, envrad - controls for using environment maps * rayjitter, raysamples - ray tracing controls for reflection * Kt - coefficient for refracted transmission * transmitcolor - color of the glass * refrblur - how blurry are the refractions? (0 = perfectly sharp) * eta - the coefficient of refraction of the glass * reflrayjitter, refrraysamples - ray tracing controls for refraction * *************************************************************************** * * The Blue Moon Rendering Tools (BMRT) are: * (c) Copyright 1990-2000 Exluna, Inc. and Larry Gritz. All rights reserved. * * Reference: * _Advanced RenderMan: Creating CGI for Motion Picture_, * by Anthony A. Apodaca and Larry Gritz, Morgan Kaufmann, 1999. * * $Revision: 1.5 $ $Date: 2000/11/14 05:53:42 $ * ****************************************************************************/ #include "rayserver.h" #include "material.h" surface glass ( float Ka = 0.2, Kd = 0, Ks = 0.5, roughness = 0.05; color specularcolor = 1; float Kr = 1, reflblur = 0; DECLARE_DEFAULTED_ENVPARAMS; float Kt = 1, refrblur = 0, eta = 1.5; color transmitcolor = 1; float refrrayjitter = 0, refrraysamples = 1; ) { normal Nf = faceforward (normalize(N), I); Ci = MaterialGlass (Nf, Cs, Ka, Kd, Ks, roughness, Kr, reflblur, Kt, refrblur, eta, transmitcolor, refrrayjitter, refrraysamples, ENVPARAMS); }
LG AntialiasedChecks.sl floor shader
/* * checks_aa.sl -- RenderMan compatible shader for checks. * * DESCRIPTION: * Makes a checkered surface, fully antialiased! This sucker should * look great even at only one sample per pixel. * * PARAMETERS: * Ka, Kd work just like the matte shader * color1, color2 these are the colors which make the pattern * frequency determines the frequency (in s-t space) of the checks * * * AUTHOR: written by Larry Gritz * * HISTORY: * 27 Jan 1994 -- written by lg * * last modified 27 Jan 1994 by Larry Gritz */ surface LGAntialiasedChecks (float Ka = 1, Kd = 1, frequency = 10; color color1 = 0, color2 = 1; ) { point Nf; /* Forward facing surface normal */ float smod, tmod; /* Texture position within the pattern */ color checkcolor; /* Color of the checks */ float x, y; /* Used to determine pattern */ float swidth, twidth, sfuzz, tfuzz; /* Antialiasing */ float Nfactor; /* Multiplicative factor for AA due to normal */ float fuzzmax; /* max of (sfuzz, tfuzz) */ Nf = faceforward (normalize(N), I); /* Determine how wide in s-t space one pixel projects to */ swidth = abs(Du(s)*du) + abs(Dv(s)*dv); twidth = abs(Du(t)*du) + abs(Dv(t)*dv); /* Figure out amount of fuzziness, taking normal into account */ Nfactor = abs (Nf . I) / (length(Nf) * length(I)); sfuzz = .5 * swidth * frequency / Nfactor; tfuzz = .5 * twidth * frequency / Nfactor; fuzzmax = max (sfuzz, tfuzz); /* Get the place in the pattern where we're sampling */ smod = mod (s*frequency, 1); tmod = mod (t*frequency, 1); /* If the filter width is small enough, compute the pattern color */ if (fuzzmax <= 0.5) { x = ((smoothstep (.5,.5+sfuzz,smod)) + (1 - smoothstep (0,sfuzz,smod))); y = ((smoothstep (.5,.5+tfuzz,tmod)) + (1 - smoothstep (0,tfuzz,tmod))); checkcolor = mix (color1, color2, x*y + (1-x)*(1-y)); /* Gradually fade in the average color when we get close to the limit */ Ci = mix (checkcolor, (color1+color2)/2, smoothstep (.125, .5, fuzzmax)); } else { /* otherwise, only use the average color */ Ci = (color1 + color2) / 2; } /* Use the matte reflectance formula */ Oi = Os; Ci *= Os * (Ka*ambient() + Kd*diffuse(Nf)); }