## ## Copyright (c) 2005 PIXAR. All rights reserved. This program or ## documentation contains proprietary confidential information and trade ## secrets of PIXAR. Reverse engineering of object code is prohibited. ## Use of copyright notice is precautionary and does not imply ## publication. ## ## RESTRICTED RIGHTS NOTICE ## ## Use, duplication, or disclosure by the Government is subject to the ## following restrictions: For civilian agencies, subparagraphs (a) through ## (d) of the Commercial Computer Software--Restricted Rights clause at ## 52.227-19 of the FAR; and, for units of the Department of Defense, DoD ## Supplement to the FAR, clause 52.227-7013 (c)(1)(ii), Rights in ## Technical Data and Computer Software. ## ## Pixar Animation Studios ## 1200 Park Ave ## Emeryville, CA 94608 ## ## ## Smoothstep.slim ## Implements the shading language smoothstep function ## slim 1 extensions pixartt { extensions pixar pxsl { template float Smoothstep { description { 0 if input < minVal; 1 if input >= maxVal; otherwise, a smooth Hermite interpolattion between 0 and 1. } parameter float Input { detail mustvary description { Pattern to feed through smoothstep } default s } parameter float MinVal { label "Min Value" description { Threshold below which the function will return 0 } default .2 range {0 1 .001} subtype slider } parameter float MaxVal { label "Max Value" description { Threshold above which the function will return 1 } default .8 range {0 1 .001} subtype slider } parameter float Scale { description { Scale to apply to the result } detail varying default 1 } parameter float result { access output display hidden } RSLSource StaticFunction { void pxslSmoothstep(float input, minVal, maxVal, scl; output float result;) { /* calculate the standard smoothstep */ result = scl * smoothstep(minVal, maxVal, input); } } } } }