home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
DOS
/
GRAFISCH
/
RAYTRACE
/
CRENDER
/
CRENDER.DOC
< prev
next >
Wrap
Text File
|
1992-02-01
|
22KB
|
528 lines
[ 1 ]
----------------------------------------------------------------------------
- Welcome to ColorRender V1.5 [Still Beta, but better<g>] -
----------------------------------------------------------------------------
Munich, 29th Jan 1992, 21:00
This is a reasonably tested version, but it might not be bug-free. I
haven't come across any for some time, but you never know.
CRNDR features a GUI interface and requires:
- a VGA or S-VGA Graphics Card and
- a Microsoft-compatible mouse.
- at least 512K free RAM (maybe less will do too...)
New users should read this whole doc, although it won't do any harm to
jump straight into the program.
Users of CRNDR V1.0 can skip to the 'Changes ...' section.
***************************************************************************
NOTE for Impatient Power Users !
***************************************************************************
Call CRNDR from DOS. Move Sliders about with mouse by pressing left mouse
button. Press right mouse button to re-render. Press F8 or click on
Print to output texture block, enter filename, texture name, return.
Press F10 or click on Quit to leave program. Then come back and read the
rest of this documentation !<g>
***************************************************************************
Index
-----
Basics . . . . . . . . . . . . . . . . . 2
Getting Started . . . . . . . . . . . . 2
Screen layout . . . . . . . . . . . . . 2
Changing Parameters . . . . . . . . . . 3
Slider Links . . . . . . . . . . . . . . 3
Seeing is believing . . . . . . . . . . 3
Output . . . . . . . . . . . . . . . . . 4
Quitting . . . . . . . . . . . . . . . . 4
Changes from CRNDR V1.0 . . . . . . . . 4
Official Stuff . . . . . . . . . . . . . 7
Credits . . . . . . . . . . . . . . . . 7
Support . . . . . . . . . . . . . . . . 8
Technical Stuff . . . . . . . . . . . . 8
Precalc'd data . . . . . . . . . . . . . 8
Menu system . . . . . . . . . . . . . . 8
CRNDR.CFG Sections . . . . . . . . . . . 10
Future features and enhancements . . . . 10
[ 2 ]
Basics
------
CRNDR is an interactive utility that lets you change (nearly) all the
parameters in the Texture block that PoV understands.
The image that results by changing these parameters, becomes visible a
lot quicker than it would if you were to start a raytracer, a post-
processor and a displayer, as you would normally have to do. CRNDR has a
preview window which displays what a sphere will look like with the
settings you have defined. This preview window can be updated within 1 or
2 seconds (depending on machine and settings).
Getting Started
---------------
CRNDR takes up to two command line parameters.
CRNDR [ -Tdatafile[.PRE] ] [ -Cmenu[.CFG] ]
-T This specifies the scene file, created with CPRE.EXE. Default is
--- TRACE.PRE. You can use differect .PRE files for different scenes
by specifying this parameter.
For example you could use CPRE.EXE to generate a scene file with a
refraction index of 1.0 and 1.5 named TRACE10.PRE and TRACE15.PRE.
Do this like this :
C:\>CPRE TRACE10.PRE
and answer with 1.0 when prompted for the Index of Refraction. Then
repeat the procedure :
C:\>CPRE TRACE15.PRE
and answer with 1.5.
Now if you want to make a glass texture call CRNDR like this :
C:\>CRNDR -TTRACE15
If you always want to use TRACE15.PRE as your preview image, you can
rename it to TRACE.PRE and forget about the commandline parameter.
-C This specifies the menu definition and options file. The default is
--- CRNDR.CFG. You can use differect .CFG files for different modes by
specifying this parameter.
Screen layout
-------------
After you've started CRNDR, you'll see the following screen layout:
- In the top left corner a preview window.
- Underneath this are 2 selection windows (more later).
- On the right half of the screen a ton of slider buttons.
- At the bottom 2 rows of menu buttons (some of which are not implemented
yet).
The program will load a few things, like options and the precomputed data.
After this the mouse cursor is arrow shaped and the first sphere has been
rendered.
[ 3 ]
Changing Parameters
-------------------
The sliders contain the settings for the last selected object. The 2
buttons under the Preview window can be used to load the sliders with the
corresponding object parameters. You can change the plane and the sphere
parameters. Some parameters of the plane (e.g. Alpha) cannot be changed.
You change parameters by moving the mouse cursor over the slider that
corresponds to the parameter you wish to change.
Press the left mouse button and drag the slider to the position you want
it in and release the button.
If you change one of the color sliders the color that results will
immediately be displayed in one of the two buttons under the preview
window.
You can change either RGB values, in which case the HSL values will
automatically adjust themselves to reflect the setting that you've defined
with the RGB sliders.
Or you can move one of the HSL sliders, in which case the RGB sliders will
adjust themselves.
Slider Links
------------
I've built a 'Link' into the sliders. You select two parameters to hook up
and when you move one slider the other will be set so that the sum of the
two gives the link value. (If you didn't understand a word, don't worry I
didn't either, this is difficult to explain. The best thing you can do is
select Link from the menu and then select 'Amb+Diff' from the popup and set
the value to 1.0. Then move the ambient slider and watch the diffuse
slider.)
Seeing is believing
-------------------
Want to see what the sphere looks like ? Press the right mouse button to
update the preview window. The cursor becomes a timer and the scene is
re-rendered.
Times for re-rendering can vary. If the re-render time with the
Optimal Colormap is too slow, you may want to do the rough work with
Dithering and then re-render with the Optimal Map when you think that's it.
[ 4 ]
Output
------
When you want to output the parameters for use in a PoV scene, you first
need to set the output format (only once, the setting is stored). Do this
by pressing 'O' or clicking on the OPTIONS menuitem. The Output format can
now be changed in the Options Popup that appears. Press on the button to
cycle through the choices.
When you have selected the correct format, press the right button to return
to the main screen.
Now press F8 or click on the PRINT menuitem. You will be asked to enter a
filename. Type the name of the file you want to print the texture to.
You may enter the name of an exisiting file or a new file. If the file
you specify exists, the texture definition will be appended to the file.
Now you need to give the texture a name. Type a name and press return. Any
spaces you type are converted to underscores.
The program will now write a texture block of the parameters of the sphere
into the text file.
Quitting
--------
To leave CRNDR, press F10 or click on the Quit menuitem.
All parameter settings are recorded in CMAP.OPT when you exit, so that next
time you start CRNDR it'll look just like you left it.
Changes from CRNDR V1.0
-------------------------
Basically it's a more rounded program now, more things are changeable.
- MENU.SMF has been renamed to CRNDR.CFG and is used for a lot of other
things too (see below). You might like to look into it after reading
this description.
- CRNDR now also lets you play with refraction, transmission and alpha
sliders. The resulting image is not 100% correct, since the shadow cannot
(yet) be calculated accurately. Since Alpha works like a filter, but only
when refraction is off, the shadow should be the color of the light,
filtered by the sphere, mixed with the plane color (phew). CRNDR cannot
do this (I haven't managed to figure it out completely, and all has not
been said about the transmission issue).
- CRNDR now has a small Help System, that you can change to your hearts
content, as long as you don't remove my name or the names of people I
give credit to. The complete Help system is in CRNDR.CFG. You can extend
it, translate it, shrink it, you name it, you can (probably) do it!
[ 5 ]
- CRNDR now shows you what you are currently editing. The rectangle of the
selected object now appears to be depressed and an 'ACTIVE' label is
attached.
- You can zero every slider by pressing '0' while the cursor is over it,
and you can set it to full by pressing '1' while over it.
- The Options Popup now has a 'Default setting' button which sets the
sphere and plane parameters to a good looking yellow and a striking
blue<g>.
- The sliders are 'logically' linked. Sliders that don't have any effect
are blanked. For example, if you have set DIFFUSE to 0 then the
BRILLIANCE slider will be disabled.
- The color of the light source is now no longer interactively changeable.
It can be defined in CRNDR.CFG, section [LIGHT].
- CRNDR now always outputs the texture block of the sphere. The plane can
only be edited in a limited way. Alpha, refraction etc. of the plane
cannot be changed.
- CRNDR now supports other Video modes too, see CRNDR.CFG, in the
section [SCREEN] for a list.
NOTE : Unfortunately the tweaked modes (320x240 etc) don't work yet,
because the BGI driver I'm using doesn't support PutImage() and
GetImage() and it's needed in the program. CRNDR will run in these modes,
but the mouse cursor will leave a trail behind.
The BGI Driver will soon support this, so that I expect the next version
to be able to handle it.
- The font for 320x200 mode has been made smaller so that more information
can be cramped into the display :-). It's still very readable, though.
- A number of other fonts are also contained in CRNDR so that you don't
need a magnifying glass to read the labels in 800x600 mode.
- CRNDR now comes with CPRE, the precalculator. You can move the light
source and the camera around. CRNDR.CFG contains all settings in the
section [PRECALC] neccessary for CPRE to calculate the *.PRE data file.
Only the Index of Refraction is prompted for before calculation takes
place.
The resolution of the preview is still locked at 100x66 but I think the
next version should support dynamic sizes. (100x66 looks really small on
a 640x480 or 800x600 display, and those with enough horsepower [486/33]
can then make the preview bigger.)
NOTE : The coordinate system may seem a bit strange for PoV users: the
Z axis points up.
- I've dropped DKB output completely and Vivid output for the moment. After
looking at the Vivid V2.0 docs, it appears that Vivid uses a lighting
model completely different to that from PoV. Thus a conversion of the
settings to reasonably reflect what you are seeing in the preview is not
possible.
If I ever find out how the lighting works in Vivid, it'd be real easy to
change to lighting model in CRNDR and just use a different CRNDR.CFG for
the menu system.
[ 6 ]
- There are only two output modes, PoV 0.5 and PoV 1.0.
- The transmission problem has not been solved yet, so that I've made a
provision for treating the TRANSMIT parameter as a flag (as it was
implemented in PoV 0.5) and as a float (which is how it should be).
This is done (how else?) in CRNDR.CFG under the section [SETTINGS].
If you use the flost setting you'll need to change the code in PoV 0.5
(I don't know about V1.0, it wasn't out at this time).
Procedure :
+ Find the routine Refract(...) in lighting.c.
+ In the first block, where it says 'if (Surface_Normal==NULL)', change
the last three statements to
Colour.Red += Temp_Colour.Red*Texture->Object_Transmit;
etc, the same with Green and Blue.
- You can specify the decimal precision of floats written to the output
file by changing this setting in CRNDR.CFG under the section [SETTINGS].
--------------
Have fun!
--------------
[ 7 ]
---------------------------------------------------------------------------
Official Stuff
---------------------------------------------------------------------------
This copyrighted software is freely distributable. The author retains the
copyright to the program, but authorizes free distribution by BBS's,
networks, magnetic media, etc. so long as this document remains unaltered
and attached to the program (in a ZIP).
This software may not be included in whole or in part into any commercial
package without the explicit written consent of the author. It may,
however, be included in other freely distributed software so long as proper
credit for the software is given. No more than five dollars U.S. ($5) can
be charged for the copying of this software and the media it is provided on,
i.e. a shareware distribution company may only charge five U.S dollars or
less for providing this software.
This software is provided as is without any guarantees or warranty.
Although the author has attempted to find and correct any bugs in the
software, he is not responsible for any damage caused by the use of the
software. The author is under no obligation to provide service, corrections,
or upgrades to this package.
However, if you find a bug I'd be grateful if you could let me know.
---------------------------------------------------------------------------
Credits:
--------
o Thanks to Jordan Hargrave [72510,1143] for writing the BGI SVGA Driver
and thus making it really simple to use the SVGA cards.
o Thanks to Dave Mason [76546,1321] for making his implementation of the
algorithm in Andrew S. Glassners book "Graphic Gems I" called
"A Simple Method for Color Quantization : Octree Quantization",
written by Michael Gervautz and Werner Purgathofer, available for
incorporating into CRNDR, it really made a vast quality improvement.
Although it's a bit slower, the quality makes up manifold!
o The RGB to HLS and vice versa conversion code is from
"Fundamentals of three-dimensional computer graphics" by Alan Watt.
o Markus Lutz, who's been raytracing with me for the last few years and
always makes good suggestions.
[ 8 ]
Support:
--------
I can be reached in the following ways :
CIS : 100023,2006 (preferred.)
BIX : lkretzschmar
Fax : +49 89 8204270
Tel : +49 89 8204250
Mail : Name : SoftTronics // Pop by if you're ever
Street : Fritz-Reuter-Str. 20B // in Europe !
City : 8000 Munich 60
Country : Germany
------------------------------------------------------------------------------
Technical Stuff:
----------------
CRNDR was written in Turbo Pascal V6.0 and makes heavy use of the
object-oriented extensions. All source code, except the color reduction
algorithm, is self-written.
Precalc'd data
--------------
The precalculated data in the TRACE.PRE file contains the cosI, cosS and
objnum parameters for all pixels. The cosI and cosS factors are integers,
i.e. the real values multiplied by 32767.
Menu system
-----------
I've implemented a display-size independent menu system, which, as a nice
side effect also let's you customize it to suit your needs.
The CRNDR.CFG file should be modified with care. Some things can be
changed, e.g. you can re-arrange the sliders, re-order them, give
them different labels or resize and move them, but beware! I cannot
guarantee that it will still work. Especially, don't change the first
number on the line, since CRNDR.EXE expects these numbers and no others!.
If you remove, or comment out lines you will not be able to change the
value of the corresponding parameter, although the program will still
run OK. Before commenting out a slider though, make sure you've set it to
the value you want it to have.
[ 9 ]
To help you modify the menu system, I'll explain the format of the
button lines :
SLIDER key (x1,y1,x2,y2) min max prw prd lbl
TEXT key (x1,y1,x2,y2) jst [ [ hotkey ] txtCol ] lbl
SWITCH key (x1,y1,x2,y2) jst [ [ hotkey ] txtCol ] lbl
LABEL key (x1,y1,x2,y2) jst [ style ] lbl
where :
- SLIDER, TEXT, SWITCH or LABEL specifies the type of button.
- key is the result that's passed to the program to see what button
was pressed. DON'T CHANGE THE KEY VALUE OF ANY BUTTON !
- (x1,y1,x2,y2) specifies the rectangle in 1000ths units. These are then
or scaled by the menu size. An entry of the format
+(dx,dy) specifies that the last rectangle used should be offset
by (dx,dy) and the result used.
- min is the minimum value the slider can take on. (Don't set the
minimum of the Brilliance or PhongSize sliders to 0 !!!!
- max is the maximum value the slider may take on.
- prw is the width of the value display in the slider button.
- prd is the number of decimal places of the value display of the
slider.
- lbl is a string to display { slider: after the number} .
- jst is the horizontal and vertical justification of the label in the
button. At most two letters, at least 1. Possible values are :
B for Bottom-aligned (vertical),
M for Middle-aligned (vertical),
T for Top-aligned (vertical),
L for Left-aligned (horizontal),
C for Center-aligned (horizontal),
R for Right-aligned (horizontal).
- style indicates what sort of label button:
0 means no frame,
1 means a normal button and
2 means a depressed button.
- hotkey is a character to assign as a hotkey. If the first letter is a
'F' then it's a function key and the number follows.
- txtCol is 0 if the text should be black.
Don't make big changes unless you're sure you know what you're doing,
especially not without first making a backup of CRNDR.CFG.
[ 10 ]
CRNDR.CFG Sections
------------------
Section Variable Format Description
------------------------------------------------------------------------------
[SCREEN] Define the screen mode.
MODE 320x200,320x240, S-VGA or VGA mode to use for CRNDR. This
320x400,320x480, version only supports 320x200, 640x480
360x480, and 800x600. The other modes will be
640x480, 800x600 supported in the next version (I hope!).
[LIGHT] Defines the Light Source.
COLOR r g b RGB Color of Light source. R,G and B
must be in the range 0..255.
[SETTINGS] Various settings that affect CRNDR.
TRANSMIT FLOAT | FLAG Determines how CRNDR treats the transmit
Slider. If FLOAT is specified it's a
normal slider. If FLAG is specified it
can only be 0.0 or 1.0.
PRECISION n Specifies how many decimal places should
be written to the output file when
writing floats.
STRDIALOG (rect) Specifies the size of the input box for
file- and texture-names.
[RENDER] This section defines the main menu.
[OPTIONS] This section defines the options popup.
[LINK] This section defines the link popup.
[HELP0] This section defines Help Index screen.
[HELPn] n is a number This section defines Help screen number
n.
[PRECALC] This section defines the scene for
CPRE.EXE to use.
LIGHTPOS x y z Defines the position of light source.
CAMERAPOS x y z Defines the position of camera.
CAMERAAT x y z Defines the point that the camera is
looking at.
CAMERADIR dx dy dz Alternate to CAMERAAT, a vector specify-
ing the direction can be given.
APERTURE n The aperture of the camera in degrees.
ASPECT n The aspect ratio of the image.
Future features and enhancements
--------------------------------
- Support for Tweaked VGA modes.
- I still intend incorporating CMAP into this program.
- Vivid rendering equation.
- I'm still thinking about a Material Library .....
etc. etc.
Anyone else have ideas ? Speak up on CIS:COMART section Raytracing !