ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/doc/notes/language.BNR
Revision: 1.1
Committed: Sat Mar 15 17:32:55 2003 UTC (20 years, 11 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad3R7P2, rad3R7P1, rad4R2, rad4R1, rad4R0, rad3R5, rad3R6, rad3R6P1, rad3R8, rad3R9, rad4R2P1, rad5R3, HEAD
Log Message:
Added and updated documentation for 3.5 release

File Contents

# User Rev Content
1 greg 1.1 RADIANCE Scene Description Language
2    
3     Altogether there are at least 4 "languages" involved with Radiance
4     scene descriptions: the basic scene input language, the function file
5     language, the data file language and the font language.
6    
7     Scene Input
8     ===========
9    
10     scenefile: /* nothing */
11     | statement scenefile
12    
13     statement: primitive
14     | alias
15     | command
16     | comment
17    
18     primitive: modifier type STRING
19     INTEGER string_args
20     INTEGER integer_args
21     INTEGER real_args
22    
23     alias: modifier alias STRING STRING
24    
25     modifier: "void"
26     | "inherit"
27     | STRING
28    
29     command: '!' STRING string_args command_end
30    
31     command_end: '\n'
32     | '\\' '\n' string_args command_end
33    
34     comment: '#' string_args '\n'
35    
36     string_args: /* nothing */
37     | STRING string_args
38    
39     integer_args: /* nothing */
40     | INTEGER integer_args
41    
42     real_args: /* nothing */
43     | REAL real_args
44    
45     type: "polygon"
46     | "cone"
47     | "sphere"
48     | "texfunc"
49     | "ring"
50     | "cylinder"
51     | "instance"
52     | "cup"
53     | "bubble"
54     | "tube"
55     | "mesh"
56     | "plastic"
57     | "metal"
58     | "glass"
59     | "trans"
60     | "dielectric"
61     | "plastic2"
62     | "metal2"
63     | "trans2"
64     | "interface"
65     | "plasfunc"
66     | "metfunc"
67     | "brightfunc"
68     | "brightdata"
69     | "brighttext"
70     | "colorpict"
71     | "glow"
72     | "source"
73     | "light"
74     | "illum"
75     | "spotlight"
76     | "mist"
77     | "mirror"
78     | "transfunc"
79     | "BRTDfunc"
80     | "plasdata"
81     | "metdata"
82     | "transdata"
83     | "colorfunc"
84     | "antimatter"
85     | "colordata"
86     | "colortext"
87     | "texdata"
88     | "mixfunc"
89     | "mixdata"
90     | "mixtext"
91     | "prism1"
92     | "prism2"
93    
94     Function File
95     =============
96    
97     funcfile: /* nothing */
98     | decl funcfile
99    
100     decl: ';'
101     | function_decl ';'
102     | variable_decl ';'
103    
104     function_decl: ID '(' id_list ')' assign_op e1
105    
106     variable_decl: ID assign_op e1
107    
108     id_list: ID
109     | ID ',' id_list
110    
111     assign_op: '='
112     | ':'
113    
114     e1: e1 '+' e2
115     | e1 '-' e2
116     | e2
117    
118     e2: e2 '*' e3
119     | e2 '/' e3
120     | e3
121    
122     e3: e4 '^' e3
123     | e4
124    
125     e4: '+' e5
126     | '-' e5
127     | e5
128    
129     e5: '(' e1 ')'
130     | ID
131     | ID '(' id_list ')'
132     | REAL
133     | '$' INTEGER
134    
135     Comments may appear between any two tokens set off by curly braces {},
136     and may be nested to any level.
137    
138     Data File
139     =========
140    
141     data: dimensions value_list
142    
143     dimensions: INTEGER dim_list
144    
145     dim_list: dim
146     | dim dim_list
147    
148     dim: REAL REAL INTEGER
149     | '0' '0' INTEGER indep_list
150    
151     indep_list: REAL
152     | REAL indep_list
153    
154     value_list: /* nothing */
155     | REAL value_list
156    
157     Comments begin with a pound sign ('#') and continue to the end of line.
158    
159     Font File
160     =========
161    
162     glyph_list: /* nothing */
163     | glyph glyph_list
164    
165     glyph: INTEGER INTEGER coord_list
166    
167     coord_list: /* nothing */
168     | INTEGER INTEGER coord_list
169    
170     Comments begin with a pound sign ('#') and continue to the end of line.
171    
172     --------------------------------------------------------------
173    
174     With regards to your topics, I have the following comments.
175    
176     Specification of scene parameters:
177     - Radiance uses a right-hand coordinate system
178     - The eyepoint and view direction are given as options
179     to the renderers, and can be stored in a separate file
180    
181     Supported primitives:
182     - N-sided polygons
183     - spheres
184     - cones, cylinders, rings
185     - hierarchical instancing for very complex geometries
186    
187     Lighting models:
188     - Completely general
189     - Converter provided for IES luminaire specification
190    
191     Participating media:
192     - Single-scatter approximation
193     - Mist zones may have different scattering/absorption properties
194    
195     Textures:
196     - I break "textures" into two kinds, patterns and textures
197     - Patterns are variation in color, and can be specified as
198     pictures, data or functions in any combination
199     - Textures are perturbations in surface normal, and can
200     be specified in the same ways as patterns
201     - A light source distribution is a pattern
202    
203     Bit Mapping:
204     - Usually given as a picture-type pattern (ie. "colorpict" type)
205     - True bit-maps (ie. 1-bit depth images) may also be produced
206     using a special bit font
207    
208     CSG:
209     - Radiance has an "antimatter" type which supports some rudimentary
210     CSG subtraction, but otherwise we are strictly B-rep
211    
212     Looping constructs or Recursion:
213     - The function file language supports recursion
214     - The "xform" program provides iteration for repeated objects
215    
216     Functions or Procedures:
217     - The function file language supports functions without side effects
218    
219     User extensibility:
220     - The user may create function files, data files and font files,
221     or provide his/her own images for patterns
222     - General bidirectional reflection distribution functions may
223     also be specified in the same way as patterns and textures
224