home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 231.lha / URay_v1.0 / README < prev    next >
Text File  |  1989-04-04  |  8KB  |  227 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *            Copyright (c) 1988, David B. Wecker            *
  4.  *                All Rights Reserved                *
  5.  *                                    *
  6.  * This file is part of DBW_uRAY                    *
  7.  *                                    *
  8.  * DBW_uRAY is distributed in the hope that it will be useful, but    *
  9.  * WITHOUT ANY WARRANTY. No author or distributor accepts        *
  10.  * responsibility to anyone for the consequences of using it or for    *
  11.  * whether it serves any particular purpose or works at all, unless    *
  12.  * he says so in writing. Refer to the DBW_uRAY General Public        *
  13.  * License for full details.                        *
  14.  *                                    *
  15.  * Everyone is granted permission to copy, modify and redistribute    *
  16.  * DBW_uRAY, but only under the conditions described in the        *
  17.  * DBW_uRAY General Public License. A copy of this license is        *
  18.  * supposed to have been given to you along with DBW_uRAY so you    *
  19.  * can know your rights and responsibilities. It should be in a file    *
  20.  * named COPYING. Among other things, the copyright notice and this    *
  21.  * notice must be preserved on all copies.                *
  22.  ************************************************************************
  23.  *                                    *
  24.  * Authors:                                *
  25.  *    DBW - David B. Wecker                        *
  26.  *                                    *
  27.  * Versions:                                *
  28.  *    V1.0 881023 DBW    - First released version            *
  29.  *    V1.1 881110 DBW - Fixed scan coherence code            *
  30.  *    V1.2 881125 DBW - Removed ALL scan coherence code (useless)    *
  31.  *              added "fat" extent boxes            *
  32.  *                                    *
  33.  ************************************************************************/
  34.  
  35. DBW_uRAY (micro raytracer) is a small raytracer developed for my own test
  36. purposes and made available to anyone who wishes to play with ray tracing
  37. algorithms. It runs on several different machines in many different
  38. configurations. It has been tested on:
  39.  
  40.     Amiga 68000/68010/68020 with/without 68881 (using Manx 3.6 compiler)
  41.     Vax   Ultrix and VMS
  42.  
  43. Its features are:
  44.  
  45.     -    VERY good ray tracing algorithm
  46.     -    Automatic oct-tree extent generation for FAST ray tracing
  47.     -    Simple input file format
  48.     -    SMALL easy to read code
  49.     -    very portable
  50.     -    built in advanced features like waves and textures
  51.     -    generates .ILBM files directly
  52.     -    generates .TMP files (compatable with DBW_RENDER v2.0)
  53.     -    easy to extend
  54.     -    progammable aspect ratio and angle of view
  55.     -    single or double precision floating point
  56.     -    automatic (no overhead) sky and ground generation
  57.     -    dithered .ILBM file for much more accurate color reproduction
  58.     -    can generate 24 bit .TMP files ( 16 million colors )
  59.     -    can generate pictures upto 1024 x 1024
  60.  
  61. =================
  62. INPUT FILE FORMAT
  63. =================
  64.  
  65. See URAY.DAT for a sample input file. The options are:
  66.  
  67.     DEPTH   - Maximum recursion depth
  68.     COLS    - columns in the picture
  69.     ROWS    - rows in the picture
  70.     START   - row to start raytracing at
  71.     END        - row to end with
  72.     BPP        - Bits/Pixel in the .tmp file (24,12 or 0 (== no .tmp file wanted))
  73.     AOV        - angle of view (in degrees) <<<<YOUR EYE IS ALWAYS AT 0,0,0>>>>   
  74.     ASPECT  - aspect ratio (For Amiga use .544)
  75.     NEAR    - ambient (background color for "sky" near the eye)
  76.     FAR        - ambient (background color for "sky" far from the eye (horizon))
  77.     GROUND  - ambient (background color below the horizon (y < 0))
  78.     BASE    - minimum diffuse lighting for any object (blackness of shadows)
  79.  
  80. The background is made up of three colors:
  81.  
  82.     NEAR    - the sky overhead
  83.     FAR        - the sky at the horizon
  84.     GROUND  - the ground color
  85.  
  86. Wave sources are listed with a "WAVES" statement. Parameters are:
  87.  
  88.     WAVES n    - n is the number of lines that follow. Each line has 6 numbers:
  89.     x y z    - center of the wave
  90.     amp    - initial amplitude of the wave
  91.     phase    - initial phase shift
  92.     length    - wavelength
  93.     damp    - damping from wave to wave
  94.  
  95. Attributes are listed with an "ATTRIBUTES" statement. Parameters are:
  96.  
  97.     ATTRIBUTES n    - n is the number of lines containing:
  98.     r g b    - base diffuse color
  99.     Kd    - amount of diffuse coloring
  100.     Ks    - specular factor (reflection)
  101.     Kt    - transmission factor (transparency)
  102.     Ir    - index of refraction (for Kt) 1.0 = none
  103.     Kl    - self lighting factor (light source)
  104.     dist    - inverse square law distance (0 = no inv sq law)
  105.     Kf    - fuzz factor (0 = none 1 = max)
  106.     Wave    - wave number (starts at 0) or -1 = no waves -2 = all waves
  107.     tex    - texture:
  108.         0            - none
  109.         1 r g b x y z   - checker in color (r g b) at scale (x y z)
  110.         2 r g b        - random mottled (alternate color = r g b)
  111.         3 r g b a b c   - X axis blend (alt = r g b, X range= a - b - c)
  112.         4 r g b a b c   - Y axis blend (alt = r g b, Y range= a - b - c)
  113.         5 r g b a b c   - Z axis blend (alt = r g b, Z range= a - b - c)
  114.  
  115. Note: When refering to waves or attributes the first one defined is number 0
  116.       the next is number 1 and so forth.
  117.  
  118. Finally objects:
  119.  
  120.     SPHERE a x y z r        - Do a sphere with attribute a (>= 0)
  121.                   Center at (x y z) with radius r
  122.     QUAD a x y z i j k l m n    - Do a rectangle with attribute a (>= 0)
  123.                   Corners at (x y z), (x+i y+j z+k), and
  124.                     (x+l y+m z+n)
  125.     TRIANGLE a x y z i j k l m n- Do a triangle with attribute a (>= 0)
  126.                   Corners at (x y z), (x+i y+j z+k), and
  127.                     (x+l y+m z+n)
  128.     RING a x y z i j k l m n b c- Do a ring with attribute a (>= 0)
  129.                   Corners at (x y z), (x+i y+j z+k), and
  130.                     (x+l y+m z+n) inner radius b and outer
  131.                     radius c
  132.  
  133. ===================
  134. RUNNING THE PROGRAM
  135. ===================
  136.  
  137. If you have an input file called input.dat then just type:
  138.  
  139.     uray input
  140.  
  141. and the program will run giving output like the following:
  142.  
  143.     uRAY v1.2 881125 (C) 1988 D. Wecker - all rights reserved
  144.     Creating objects
  145.  
  146.     Input file name:          input
  147.     Maximum recursion depth:     20
  148.     Dimensions:                 200 rows (0,200)  160 columns
  149.     Bits/Pixel:                  24
  150.     Angle of view:               60 degrees
  151.     Aspect ratio:             0.544
  152.     Number of attributes:         6
  153.     Number of waves:              1
  154.  
  155.     Creating object extents
  156.     Creating extent tree
  157.     Using 2 extents for 2 objects
  158.  
  159.  
  160.     Extent setup time:         0.17
  161.  
  162.     Row    0: ..................................................
  163.     Row   50: ..................................................
  164.     Row  100: ..................................................
  165.     Row  150: .................................................
  166.  
  167.  
  168.     Total  run   time:       115.40
  169.  
  170.     False hits: Extents =      60215, Nodes =       5077
  171.     Good  hits: Extents =       6829, Nodes =       1752
  172.     Total hits: Extents =      67044, Nodes =       6829
  173.  
  174. To display the file on the Amiga, just say:
  175.  
  176.     display input
  177.  
  178. Type a <CR> to exit the display.
  179.  
  180. =====
  181. FILES
  182. =====
  183.  
  184.     README        - This file
  185.     COPYING        - License agreement
  186.     Makefile        - rebuild control (see later section)
  187.     Make.version    - retitle source files
  188.  
  189.     display.c        - ILBM display program for the Amiga
  190.  
  191.     extent.c        - automatic oct-tree extent generator
  192.     intersect.c        - ray intersection calculations
  193.     output.c        - output file generation (.ILBM and .TMP)
  194.     random.c        - random number generator
  195.     rkm.c        - RKM compression routines (for .ILBM files)
  196.     support.c        - file input and support routines
  197.     texture.c        - texture calculations
  198.     trace.c        - actual ray tracing code
  199.     uray.c        - main module
  200.     uray.h        - global definitions
  201.     uray.dat        - sample input file
  202.  
  203.     uray.ux        - compiled Ultrix version
  204.     uray.sp        - compiled Amiga single precision version
  205.     uray.dp        - compiled Amiga double precision version
  206.     uray.81        - compiled Amiga double precision 68881 version
  207.     uray.2s        - compiled Amiga 68020/single precision version
  208.     uray.2d        - compiled Amiga 68020/double precision version
  209.     uray.21        - compiled Amiga 68020/68881 double precision version
  210.     display        - compiled Amiga display program
  211.  
  212. Rename the "uray.??" file that you wish to use to "uray".
  213.  
  214. ========
  215. MAKEFILE
  216. ========
  217.  
  218. For the Amiga, uncomment the appropriate definitins of FFLG, DBL and MLIB for
  219. the type of processor/coprocessor and precision you want. Also uncomment the
  220. "Standard flags" for the type of machine that you're on. Then:
  221.  
  222.     make uray display
  223.  
  224. will re-make the ray-tracer and the display programs. See the Makefile for
  225. further details.
  226.  
  227.