Rayfile Syntax

#N n
The number of samples to fire in a grid cell of a pixel. n must be greater than 0. n has a default value of 1.

#SW w
The number of stratified sample grids wide each pixel is. w must be greater than 0. w has a default value of 1.

#SH h
The number of stratified sample grids high each pixel is. h must be greater than 0. h has a default value of 1.

#depthoffield fl aper
Turns on depth of field rendering. fl is the focal length of the lens and aper is the aperature number of the lens. The program by default has depth of field rendering turned off.

#russian p
Turns on russian roulette. p is the probablity of ray death at each depth. The program by default has russian roulette turned off.

#resolution w h
Sets the width and height of the output image. w and h must be greater than 0. The program generates a 320 by 240 image by default.

#backward w h r
Turns on backward path tracing. w and h is the width and height of the depository for each shape. r is the number of rays to be sent out from each light in the scene. w, h, and r must be greater than 0. The program by default has backward path tracing turned off. Backward and bidirectional tracing cannot be performed at the same time.

#bidirectional
Turns on bidirectional path tracing. Backward and bidirectional tracing cannot be performed at the same time.

#backandreg w h r
Turns on backward path tracing and regular tracing. w and h is the width and height of the depository for each shape. r is the number of rays to be sent out from each light in the scene. w, h, and r must be greater than 0. Backandreg and bidirectional tracing cannot be performed at the same time.

#texture filename
Each texture command declares a texture that is stored with an associated integer. The declarations are numbered starting with 0 so that they can be used in later material commands. filename is the file name of the texture image to use.

#material
      sdr sdg sdb ssr ssg ssb sn
      er eg eb
      idr idg idb isr isg isb in
      rdr rdg rdb rsr rsg rsb rn
      kt ir texid

Each material command declares a material that is stored with an associated integer. The declarations are numbered starting with 0 so that they can be used in later shapes. sdr, sdg, sdb, ssr, ssg, ssb, and, sn are the surface diffuse red, surface diffuse green, surface diffuse blue, surface specular red, surface specular green, surface specular blue, and surface specular coefficient components. er, eg, and eb are the emited red, emitted green, and emitted blue components. idr, idg, idb, isr, isg, isb, and in are the internal diffuse red, internal diffuse green, internal diffuse blue, internal specular red, internal specular green, internal specular blue, and internal specular coefficient components. rdr, rdg, rdb, rsr, rsg, rsb, and rn are the refraction diffuse red, refraction diffuse green, refraction diffuse blue, refraction specular red, refraction specular green, refraction specular blue, and refraction specular coefficient components. kt is the transmission coefficient. ir is the index of refraction. texid is the texture id of the material. If no texture is present put a negative number for texid.

#camera x y z tx ty tz ux uy uz ha
This command declares a cammera. x, y, and z is the location of the camera. tx, ty, and tz is the towards direction of the camera. ux, uy, and uz is the up direction of the camera. ha is the half height angle of the camera.

#shape_box m cx cy cz lx ly lz
This command creates a box of material m centered at (cx, cy, cz) with one-half of (lx, ly, lz) added and subtracted from the center to get the max and min corner of the box.

#shape_sphere m cx cy cz r
This command creates a sphere of material m centered at (cx, cy, cz) with radius r.

#shape_spherelight m cx cy cz r
This command creates a sphere light of material m centered at (cx, cy, cz) with radius r.

#vertex px py pz nx ny nz tu tv
Each vertex command declares a vertex that is stored with an associated integer. The declarations are numbered starting with 0 so that they can be used in later triangle commands. (px, py, pz) is the position of the vertex. (nx, ny, nz) is the normal at the vertex. tu and tv is the texture coordinates at the vertex.

#shape_triangle m v0 v1 v2 in
This command creates a triangle of material m with vertices v0, v1, and v2. Setting in to a value greater than 0 causes the normals of the vertices to be interpolated as the normal for the triangle otherwise the normal for the plane containing the triangle's vertices is used as the normal.

#shape_trianglelight m v0 v1 v2 in
This command creates a triangle light of material m with vertices v0, v1, and v2. Setting in to a value greater than 0 causes the normals of the vertices to be interpolated as the normal for the triangle light otherwise the normal for the plane containing the triangle's vertices is used as the normal.

#translate s dx dy dz
After each shape is declared it is assigned a unique integer. The shape declarations are numbered starting with 0 so that they can later be translated. s is the number of the shape to translate and dx, dy, and dz are the offsets to translate the shape.