home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / raytrace / dbw_render / Docs / Script < prev   
Encoding:
Text File  |  1992-10-24  |  37.2 KB  |  731 lines

  1. ****************************************************************************
  2. *                                                                          *
  3. *                         DBW_Redner Command Script                        *
  4. *                                   Format                                 *
  5. *                                                                          *
  6. ****************************************************************************
  7. *                                                                          *
  8. *           For Distribution with RISC OS versions of DBW_Render           *
  9. *                                                                          *
  10. ****************************************************************************
  11.  
  12.  
  13.  
  14.  Creating a .DAT file
  15.  ~~~~~~~~~~~~~~~~~~~
  16.  
  17. A command script file for DBW_Render is an !Edit file consisting of a number
  18. of commands. Each command takes one line. The commands available are as
  19. follows:
  20.  
  21. R    Set resolution (optional - default is 12.0 hours).
  22. N    Global index of refraction (optional, default = 1.0).
  23. Z    Produce 2D histogram rather than image (default is image).
  24. a    Overriding ambient proportion factor (default not overridden).
  25. A    Set antialiasing parameters (default no antialiasing).
  26. F    Lens focus and aperture for depth of field (default infinite) 
  27. M    Set global diffuse lighting parameters (default off).
  28. &    Define scan-line region of image to generate.
  29. *,!  comment, ignored.
  30. b    Set background color.
  31. w    Define a wave source.
  32. g    Define a color blend texture.
  33. n    Define a snowfall texture.
  34. k    Define a 3D checkerboard texture.
  35. H    Set global haze parameters (default no haze).
  36. f    Define fractal surface parameters.
  37. m    Define a marble texture.
  38. d    Define a wood texture.
  39. p    Define a pebbly texture.
  40. e    Set the eye (camera) view parameters.
  41. l    (lower case 'L') Define a directional light source.
  42. L    Define a spherical light source.
  43. {    Start an extent.
  44. }    Terminate an extent.
  45. s    Specify a spherical object.
  46. t    Specify a planar triangular object.
  47. x    Specify a fractal triangular object.
  48. q    Specify a planar parallelogram object.
  49. r    Specify a planar ring (annular) object.
  50.  
  51. All color values consist of three numbers that range from 0 to 1.  
  52. The color components are specified BLUE, GREEN, RED.
  53.  
  54. All position/direction values are three numbers ranging in whatever 
  55. numbering system you want.  The numbers are X, Y, Z order.  Assuming 
  56. you are looking into the screen in the negative Z direction, 
  57. positive X is to the right, positive Y is up, and positive Z is out 
  58. from the screen.
  59.  
  60. Okay, on to the specifics of the parameters that each command 
  61. character requires.  First are listed all the general 
  62. (environmental) commands, then are listed the commands that create 
  63. objects to be rendered in the scene.
  64.  
  65.  
  66.                Global index of refraction (optional, default = 1.0)
  67. N INDEX
  68.      This single value is taken to be the index of refraction of 
  69.      "the air", or put another way of the space between and outside 
  70.      of all objects.
  71.  
  72.  
  73.                Set resolution (optional, default = 12.0 hours)
  74. R RESOLUTION
  75.      The RESOLUTION value controls the MAXIMUM amount of time that a 
  76.      full screen (400 scanlines) is allowed to take. This number 
  77.      should typically be between 1.0 and 30.0 hours. The more time 
  78.      you give the program the better the picture will be that you 
  79.      get.
  80.  
  81.  
  82.                Produce 2D histogram, rather than true image
  83. Z FLAG
  84.      Normally, the contents of the .TMP file that the ray tracer 
  85.      produces is a binary pixel version of the described scene.  
  86.      However, for the purposes of doing performance tuning of an 
  87.      antialiased scene, you can include the command "Z 1" in the 
  88.      script file.  If done, the image file that the ray tracer 
  89.      generates will not be the color scene that it normally is, but 
  90.      instead will be a sort of 2D histogram of how much computation 
  91.      each pixel in the scene consumed, displayed as a gray scale 
  92.      (the brighter the pixel, the more computation).  Note that this 
  93.      command is only meaningful if non-default values for the "A" 
  94.      command have been used.  By default, basically an equal amount 
  95.      of time is spent on each pixel, (thus an image with Z set to 1 
  96.      would come out a flat gray) but the "A" command tells the ray 
  97.      tracer to concentrate on certain types of details in the scene 
  98.      to produce alias-free images.  Using the Z command with a 
  99.      parameter of 1 will allow you to see just where the ray tracer 
  100.      decided to spend more time, smoothing edges, etc.
  101.  
  102.  
  103.                Set overriding ambient proportion factor
  104. a FACTOR
  105.      As described below, each object in the scene contains 
  106.      parameters that control how bright the object appears if no 
  107.      light is shining on it.  Thus you can set some objects to 
  108.      appear brigher when in shadow that other objects.  As an 
  109.      alternative, you can specify the "a" command with a parameter 
  110.      from 0 to 1, and this will cause the ambient color of all 
  111.      objects in the scene to be a fraction of their diffuse 
  112.      brightness.  When the "a" command is used, the BGR ambient 
  113.      values for each object are ignored (but they must still be 
  114.      specified).  A reasonable starting point would be to set FACTOR 
  115.      from between .1 and .2.
  116.  
  117.                Set antialiasing parameters
  118. A COUNT THRESHHOLD
  119.      By default, the ray tracer computes one ray into the scene for 
  120.      each pixel in the image (so a 320X200 image computes 64000 
  121.      rays).  Quite often, some unpleasant side effects of the 
  122.      digital generation process become apparent in a scene generated 
  123.      with one ray per pixel, for example diagonal lines are rendered 
  124.      as a sequence of discrete stairsteps -- the dreaded jaggies.  
  125.      Such false features are called aliasing defects.  There are 
  126.      numerous techniques devised to try to reduce the magnitude of 
  127.      these defects, collectively referred to as the process of anti-
  128.      aliasing.  (There are many other types of aliasing defects 
  129.      besides jaggies.  An example of another "defect" is the razor-
  130.      sharp shadows that are traditionally found in computer 
  131.      generated imagery -- real-world shadows are always at least a 
  132.      teensy bit diffuse.)
  133.  
  134.      The COUNT parameter determines how many rays will be traced for 
  135.      each pixel in the scene -- the more, the better, but the slower 
  136.      the computing.  A good starting value is 4.  What happens is 
  137.      that a bunch of rays (e.g. 4) are sent into the pixel cone at 
  138.      random -- they are "distributed" across the horizontal and 
  139.      vertical dimensions.  Thus, this ray tracer is said to 
  140.      implement Distributed Ray Tracing.
  141.  
  142.      The THRESHHOLD value relates to a rather complicated feature in 
  143.      the ray tracer called Statistically Optimized Distributed Ray 
  144.      Tracing.  The way this works is that the program computes the 
  145.      intensities of the bunch of rays that are distributed into the 
  146.      pixel.  In this example, say there are four rays in the bunch.  
  147.      The program computes the statistical variance of the four 
  148.      resulting intensities.  If the variance is small, the odds are 
  149.      that the portion of the scene being imaged is a smooth patch.  
  150.      Thus a good approximation to the ideal intensity of that pixel 
  151.      has been computed.  But let's say that the pixel happens to 
  152.      fall on a diagonal edge.  Some of the distributed rays will be 
  153.      cast to one side of the edge, and some of them to the other.  
  154.      Thus the variance will be high.  The program looks at this, and 
  155.      if the variance is past the THRESHHOLD value, will distribute 
  156.      another group of (in this case) four rays into the pixel.  Then 
  157.      the variance of the eight rays will be examined, and the 
  158.      process repeated until the required smoothness has been reached 
  159.      (or some arbitrarily large number of rays have been cast, and 
  160.      the process halts).  Setting THRESHHOLD to values of 1.0 or 
  161.      higher generally will force no extra groups of rays to be cast, 
  162.      beyond the initial group of COUNT rays.  Meaningfull values of 
  163.      THRESHHOLD generally fall in the .0001 to .1 range.
  164.  
  165.  
  166.                Set lens focus and aperture for depth of field
  167. F APERTURE FOCUS
  168.      This command is optional; if omitted, the scene will be 
  169.      rendered such that all objects will be in perfect focus (a pin-
  170.      hole camera effect).  With this command, you can add depth-of-
  171.      field effects to a scene (though at great computation speed 
  172.      degradation, as described below).  The APERTURE parameter 
  173.      specifies the radius of the hypothetical lens in the camera 
  174.      that is taking the picture of the scene.  FOCUS sets the 
  175.      distance from the camera (or eye) at which objects will appear 
  176.      in perfect focus.  The magnitude of both values depends upon 
  177.      the coordinate system in use by your scene, of course, but here 
  178.      is an example for determining a reasonable camera aperture.  
  179.      Say that one unit of distance represents an inch.  Assume you 
  180.      set the focus distance to 100 inches; with this scale, a 
  181.      reasonable value for aperture is 0.5 to 2.0.
  182.  
  183.      In order to achieve a good quality smooth blurring of the 
  184.      foreground and background, you will need to set the 
  185.      antialiasing parameters up from their defaults (with the A 
  186.      command).  A good start would be 20 to 30 rays per pixel; the 
  187.      THRESHHOLD value doesn't matter much; it could be set to 1.
  188.  
  189.  
  190.                Set global diffuse lighting parameters
  191. M COUNT NUMERATOR DENOMINATOR
  192.      This command relates to the realistic propagation of light as 
  193.      it reflects from object to object in the scene.  Traditionally, 
  194.      computer lighting models operate such that if an object is 
  195.      directly visible from a light source, then the surface of the 
  196.      object is colored according to the material's properties, the 
  197.      color and strength of the light, etc.  For those objects or 
  198.      portions of objects that are not in the path of a light source 
  199.      (aka are in shadow), they are rendered black.  Well, this is 
  200.      usually artificial looking, and so a constant dim color is 
  201.      assigned to areas in shadow.  (In fact, this program has 
  202.      provisions for this as well, the ambient parameters of each 
  203.      object, plus the "a" command.)
  204.  
  205.      But in reality, shadows are filled in with light bounced off 
  206.      walls, etc.  The M command can be employed to model this 
  207.      diffuse propagation of light from object to object.  (Sadly, 
  208.      once again performance suffers significantly if you choose to 
  209.      do this, since a great deal of information about the scene 
  210.      needs to be collected and analyzed to determine how the shadow 
  211.      fill-in should occur.)  How this program does this is to, for 
  212.      each pixel, sample extra rays from the surface being rendered, 
  213.      out into the scene in random directions to see what other 
  214.      nearby surfaces are acting as reflectors, etc.  The COUNT 
  215.      parameter controls how many samples to take per pixel; values 
  216.      from 10 on up are okay, but 100 or more are needed to render 
  217.      smooth color bleeding from surface to surface, etc.  The 
  218.      NUMERATOR and DENOMINATOR derive from the recursive nature of 
  219.      the ray tracing process: in the process of calculating a ray on 
  220.      the surface being rendered, assume the ray strikes an adjacent 
  221.      surface.  Well, from THAT surface, another COUNT set of rays 
  222.      will be sampled, to determine ITS color, etc.; thus the process 
  223.      exponentially generates rays that need to be computed.  To 
  224.      avoid this recursive growth, the number of sample rays that are 
  225.      done per recursion level is scaled from the initial COUNT 
  226.      value, according to the supplied NUMERATOR and DENOMINATOR 
  227.      values.   For example values of 1 and 2 respectively will 
  228.      reduce by half the number of samples taken at each recursion 
  229.      level.  Normally, even this is not a fast enough decay, so 1/3 
  230.      or 1/4 is better, without much noticable loss in resulting 
  231.      color fidelity.  In fact, setting NUMERATOR to 0 is not 
  232.      unreasonable.
  233.  
  234.  
  235.                Define scan-line region of image to generate
  236. & FIRST LAST
  237.      If this command is omitted, the entire image bitmap will be 
  238.      calculated (all 400 scan lines).   This command tells the 
  239.      program only to produce those scans from FIRST to LAST-1 
  240.      inclusive.  Once done, the resulting fragment images can be 
  241.      combined into one whole image file.   In this way, a 
  242.      particularly complex scene may be distributed into a number of 
  243.      CPUs, resulting in shorter elapsed generation time. Picture 
  244.      merging is accomplished by DISPLAY ).
  245.  
  246.  
  247.                Set background color
  248. b BLUE GREEN RED
  249.      The simple color value that will be displayed if no objects are 
  250.      visible at a given point in the scene.
  251.  
  252.  
  253.                Define a wave source
  254. w CENTERX CENTERY CENTERZ  WAVELENGTH AMPLITUDE DAMP PROPAGATE
  255.      A number of features in the program use wave sources as a basis 
  256.      for calculating various effects (most notably the production of 
  257.      rippled surfaces, such as water).  You can define up to 100 
  258.      wave sources per scene.  There is only one "wave source table" 
  259.      stored by the program; all of the features that use waves use 
  260.      the same waves.  The first three values specify the coordinate 
  261.      from which the concentric wave fronts emanate from.  WAVELENGTH 
  262.      sets the crest-to-crest distance for the wave.  The AMPLITUDE 
  263.      value determines, in an abstract manner, the height of the wave 
  264.      at the origin.  The height is not specified in normal distance 
  265.      units; rather it is a fixed scale frational value, in the 
  266.      approximate range of 0.1 (small, flat waves) to 0.5 (strong 
  267.      waves).  The DAMP value controls the damping of successive 
  268.      trains of waves.  The value 1.0 means no damping; the waves 
  269.      will contine out to infinity from the source.  Value 0.7 means 
  270.      that successive crests will be 70% the height of the preceeding 
  271.      crest.  The PROPAGATE value controls what phase the wave starts 
  272.      broadcasting at; the value ranges from 0.0 (starting at a crest 
  273.      at the origin) through 0.5 (180 degrees out of phase -- a 
  274.      trough) and back to 1.0 (a crest).  This can be used in 
  275.      sequenced frames to produce moving waves.
  276.  
  277.  
  278.                Define a color blend texture
  279. g BCOLOR GCOLOR RCOLOR  START RANGE
  280.      Normally, an object is solidly and uniformly colored across its 
  281.      entire surface.  This command lets you define a blend function 
  282.      which can be applied to any object, in such a manner that the 
  283.      color of the object will vary as a function of altitude (Y 
  284.      coordinate).  For example, a sphere could be blue at the south 
  285.      pole, and yellow at the north pole, with the color smoothly 
  286.      changing in the middle.  You can define up to ten blends per 
  287.      scene.  The three COLOR values specify the target color that 
  288.      the surface will blend to with increasing Y coordinate (the 
  289.      initial color of the object at low Y coordinate values is taken 
  290.      from the diffuse coeficients of the object, as defined a ways 
  291.      below in the section on object properties).  The START value 
  292.      defines the low-Y coordinate where blending starts; surface 
  293.      points below this Y level will be colored with the objects 
  294.      diffuse coeficients.  The blending continues from START, 
  295.      continuing for RANGE units upward.  At the level of 
  296.      START+RANGE, the blend would have saturated out at the new 
  297.      COLOR value.  Points above START+RANGE will maintain the new 
  298.      COLOR.  As an example, consider a sphere of radius 100 units 
  299.      positioned at the origin.  If START was set to -33, and RANGE 
  300.      was set to 66, the result would be that the lower third of the 
  301.      sphere would be its base diffuse color; the middle third would 
  302.      gradually change color up until at the +33 level the color 
  303.      would attain the new COLOR; the upper third of the sphere would 
  304.      maintain the new COLOR.
  305.  
  306.  
  307.                Define a snowfall texture
  308. n START ALTITUDERANGE ALTFACTOR THRESHHOLD
  309.      This texture function is similar to the above blend texture.  
  310.      It is still under development.  This is intended to be used 
  311.      with the fratcal surface capabilities described below.  The 
  312.      theory is that this will distribute snow onto an object, the 
  313.      nature of which varies according to the local surface slope and 
  314.      altitude.  START is the lower bound below which there can be no 
  315.      snowfall accumulation, even on level surfaces.  Points on the 
  316.      surface above the level of START+ALTITUDERANGE generally are 
  317.      solidly blanketed with snow.  ALTFACTOR is a scaler that lets 
  318.      you determine how important altitude is in determining snow 
  319.      cover; value 0 means it is irrelevant (thus it is just a 
  320.      function of local surface slope).  Values above 1.0 generally 
  321.      result in a faster buildup of snow at the low end of the 
  322.      ALTITUDERANGE scale.  THRESHHOLD controls when a surface will 
  323.      be solidly blanketed, if it meets the threshhold test.  Values 
  324.      for this parameter range from 0.0 (at which everything from 
  325.      START and above will be solidly coated, regardless of slope) to 
  326.      1.0, where coverage will be a continuous function of slope and 
  327.      altitude.  Values around .4 result in surfaces from about 40 
  328.      degrees of slope and flatter to be solidly covered.
  329.  
  330.                Define a 3D checkerboard texture
  331. k BCOLOR GCOLOR RCOLOR  X Y Z  JUNK1 JUNK2 JUNK3
  332.      You can define up to 10 checker textures per scene.  This 
  333.      texture function determines the color of points on the surface 
  334.      of an object, using a 1- (layer), 2- (checker, column), or 3-
  335.      dimensional (block) model.  As the points on the surface of an 
  336.      object are colored, this texture function can be used to 
  337.      determine whether the color of the point in question is the 
  338.      object's base diffuse color, or is a different specified color 
  339.      (controlled the three COLOR parameters to this command).  To 
  340.      determine whether the surface point is inside or outside which 
  341.      color region, the X Y Z pattern size values are checked.  The X 
  342.      parameter defines the width of successive layers from left to 
  343.      right; Y defines the width of successive layers from top to 
  344.      bottom; Z is for front to back.  Note that one or more X Y or Z 
  345.      values can be set to 0.  This will cancel any variation in the 
  346.      pattern in the corresponding dimention.  For example, if X and 
  347.      Z are set to 10 but Y is 0, the effect will be of square 
  348.      vertical columns of alternating color.  If only Y were non-
  349.      zero, the effect would be of horizontal layers of alternating 
  350.      color.  Setting all three to non-zero creates a solid 3D block 
  351.      pattern.  The width of the layers in X Y and Z need not be the 
  352.      same (so you can make long flat blocks, for example).  JUNK1, 
  353.      JUNK2, and JUNK3 are currently not used and should be set to 0.
  354.  
  355.  
  356.                Set global haze parameters
  357. H BCOLOR GCOLOR RCOLOR  DISTANCE
  358.      If this command is omitted, the color of each pixel in the 
  359.      scene is not affected by how far the rendered surface is from 
  360.      the eyepoint.  By using this haze command, you can cause 
  361.      objects in the distance to be progressively tinted to a 
  362.      specified target haze color (the three COLOR values).  Objects 
  363.      that are DISTANCE units or farther from the eyepoint will be 
  364.      completely tinted or blended to the haze color and thus will 
  365.      become effectively invisible.  Objects closer than this 
  366.      distance will be continuously tinted from their true local 
  367.      color to the haze color, in a linear manner as a function of 
  368.      distance.
  369.  
  370.  
  371.                Define fractal surface parameters
  372. f RECURSIONLEVEL  XSCALE YSCALE ZSCALE  FINALTEXTURE
  373.      This texture can only be applied to 'x' objects as defined 
  374.      below.  The ray tracer so far only knows how to render a small 
  375.      set of primitive object shapes, one of which is the three-sided 
  376.      polygon (triangle).  As described in the 'x' command below, the 
  377.      ray tracer does have the capability to algorithmically generate 
  378.      compound objects that are constructed out of large numbers of 
  379.      adjacent triangles forming what is called a stochastic surface 
  380.      (often thought of as a fractal surface, though in fact the 
  381.      relationship to the mathemacits of fractals is limited).  This 
  382.      command defines parameters that the ray tracer uses in 
  383.      constructing the mesh of triangular surface patches.
  384.  
  385.      You can define up to 10 fractal textures per scene.  In order 
  386.      to define a fractal surface, you must also define at least one 
  387.      wave source with the "w" command (the reason for this 
  388.      apparently unrelated need will be explained).  The general 
  389.      fractal construction procedure is based on recursive triangle 
  390.      subdivision, applying complex coordinate shifts when 
  391.      determining the vertices of the subdivision triangles.  You 
  392.      start with one master triangle that controls the gross size and 
  393.      orientation of the final surface.  The original triangle is 
  394.      split into four triangles (by bisecting the three sides and 
  395.      connecting the midpoints).  The corners of the new triangles 
  396.      are then shifted in space, and they are recursively subdivided 
  397.      in turn, to the desired level.  The RECUSIONLEVEL sets this 
  398.      depth; the higher the depth, the finer the resulting surface, 
  399.      but the slower the image will take to compute (on the order of 
  400.      four times with each successive level).  Plus larger level 
  401.      values require substantial quantities of address space to 
  402.      contain the generated triangle data (on the order of thousands 
  403.      of 512-byte memory pages for a level of 7, for example... so BE 
  404.      CAREFUL!).
  405.  
  406.      The X Y and ZSCALE values allow you to emphasize distortion 
  407.      differenly in the three dimensions (X and Z of 1.0, with Y of 
  408.      3.0 results in three times as much vertical relief as 
  409.      horizontal, for example).  Values of 0 for a scale parameter 
  410.      cause the sub-triangles to not move in the indicated dimension 
  411.      (X and Z of 0 will make the resulting surface maintain a 
  412.      triangular silhouette as seen from above).
  413.  
  414.      The FINALTEXTURE value will be assigned as the texture function 
  415.      number for each of the sub-triangles (see the description of 
  416.      texture function values for objects below).  Basically, this 
  417.      allows you to apply a uniform texture to the entire fractal 
  418.      object: a smooth color gradiation, a checkerboard, etc.
  419.  
  420.      As mentioned above, to get a good rough fractal surface, you 
  421.      need to also define a small number of wave sources.  A good 
  422.      starting point is to specify five or six wave sources, whose 
  423.      actual XYZ coordinates are scattered about the scene.  Giving 
  424.      them different wavelenghts and amplitudes will increase the 
  425.      fluctuation in the surface.  Generally, the damping should be 
  426.      small (values of or near 1.0).  The actual manner in which the 
  427.      waves are utilized in constructing the sub triangle vertices is 
  428.      beyond convenient description; suffice it to say that there is 
  429.      NO randomness involved, and that different wave patters will 
  430.      produce markedly different fractal surfaces.  Experiment.
  431.  
  432.  
  433.                Define a marble texture
  434. m BVEINCOLOR GVEINCOLOR RVEINCOLOR XSCALE TURBULENCE SQUEEZE
  435.      You can define up to ten marble textures per scene.  This 
  436.      texture relies on your having defined at least one wave source, 
  437.      for reasons described below.
  438.      The marble is modelled as a base substance that has intrusions 
  439.      of a second substance into the base.  The base color is 
  440.      determined by the diffuse coefficients for the object.  The 
  441.      intrusion color is specified in the three VEINCOLOR parameters.  
  442.      The actual color for the surface of the marble object is a 
  443.      complex blending function of the two starting colors.
  444.  
  445.      The basic formula for making the intrusions (veins) is to start 
  446.      with equally spaced vertical layers (spaced along the X axis).  
  447.      The spacing is determined by the XSCALE parameter (good values 
  448.      are from 0.1 to 1).  Then turbulence is applied to the layers, 
  449.      deforming them into myriad whorls and streaks, etc.  The amount 
  450.      of turbulence is set by the TURBULENCE parameter (values from 
  451.      1.0 to 3.0 are nice).  The rough thickness of the streaks is 
  452.      determined by the SQUEEZE parameter (which must be an integer -
  453.      - no fractional component).  The value 1 means leave them 
  454.      normal width; 2 means twice as thin; 3 means four times as 
  455.      thin; 4 means eight times, etc.  Another way to think of 
  456.      SQUEEZE is that it affects how fast the blending occurs from 
  457.      the base to the vein color.
  458.  
  459.      The turbulence is controlled by (of all things) the wave 
  460.      sources that you have defined in the scene.  Unfortunately, the 
  461.      correspondence between a particular wave source and a 
  462.      particular turbulent result is almost impossible to predict 
  463.      (but it IS possible; there is no randomness involved).  All 
  464.      that can really be done is to give guidelines for general wave 
  465.      parameter values.  First, four or five wave sources are needed.  
  466.      The wave centers should be well distributed around the scene.  
  467.      The wavelengths should vary amongst the source a good amount 
  468.      (some should be five or six times the wavelength of other 
  469.      sources).  Not much damping should be applied (values from 1.0 
  470.      down to 0.95 perhaps).
  471.  
  472.  
  473.                Define a wood texture
  474. d BCOLOR GCOLOR RCOLOR THICKSCALE RINGSCALE TURBULENCE SQUEEZE
  475.      You can define up to ten wood textures per scene.  This texture 
  476.      relies on your having defined at least one wave source, just 
  477.      like for the marble textures listed above.  In fact, at this 
  478.      time wood is modelled very similarly to marble, except that 
  479.      where marble consists of parallel layers of base material, wood 
  480.      consists of concentric cylinders of base material (aligned 
  481.      along the Y axis).  The RINGSCALE parameter is analogous to 
  482.      XSCALE for marble; TURBULENCE and SQUEEZE are the same.  
  483.      THICKSCALE basically controls how faint or strong the grain is 
  484.      rendered; values above 1.0 enhance the grain; values less than 
  485.      1.0 subdue the grain.
  486.  
  487.  
  488.      Define a pebbly texture
  489. p SCALE ZOOM
  490.      This texture is similar to the snowfall texture. It is still under
  491.      development. This is intended to allow pertubations of an object
  492.      surface based on random "zooming" of each point on the surface
  493.      (times the "scale"). Typical input values are: "p 1.0 0.5".
  494.  
  495.  
  496.                Set the eye (camera) view parameters
  497. e XPOS YPOS ZPOS  XVIEW YVIEW ZVIEW  XUP YUP ZUP
  498.      First triple sets the position of the eyepoint.  Second triple 
  499.      defines the direction (relative to that point) that the eye 
  500.      will look along to define what is visible.  The length of this 
  501.      vector determines the "wide-andle vs. telephoto" effect.  To 
  502.      guage what different lengths mean, at the tip of the VIEW 
  503.      vector the screen is projected as if it were 256 units 
  504.      horizontally by 170 units vertically.  Thus the magnitude of 
  505.      the numbers you choose for XYZ points interact with the view 
  506.      vector length to determine the cone of visibility.  The third 
  507.      triple is the direction you want to be "up"; usually 0 1 0 is 
  508.      what you want.
  509.  
  510.  
  511.                Define a directional light source
  512. l BLUE GREEN RED  XDIR YDIR ZDIR
  513.      The first triple is the color and intesity of the light (1 1 1 
  514.      would be bright white; 0.5 0 0.5 would be dim magenta).  The 
  515.      second triple is the direction from which the light is comming.  
  516.      For example 1 0 0 would mean the light is comming in straight 
  517.      along the X axis (from positive to negative).  You can have at 
  518.      most 100 light sources per scene (many light sources sloooows 
  519.      things down -- two is reasonable!).
  520.  
  521.  
  522.                Define a spherical light source
  523. l BLUE GREEN RED  XCENTER YCENTER ZCENTER  DISTANCESCALE  RADIUS
  524.      The first triple is the color and base intensity of the light, 
  525.      just as for directional light sources.  The second triple is 
  526.      the XYZ coordionate of the center of the spherical light 
  527.      source; it can be anywhere inside or outside of the visible 
  528.      scene.  (Note that if the center is within the scene, it is not 
  529.      a visible object per-se.  For example, if you wanted a 
  530.      lightbulb, you would place the spherical light source where you 
  531.      wanted it, and also place a transparent sphere at the same 
  532.      coordinates and with the same radius.)  The DISTANCESCALE 
  533.      relates to the inverse-square law with which the brightness of 
  534.      the light diminishes within the scene.  To explain how to set a 
  535.      value for DISTSCALE, consider the following example. Say you 
  536.      wanted a full-intensity white lightbulb (i.e. its nominal BGR 
  537.      values would be 1 1 1) to shine onto a table.  If the table 
  538.      were, say, 37 units of distance from the light coordinate, then 
  539.      you'd want to set DISTSCALE to 37 in order that the table would 
  540.      be fully illuminated.  Thus, objects closer to the light that 
  541.      37 would appear very bright (indeed, probably "overexposed") 
  542.      while objects farther than 37 units from the light would become 
  543.      increasingly dimly lit.  RADIUS is the radius of the light 
  544.      emitting sphere; 0.0 would be a point light source.  (Note that 
  545.      point light sources are faster to compute.)  Also note that 
  546.      non-zero radius light sources cast penumbral shadows, though to 
  547.      be effective you will need to increase the antialias parameters 
  548.      defined by the "A" command.
  549.  
  550. Now for the actual objects that compose a scene.  You can have about 
  551. thousand object (max) per scene.  All objects have the same basic 
  552. properties available to them.  Specifically, the first portion of 
  553. the command line for any object starts with:
  554.  
  555.  
  556. @ TEX FUZZ MIRROR IDX  TRA_B TRA_G TRA_R  
  557.                     AMB_B AMB_G AMB_R  DIF_B DIF_G DIF_R
  558.  
  559.      "@" is the object command character (s,q,x,t,r).
  560.  
  561.      TEX is an integer value that specified what texture function 
  562.      should be applied to this object.  Value 0 means no texture 
  563.      (plain, boring evenly colored flat surface).  Positive values 
  564.      select from among the supported texture functions, as follows:
  565.  
  566.      Value          Texture function
  567.      -----          ----------------
  568.  
  569.        1:      Y axis color gradiation
  570.                Compute the color at each point on the surface as a 
  571.                function of the point's Y coordinate.  Starting at 
  572.                Y=0, the color belnds from red to blue to green and 
  573.                back to red at Y=20. The colors repeat every 20 units 
  574.                in Y.
  575.  
  576.       3:       Mottled diffuse
  577.                The brightness of the surface of the object varies to 
  578.                form a mottled pattern.  This texture requires some 
  579.                wave sources to be defined.
  580.  
  581.       4:       Wavy surface
  582.                The surface will be rendered as being criss-crossed 
  583.                by overlapping waves.  If reflectivity is turned on 
  584.                for the object, the reflections will be rippled, etc.
  585.  
  586.       5:       Brick pattern
  587.                The object will be rendered as if it were carved out 
  588.                of bricks.  The brick size is currently hardwired to 
  589.                be height=3.0, width=8.0, depth=4.0, mortar 
  590.                thickness=0.5.  The color of the bricks is determined 
  591.                by the diffuse coefficients for the object; the color 
  592.                of the mortar is hardwired at BLUE=0.8, GREEN=0.85, 
  593.                RED=0.99.  The bricks are aligned with the coordinate 
  594.                system.
  595.  
  596.       10..19:  Single Wave
  597.                This is like texture 4, except that the surface is 
  598.                rippled by only one wave (rather than all of them 
  599.                with texture 4).  Texture 10 means use the first 
  600.                wave, texture 11 means use the second wave, etc. up 
  601.                to 19 for the tenth wave.  
  602.  
  603.  
  604.       20..29:  Marble
  605.                Render the object as if it were carved out of marble.  
  606.                The marble texture chosen depends on the texture 
  607.                number: texture 20 uses the first marble defined, 
  608.                texture 21 uses the second marble defined, etc.
  609.  
  610.       40..49:   Wood
  611.                Render the object as if it were carved out of wood.  
  612.                The wood texture chosen depends on the texture 
  613.                number: texture 20 uses the first wood defined, 
  614.                texture 21 uses the second wood defined, etc.
  615.  
  616.       50..59:   Checkered
  617.                Color the surface of the object according the the 
  618.                chosen checkerboard texture.  Texture 50 uses the 
  619.                first defined checker pattern, etc.
  620.  
  621.       60..69:   Fractal
  622.                This isn't a texture per se (in so far as most other 
  623.                textures operate by changing the color of surface 
  624.                points of the object).  This texture determines what 
  625.                fractal surface contours should be applied to this 
  626.                object.  This texture type may only be specified for 
  627.                object type X (fractal objects).  Texture 60 uses the 
  628.                first defined fractal type, etc.
  629.  
  630.       70..79:  Smooth blend
  631.                Render the surface of the object as a blend between 
  632.                the objects normal diffuse color, and the specified 
  633.                blend texture color.  Texture 70 uses the first 
  634.                defined blend texture, etc.
  635.  
  636.       80..89:   Snow
  637.                Color the surface of the object by applying the 
  638.                chosen snowfall texture.  Texture 80 uses the first 
  639.                defined snow texture, etc.
  640.  
  641.       90..99:   Pebble
  642.                Perturb the surface via a previously defined pebble 
  643.                texture.  Texture 90 uses the first defined pebble 
  644.                texture, etc.
  645.  
  646.  
  647.      FUZZ is a pseudo-texture factor 0 to 1 that applies a random 
  648.      fuzz to the surface of the object.  This can be used in a 
  649.      number of ways: to model soft surfaces like tennis balls; to 
  650.      form imperfectly reflecting mirrors, to form translucent 
  651.      (etched) glass, etc.
  652.  
  653.      MIRROR is a 0 to 1 value where 0 means no specular and mirror 
  654.      reflection, and 1 means 100% specular & mirror reflection.
  655.  
  656.      IDX is the index of refraction for the object.  This is only 
  657.      relevant if the transparency for the object is non-zero.
  658.  
  659.      TRA_B, _G, _R is the transparency of the object in each color 
  660.      band.  0 means opaque, 1 means 100% transparent.
  661.  
  662.      AMB_B, _G, _R is the ambient light value for the object, 0 to 
  663.      1.  0 means no pseudo-ambient light, 1 means VERY strong 
  664.      ambient light (generally not useful so strong -- washes the 
  665.      object out).
  666.  
  667.      DIF_B, _G, _R is the diffuse reflection values 0 to 1 for the 
  668.      object in the color bands.  For example, glass has virtually 
  669.      zero diffuse reflection, while chaulk has very high (near 1) 
  670.      diffuse reflection.  The diffuse coefficients determine the 
  671.      color of the object (in conjunction with the color of the light 
  672.      sources).
  673.  
  674. From the above, notice that non-rational objects can be created.  
  675. For example, a ball that is 100% transparent AND 100% reflective.
  676.  
  677. Now onto each object.  The parameters below FOLLOW (appear to the 
  678. right of) all of the above property parameters.
  679.  
  680.  
  681.                Sphere
  682. s CENTERX CENTERY CENTERZ  RADIUS
  683.      Self-explanetory.
  684.  
  685.  
  686.                Parallelogram
  687. q POSX POSY POSZ  VE_X VE_Y VE_Z  VP_X VP_Y VP_Z
  688.      The position triple defines a corner of the parallelogram.  The 
  689.      second and third triple are two vectors that define the two 
  690.      sides of the object adjacent to and relative to the defining 
  691.      point.  Here's the hard part: the order of the two vectors 
  692.      matters.  To try to put it simply, the VE vector is the one on 
  693.      the left when viewed from "above," and the VP vector is the one 
  694.      on the right.  In another way, the VP vector is clockwise from 
  695.      the VE vector.  If the two vectors are reversed, the object 
  696.      will appear invisble.  So you may have to experiment by 
  697.      reversing them.  Note that the two vectors do not have to be 
  698.      orthogonal.
  699.  
  700.  
  701.                Triangle
  702. t POSX POSY POSZ  VE_X VE_Y VE_Z  VP_X VP_Y VP_Z
  703.      Same as for a parallelegram, except that the VE, VP vectors 
  704.      define the two sides of the triangle.
  705.  
  706.  
  707.                Fractal
  708. x POSX POSY POSZ  POS1X POS1Y POS1Z  POS2X POS2Y POS2Z
  709.      This is very much like a triangle, except that whereas the 
  710.      second and third set of XYZ values for triangles are relative 
  711.      to the base position of the triangle, for a fractal object all 
  712.      three XYZ triples are absolute object space positions.
  713.  
  714.  
  715.                Ring (annullus)
  716. r CENTERX CENTERY CENTERZ VE_X VE_Y VE_Z  VP_X VP_Y VP_Z  MINRAD MAXRAD
  717.      Rings are sort of like parallelograms.  The first triple 
  718.      defines the center of the ring.  The VE and VP triples radiate 
  719.      from that point and define the plane of the ring.  It is 
  720.      undefined as to what happens if the two vectors are not 
  721.      orthogonal.  MINRAD is the inside radius of the ring (which may 
  722.      be zero, forming a disk); MAXRAD is the outside radius of the 
  723.      ring.
  724.  
  725. The { and } command lines may be placed around any arbitrary set of 
  726. object command lines.  This allows DBW_Render to do optimized ray 
  727. tracing by calculating extent spheres around the indicated primitive 
  728. objects and then checking ray intersections with the extent sphere 
  729. rather than one-by-one with all the inner objects.  Extents may be 
  730. nested.
  731.