home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 18
/
CD_ASCQ_18_111294_W.iso
/
dos
/
graphic
/
raygcc10
/
raysmith.doc
< prev
next >
Wrap
Text File
|
1994-10-25
|
17KB
|
372 lines
RAYSMITH v 1.0
August, 1994
-by Eduardo Bustillo Iceta-
1.INTRODUCTION
RAYSMITH is a radiosity and ray tracing program that allows the user to
create impressive 3-D images. It was created as an end of university
project for my six year degree in mechanical engineering.
The program will be released as freeware and its continuity and
support will depend on public acceptance.
RAYSMITH's main characteristics are:
-Geometry input: The geometry file is read from an Autodesk
3D-Studio v2 .3DS file. This provides a very good geometry creation
interface, as well as DXF importing facility (in 3DS, not in RAYSMITH).
-Radiosity calculations: Implemented using Monte Carlo integration.
This permits to have colour bleeding between surfaces, penumbras,
refracted shadows, specular and diffuse reflections, blurry
reflections, translucency and refractions, texture mapping and any
geometry of light sources. The 'disadvantage' is that you won't get
sharp shadows as in a pure ray-tracing program.
-Adaptive subdivision: Objects with big radiosity gradients inside
are dynamically subdivided during the radiosity process.
-Ray tracing: A postprocess of ray tracing is used to get the view
independent information obtained and create the image file. Among
the main characteristics of the algorithm used are:
-Depth of field: The camera is not a pinhole model, and it has a
user selectable lens radius.
-Stochastic anti-aliasing: This eliminates aliasing in a great
deal.
-Stereo view: As an option you can obtain an image that can be
watched with red-green stereo glasses for a more impressive 3-D
effect.
-Acceleration techniques: Three different techniques are incorporated
into RAYSMITH. This makes it one of the fastest programs I have
tried (POV 2.2, RAYSHADE, RTRACE...).
-Graphic formats: RAYSMITH works in 16.7M colours and only the
uncompressed 24 bit TARGA file format is supported. If you want to use
files with other file format for textures, you should get ALCHEMY
or any other good format exchange program.
-Limitations: There are no resolution, number of objects or any
other kind of limitations in the program. No arrays have been used
in its programming so every piece of memory is dynamically
allocated. With the usage of a 386 and a DOS extender compiled
version any scene can be rendered.
-Minimum system required: IBM-PC compatible with a 386 & 387 or
better CPU and 2Mb of RAM. It is recommended to have at least 8Mb of
RAM if you're planning to do serious work. It works anyway but disk
accessing becomes irritating.
-Completely written in ANSI C: It doesn't help in speed but it may be
compiled for almost any other platform (DEC OSF/1 and HP-UX versions
have been compiled with no modifications).
2. AVAILABLE VERSIONS
At present there are two versions available:
-GNU gcc 2.6.0 compiled version: It uses DJ Delorie's GO32 DOS extender
which provides up to 256Mb of virtual memory. It works under DPMI, but
it's faster when DPMI is disabled.
-WATCOM C v9.5 compiled version: It provides only 32Mb of virtual
workspace and its much bigger as it needs to include the DOS4GW
extender. It is slightly faster in the radiosity process but has
slower parsing and similar ray-tracing benchmarks. The only
difference is that it outputs memory statistics as the program is
executing. This lets you know the amount of memory required for
rendering a file.
3. COMMAND LINE OPTIONS AND REQUIRED FILES
These are the included files in the compressed package:
RAYSMITH.EXE -Executable-
RAYSMITH.DOC -This file-
RAYTRACY.EXE -Distributed raytracer with diffuse effects-
RAYTRACY.DOC -Documentation for RAYTRACY-
TEXTURES.RAY -Material translating file-
DOS4GW.EXE -Only in the WATCOM version-
GO32.EXE -Only in the GNU gcc version-
MLI2RAY.EXE -3DS material library to TEXTURES.RAY translator-
Command line options: RAYSMITH.EXE filename.OPT
You don't have to create long command line scripts to activate
RAYSMITH's options. Once you have your geometry file, you must
create a .OPT text file where you include the options that will
be used for rendering.
.OPT format: The .OPT file is an ASCII file in which there is an
option in each line.
INFILE=filename.3DS
Here you put your geometry file name.
OUTFILE=filename.TGA
Output file name. If omitted, the default name given to the
file would be the input file name with its extension changed
to TGA.
HRESOLUTION=640 (default)
Horizontal resolution of the image file. There are no limits
(only your available time).
VRESOLUTION=480 (default)
Vertical resolution.
MIN_BOUND=0 (default)
This affects acceleration. Possible options are:
0: No minimum bounding volume of global scene is computed.
1: Minimum bounding volume is computed and consequently a
coordinate system change is performed.
Explanation:
When objects in the scene are axis aligned, the minimum
bounding box has its planes perpendicular to the coordinate
system axis, but when objects are in arbitrary positions a
coordinate system change must be performed to permit an axis
aligned box be the minimum possible bounding box.
So, when you have an scene aligned, put 0 (it will be faster),
but if the objects are not aligned, use 1.
TURBO=0 (default)
If 1, computation is much faster. RAYSMITH will try to create
a Z-Buffer structure to accelerate calculations. If there's
enough memory in your system, ray-tracing may be 3 times faster
than usual.
VOXEL_RESOLUTION=6 (default)
There are two acceleration schemes selectable by the user:
-Adaptive Voxel subdivision: Subdivides the space in a tree of
voxels adaptively depending on the number of objects inside.
It is faster if used wisely, but consumes more memory. A good
parameter selection could be:
VOXEL_RESOLUTION=6 (or 8)
VOXEL_DEPTH_MAX=2
-BOP (Binary Object Partitioning): Creates a tree of planes
subdividing the space so that equal number of objects are in
each side.
This variable "VOXEL_RESOLUTION" affects the number of
voxels that are in each step of the subdivision. If you put
10, you will get 10*10*10=1000 boxes each time a subdivision
is performed.
VOXEL_DEPTH_MAX=2 (default)
Maximum depth of the voxel tree.
VOXEL_OBJECTS_MIN=16 (default)
If VOXEL_OBJECTS_MIN number of objects is reached in a voxel,
subdivision is stopped, even if the maximum depth hasn't been
used.
-Note: If any of the above options concerning voxels is
indicated, voxel subdivision will be used as the accelerating
technique. If only BOP options are specified, a BOP subdivision
scheme is used. If none of the options is selected, the default
is voxel subdivision.-
BOP_OBJECTS_MIN=12 (default)
Minimum number of objects in each leaf of the tree that stops
subdivision.
BOP_DEPTH_MAX=100 (default)
Maximum depth of the tree. If you use a big one (200), the
program will never reach it as subdivision stops when it isn't
efficient.
MAX_NUMBER_RAYS=8000 (default)
This is the initial number of rays that will be shot from
the lights in the scene. 8000-20000 should be enough to assure
a good solution (depending on the number of triangles in the scene).
For quick previews 2000-4000 is enough.
When adaptive subdivision is activated you should increase this
value.
MAX_DEPTH=5 (default)
Maximum depth of rays shot (if their energy is still enough).
For scenes with diffuse and specular reflecting objects 2-3
is enough. When using transparent materials it should be
increased to 4-5.
INSIGNIFICANCE_THRESHOLD=0.01 (default)
Ratio between the ray's energy and its initial energy to stop
propagation.
BRIGHTNESS=80.0 (default)
Used to brighten up scenes that are too dark to watch. It is
recommended to use a low resolution to calculate the scene
fast until the right level of brightness is found.
ADAPTIVE=0 (default)
If 0, adaptive subdivision is off. If 1, it is on.
SUBDIVIDING_AREA=0.1 (default)
When (triangle_area)/(average_area) is higher than
SUBDIVIDING_AREA, subdivision may be performed if necessary.
DEPTH_OF_FIELD=0 (default)
If 0, depth of field is off (pinhole camera). If 1, it is on.
LENS_RADIUS=0. (default)
Option read only if depth of field is on.
ANTI_ALIASING=0 (default)
Number of rays per pixel. Possible values:
0->One ray per corner of pixel. Pixel colour averaged. Fast
and gives good result in scenes without blur or depth of
field.
>0->n rays per pixel following a pseudo-Poisson distribution.
When using blurry materials or depth of field you should use a
high value to achieve good quality.
STEREO_VIEW=0 (default)
If 0, a normal image is generated. If 1, 3-D red-green stereo
glasses must be used to watch it.
EYE_SEPARATION=6 (default)
Affects the Stereo view option.
Example of .OPT file:
INFILE=test.3ds
HRESOLUTION=640
VRESOLUTION=480
TURBO=1
VOXEL_RESOLUTION=6
VOXEL_DEPTH_MAX=2
VOXEL_OBJECTS_MIN=12
MAX_NUMBER_RAYS=8000
MAX_DEPTH=3
INSIGNIFICANCE_THRESHOLD=0.005
BRIGHTNESS=90.0
ADAPTIVE=1
SUBDIVIDING_AREA=0.01
DEPTH_OF_FIELD=1
LENS_RADIUS=6.0
ANTI_ALIASING=16
4. TEXTURES.RAY
This file must be present at runtime for the program to work
correctly. It is an ASCII text file with the translation table of the
materials used in 3DStudio. Materials in RAYSMITH have additional
properties, and this file contains them.
NAME TYPE REFLECT SR DR IOR BLUR TRANSM ER EG EB
"MIRROR" 0 1 1 1 1 0 0 0 0 0 0 0 0 0
| | | | | | | | |
name of the material in 3DStudio between "" | | |
| | | | | | | |
0 means pure colour, while 1 means texture mapped material
| | | | | | |
reflectance of the material in the Red Green Blue
bands (max. 1 1 1) (min 0 0 0) | |
| | | | | |
Specular reflection index (0->1) |
| | | | |
Diffuse reflection index (SR+DR |
should be 1) | |
| | | |
Index of refraction (only |
useful if transmittance >0)|
| | |
Blur: Value between 0->1. 0 means perfectly specular reflection of
specularly reflected rays. 1 means diffuse reflection of specularly
reflected rays. It affects specular reflection and transmition making
them less sharp. Good values for metals are between 0.0005->0.0001.
Higher values give unrealistic results. When this value is not 0,
anti-aliasing should be 15 to 40 to give the best results.
| |
Transmittance: Part of the incident energy that is left to |
pass in each frontier. Again in the R G B bands. |
|
R G B Energy emitted by the material. This is the way to
define lights in RAYSMITH. Create objects with this material,
and they will be lights of any geometry.
There is a TEXTURES.RAY example file included in the package so that
you can experiment with it and create your owns.
Another late hour facility has been included in the package: MLI2RAY.EXE
This program lets you convert automatically 3DStudio material
libraries (extension .MLI) to TEXTURES.RAY files so that you are
able to use any already created material.
Usage: MLI2RAY.EXE material_file without extension.
It will create a file called material_file.RAY that you will have
to rename as TEXTURES.RAY and retouch by hand.
5. CREATING GEOMETRY FILES
As it was said before, geometry files have Autodesk's 3DStudio .3DS
format. So if you want to create any scene you must have access to
it. The only incompatibility with this format has to do with lights.
Lights in 3DStudio are point lights, and as RAYSMITH is a radiosity
program, it cannot use these lights. To create lights for RAYSMITH
you have to assign a luminous texture to the object you want to have
as a light.
RAYSMITH is a radiosity program so it is difficult to obtain sharp
shadows. One reason for this is that lights are not point lights, but
the most important one is the polygons size. Using small polygons in
shadow boundaries will give the best results, but this is difficult
to do when creating a scene the first time. It was because of this
that I added a sort of rudimentary adaptive subdivision scheme. Even
in scenes with great radiosity gradients and relatively low polygon
resolution it gives acceptable results if wisely used and combined
with a manual pre-subdivision. Well, it's up to you to send me
suggestions and own experiences to improve it.
6. CONTACTING THE AUTHOR
I would appreciate any scenes, high-quality renderings,
TEXTURES.RAY files, suggestions or comments that anyone interested
may send me. Any bugs will be welcome.
My address is:
Eduardo Bustillo Iceta
Part. de Basterra 1
48990 GETXO (VIZCAYA)
SPAIN
You can also reach me at the following Internet address: (Please
only send me messages here):
epabuice@s835cc.bi.ehu.es
Letters in spanish, english or french will be answered.
Have fun!
7. LEGAL INFORMATION
DISCLAIMER
This software is provided as is without any guarantees or warranty.
Although the author has attempted to find and correct any bugs in
the package, he is not responsible for any damage or losses of any
kind caused by the use or misuse of the package. The author is
under no obligation to provide service, corrections, or upgrades
to this package.
Permission is granted to the user to use RAYSMITH to render images.
The use of this software for the purpose of creating images is free.
The creator of an image retains all rights to the image created and may
use it for any purpose.
This software package and all of the files in this archive are
copyrighted and can not be distributed or modified without the written
permission of the author Eduardo Bustillo Iceta.
No portion of this package may be separated from the package and
distributed separately without the written permission of the author.
This software may not be included in whole or in part in any
software without the written permission of the author.
This software may not be included in any publication, such as, but
not limited to, magazines, books, newspapers, or newsletters, without
the written permission of the author.
This software may not be included in any software compilation using
media such as, but not limited to, CD-ROM, tape backup, optical disks,
hard disks, or memory cards, without the written permission of the
author.