Instructions
Run glutrad without any parameters to render the Cornell Box detailed in glutrad.ini. To pre-process and render your own geometry, follow these steps:
1.Write yourself an ini file similar to glutrad.ini, enter the full path of all objects in the appropriate place. See below for more details.
2. Save your 3d objects in the raw file format, like this:
Object_name
x1 y1 z1 x2 y2 z2 x3 y3 z3
x1 y1 z1 x2 y2 z2 x3 y3 z3
...
There must be only one object per file, and each object must be a unique colour. Each file must have a one line name at the top.
3. Run glutrad with the ini file as a parameter.
4. Go and have a coffee: glutrad is slooow on an unaccelerated machine, but do let it finish, the subtleties in lighting such as colour bleeding, that add so much, only appear towards the end. The Cornell Box takes about 750 steps.
5. Save the scene with the menu (right click).
More Details
The INI File.
| [settings] resolution=256 brightness=1.2 step=10 near=0.1 far=40.0 smooth_angle=45 stop_at=0.00005 objects=8 |
resolution is the area
of the window in pixels, its also the area of the
hemicube. It must be even. brightness is adjustable, for scenes with many 'light' triangles, I'd reccommend a small value like 0.1 step says how many radiosity steps to take before updating the screen, higher numbers speed things up near and far specify the near and far planes for the camera. The far value must be large enough to contain all geometry and the camera position, the near value should be reasonably small, depending on the complexities of your geometry stopat tells glutrad to stop processing when the free energy in the system reaches this value objects specifies the number of objects in the scene |
| [camera] pos_x=0.0 pos_y=-20.0 pos_z=0.0 lookat_x=0.0 lookat_y=0.0 lookat_z=0.0 up_x=0.0 up_y=0.0 up_z=1.0 fov=45.0 |
pos_x, pos_y, pos_z
specify the location of the camera within a scene lookat_x,lookat_y, lookat_z specifies a point in space at which the camera is pointed up_x, up_y, up_z tell the camera which way is up fov is the camera's field of view |
| [object_0] triangles=112 file=cornell\floor.raw reflectance_r=255 reflectance_g=255 reflectance_b=255 emission_r=0 emission_g=0 emission_b=0 |
each object has its own section, headed with [object_n] where n is
sequential number starting at 0 triangles is the number of triangles within the object (lines-1 for a raw file) reflectance r, g and b is the object's colour, values range from 0 to 255 emission r, g and b says wether of not the object is to act as a light source, values range from 0 to 255 |
The 6d file
The object name is postfixed with the .6d extension and all objects are saved in the current working directory.
V
x[0] y[0] z[0]
x[1] y[1] z[1]
...
x[V-1] y[V-1] z[V-1]
T
a[0] b[0] c[0] r[0] g[0] b[0]
a[1] b[1] c[1] r[1] g[1] b[1]
...
a[T-1] b[T-1] c[T-1] r[T-1] g[T-1] b[T-1]
An object has V vertices and T triangles. A vertex is a triple (x, y, z) and a triangle is composed of two triples (a, b, c), which are indices to the vertex array, and (r, g, b) which specify the triangle's energy. See the program for details of how to convert the r, g, b values to per-vertex colours, or mail me for a sample program.
Usage
GLUTRAD runs automatically, it can be stopped and resumed with the 'Stop' and 'Auto' menu items, available through the right mouse button. The 'Step' menu item and the space bar progress the algorithm one iteration, shooting one triangle's energy. 'AntiAlias' does what it says: try it, it may take a second or so for a large scene. 'Save6d' saves all objects in the scene.
The arrow keys and the mouse rotate the scene around the origin. It will be a little jerky if you're calculating at the same time, so stop it with the menu.
Escape exits.
Contact
I'd be delighted to recieve your comments and suggestions for improvements, I'd also like to see the results of your work with GLUTRAD. If you do change the program for the better, let me have a copy!
Contact colbeck@cix.co.uk for further details. All code is Copyright, 1998, Colbeck Desktop Solutions Ltd.
OpenGL is a registered Trademark of SGI