Appendix C LANGUAGE BINDING DETAILS C.1 ANSI C Binding <strong>The</strong> following is the version of ri.h required for the ANSI-standard C binding of the <strong>RenderMan</strong> <strong>Interface</strong>. /* * <strong>RenderMan</strong> <strong>Interface</strong> Standard Include File * (for ANSI Standard C) */ /* Definitions of Abstract Types used in RI */ typedef short RtBoolean; typedef int RtInt; typedef float RtFloat; typedef char *RtToken; typedef RtFloat RtColor[3]; typedef RtFloat RtPoint[3]; typedef RtFloat RtVector[3]; typedef RtFloat RtNormal[3]; typedef RtFloat RtHpoint[4]; typedef RtFloat RtMatrix[4][4]; typedef RtFloat RtBasis[4][4]; typedef RtFloat RtBound[6]; typedef char *RtString; typedef void #define RtVoid *RtPointer; void typedef RtFloat (*RtFilterFunc)(RtFloat, RtFloat, RtFloat, RtFloat); typedef RtVoid (*RtErrorHandler)(RtInt, RtInt, char *); typedef RtVoid (*RtProcSubdivFunc)(RtPointer, RtFloat); typedef RtVoid (*RtProcFreeFunc)(RtPointer); typedef RtVoid (*RtArchiveCallback)(RtToken, char *, ...); typedef RtPointer RtObjectHandle; typedef RtPointer RtLightHandle; 167
typedef RtPointer RtContextHandle; /* Extern Declarations for Predefined RI Data Structures */ #define RI_FALSE 0 #define RI_TRUE (! RI_FALSE) #define RI_INFINITY 1.0e38 #define RI_EPSILON 1.0e-10 #define RI_NULL ((RtToken)0) extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtToken extern RtBasis RI_FRAMEBUFFER, RI_FILE; RI_RGB, RI_RGBA, RI_RGBZ, RI_RGBAZ, RI_A, RI_Z, RI_AZ; RI_PERSPECTIVE, RI_ORTHOGRAPHIC; RI_HIDDEN, RI_PAINT; RI_CONSTANT, RI_SMOOTH; RI_FLATNESS, RI_FOV; RI_AMBIENTLIGHT, RI_POINTLIGHT, RI_DISTANTLIGHT, RI_SPOTLIGHT; RI_INTENSITY, RI_LIGHTCOLOR, RI_FROM, RI_TO, RI_CONEANGLE, RI_CONEDELTAANGLE, RI_BEAMDISTRIBUTION; RI_MATTE, RI_METAL, RI_SHINYMETAL, RI_PLASTIC, RI_PAINTEDPLASTIC; RI_KA, RI_KD, RI_KS, RI_ROUGHNESS, RI_KR, RI_TEXTURENAME, RI_SPECULARCOLOR; RI_DEPTHCUE, RI_FOG, RI_BUMPY; RI_MINDISTANCE, RI_MAXDISTANCE, RI_BACKGROUND, RI_DISTANCE, RI_AMPLITUDE; RI_RASTER, RI_SCREEN, RI_CAMERA, RI_WORLD, RI_OBJECT; RI_INSIDE, RI_OUTSIDE, RI_LH, RI_RH; RI_P, RI_PZ, RI_PW, RI_N, RI_NP, RI_CS, RI_OS, RI_S, RI_T, RI_ST; RI_BILINEAR, RI_BICUBIC; RI_LINEAR, RI_CUBIC; RI_PRIMITIVE, RI_INTERSECTION, RI_UNION, RI_DIFFERENCE; RI_PERIODIC, RI_NONPERIODIC, RI_CLAMP, RI_BLACK; RI_IGNORE, RI_PRINT, RI_ABORT, RI_HANDLER; RI_COMMENT, RI_STRUCTURE, RI_VERBATIM; RI_IDENTIFIER, RI_NAME, RI_SHADINGGROUP; RI_WIDTH, RI_CONSTANTWIDTH; RiBezierBasis, RiBSplineBasis, RiCatmullRomBasis, RiHermiteBasis, RiPowerBasis; #define RI_BEZIERSTEP ((RtInt)3) #define RI_BSPLINESTEP ((RtInt)1) #define RI_CATMULLROMSTEP ((RtInt)1) #define RI_HERMITESTEP ((RtInt)2) #define RI_POWERSTEP ((RtInt)4) extern RtInt RiLastError; /* Declarations of All the <strong>RenderMan</strong> <strong>Interface</strong> Subroutines */ extern RtFloat RiGaussianFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth); extern RtFloat RiBoxFilter(RtFloat x, RtFloat y, RtFloat xwidth, RtFloat ywidth); extern RtFloat RiTriangleFilter(RtFloat x, RtFloat y, 168
- Page 1 and 2:
The RenderMan Interface Version 3.2
- Page 3 and 4:
TABLE OF CONTENTS List of Figures L
- Page 5 and 6:
12.1 Surface Shaders . . . . . . .
- Page 7 and 8:
Section I DIFFERENCES BETWEEN VERSI
- Page 9 and 10:
LIST OF TABLES 4.1 Camera Options .
- Page 11 and 12:
PREFACE This document is version 3.
- Page 13 and 14:
Section 1 INTRODUCTION The RenderMa
- Page 15 and 16:
created using this language. This l
- Page 17 and 18:
Depth of Field The ability to simul
- Page 19 and 20:
typedef RtPointer typedef RtPointer
- Page 21 and 22:
RiContext (ctx1); ... There is no R
- Page 23 and 24:
Section 3 RELATIONSHIP TO THE RENDE
- Page 25 and 26:
through the interface. Any place wh
- Page 27 and 28:
RtContextHandle RiGetContext ( void
- Page 29 and 30:
RiWorldBegin (); ... RiColor (...);
- Page 31 and 32:
Camera Option Type Default Descript
- Page 33 and 34:
ottom top left right Screen Window
- Page 35 and 36:
EXAMPLE RiFrameAspectRatio (4.0/3.0
- Page 37 and 38:
not support the special projection
- Page 39 and 40:
This procedure sets the times at wh
- Page 41 and 42:
Output depth values are the camera-
- Page 43 and 44:
A particular renderer implementatio
- Page 45 and 46:
Renderers may additionally produce
- Page 47 and 48:
The number of color components, n,
- Page 49 and 50:
RiAttributeBegin () RiAttributeEnd
- Page 51 and 52:
RIB BINDING Color c0 c1... cn Color
- Page 53 and 54:
An area light source is defined by
- Page 55 and 56:
The sequencenumber is the integer l
- Page 57 and 58:
4.2.5 Displacement shading The grap
- Page 59 and 60:
SEE ALSO RiExterior RiAtmosphere Ri
- Page 61 and 62:
Matte onoff EXAMPLE RiMatte (RI TRU
- Page 63 and 64:
object foo2 will be drawn when the
- Page 65 and 66:
the exterior is the region adjacent
- Page 67 and 68:
RiIdentity ( ); SEE ALSO RiTransfor
- Page 69 and 70:
RiScale ( RtFloat sx, RtFloat sy, R
- Page 71 and 72:
4.3.2 Transformation stack Transfor
- Page 73 and 74:
Section 5 GEOMETRIC PRIMITIVES The
- Page 75 and 76:
Information Name Type Class Floats
- Page 77 and 78:
No checking is done by the RenderMa
- Page 79 and 80:
5.2 Patches Patches can be either u
- Page 81 and 82:
U V 0 1 2 3 12 13 14 15 4 5 6 7 8 9
- Page 83 and 84:
10 x 7 Aperiodic Bezier Bicubic Pat
- Page 85 and 86:
SEE ALSO 2 2 [ 0 0 1 1 ] 0 1 ”Pw
- Page 87 and 88:
parameterlist is a list of token-ar
- Page 89 and 90:
Requests a sphere defined by the fo
- Page 91 and 92:
Hyperboloid 0 0 0 .5 0 0 270 ”Cs
- Page 93 and 94:
z N z V point2 height U x x y 0 max
- Page 95 and 96:
particle. If a primitive variable i
- Page 97 and 98:
The code array is a sequence of mac
- Page 99 and 100:
is an array of floats that define t
- Page 101 and 102:
The helper program generates geomet
- Page 103 and 104:
Procedural ”DynamicLoad” [ ”m
- Page 105 and 106:
SolidBegin ( ”difference” ); So
- Page 107 and 108:
Section 6 MOTION Some rendering pro
- Page 109 and 110:
Transformations Geometry Shading Ri
- Page 111 and 112:
channels (usually an RGB color) can
- Page 113 and 114:
Image Forward Axis Up Axis Right Ax
- Page 115 and 116:
ErrorHandler ”ignore” ErrorHand
- Page 117 and 118:
Part II The RenderMan Shading Langu
- Page 119 and 120:
spaces (such as CMYK or pseudocolor
- Page 121 and 122:
transmit reflect transmit P E light
- Page 123 and 124:
Section 10 RELATIONSHIP TO THE REND
- Page 125 and 126:
Section 11 TYPES The Shading Langua
- Page 127 and 128: Coordinate System ”shader” ”c
- Page 129 and 130: As in C, individual array elements
- Page 131 and 132: Light Source E Vantage Point N L Il
- Page 133 and 134: Surface Element to Illuminate L N I
- Page 135 and 136: Name Type Storage Class Description
- Page 137 and 138: • conditional execution, • loop
- Page 139 and 140: This example integrates over a hemi
- Page 141 and 142: Shader instance variable values can
- Page 143 and 144: } return 2 * (vector noise(p)) - 1;
- Page 145 and 146: These functions compute power and i
- Page 147 and 148: The actual change in a variable is
- Page 149 and 150: Return a unit vector in the directi
- Page 151 and 152: Return surface normal given a point
- Page 153 and 154: diffuse returns the diffuse compone
- Page 155 and 156: prevent aliasing. If one set of tex
- Page 157 and 158: 15.7.3 Shadow depth maps Shadow dep
- Page 159 and 160: These functions access the value of
- Page 161 and 162: The standard data names supported b
- Page 163 and 164: } Oi = sum; Ci = Cs * Oi * (Ka + Kd
- Page 165 and 166: path of the ray. The input Ci and O
- Page 167 and 168: A.2.3 Metal surface surface metal(
- Page 169 and 170: distantlight( float intensity = 1;
- Page 171 and 172: A.6 Imager Shaders A.6.1 Background
- Page 173 and 174: variable definitions ; variables va
- Page 175 and 176: triple sixteentuple arrayindex: [ e
- Page 177: Logical expressions have the value
- Page 181 and 182: RiOptionV(RtToken name, RtInt n, Rt
- Page 183 and 184: RtInt n, RtToken tokens[], RtPointe
- Page 185 and 186: #define RIE_NOTATTRIBS ((RtInt)26)
- Page 187 and 188: Comments Any occurrence of the ’#
- Page 189 and 190: In the following sections the synta
- Page 191 and 192: C.2.2 Error handling There are two
- Page 193 and 194: adhandle badparamlist badripcode ba
- Page 195 and 196: v e r s i o n 212 # version 003 007
- Page 197 and 198: Using RIB File structuring conventi
- Page 199 and 200: Attribute Format PixelFilter Shadin
- Page 201 and 202: ##Include filename This entry allow
- Page 203 and 204: D.2.1 RIB Entity File example ##Ren
- Page 205 and 206: Motion Blur Programmable Shading Di
- Page 207 and 208: } E.4 Gaussian Filter RtFloat RiGau
- Page 209 and 210: Appendix G RENDERMAN INTERFACE QUIC
- Page 211 and 212: Function RiOpacity (color) RiOption
- Page 213 and 214: Geometric Primitives (continued) Fu
- Page 215 and 216: Function abs(x) Math Functions Desc
- Page 217 and 218: Function area(P) calculatenormal(P)
- Page 219 and 220: Texture Mapping Functions Function
- Page 221 and 222: RiInterior 47 RiLightSource 42 RiMa
- Page 223 and 224: and uniform variables on an RiNuPat
- Page 225 and 226: Statement About Pixar’s Copyright