home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / GRAPHICS / MISC / PVPRO.ZIP / PVRAY05.DOC < prev   
Encoding:
Text File  |  1991-09-07  |  16.1 KB  |  449 lines

  1.    Persistence of Vision Raytracer 
  2.    Version 0.5 BETA Documentation
  3. -----------------------------------------
  4.  
  5.  For general documentation see PVDOC.ZIP.
  6. Also see whatsnew.txt, texture.doc, docformt.txt, pvinfo.txt, etc.
  7.  
  8. This is a BETA version, so please keep those bug reports comin'! 
  9.  
  10.  INTERPOLATE keyword added for bump and image maps.
  11.  Syntax: interpolate 2 or interpolate 4
  12.          2 == Bilinear Interpolation
  13.          4 == Normalized Distance Interpolation
  14.  USE_COLOUR keyword added for maps.
  15.  USE_INDEX keyowrd added for maps.
  16.  END_MAP keyword added for maps.
  17.  
  18.  IMPORTANT Case sensitivity 
  19.  --------------------------
  20.   Case sensitive keywords and command line option added.
  21.    > case_sensitive_yes -- All words checked for exact case. Keywords must be
  22.                            in upper case. (*Old DKB Style*)
  23.    > case_sensitive_no  -- Case is ignored for all words.
  24.    > case_sensitive_opt -- DEFAULT - All words checked for exact case except
  25.                            keywords. Keywords will be accepted in upper and/or
  26.                            lower case. 
  27.  - The declared colors Red, Green, and Blue in colors.dat are now CRed, CBlue,
  28.    CGreen.
  29.  - The declared quadric Sphere in shapes.dat is now QSphere.
  30.  - The texture Sky is now Blue_Sky
  31.  
  32.  COMMAND LINE Options  
  33.  --------------------  
  34.  > Case sensitivity -- /ty = yes, /tn = no, /to = opt (see above)
  35.  
  36.  +vO will enable old style terse verbose, line number only.
  37.  +v0 will enable old new style verbose.
  38.  +v1 (default) will enable new improved style verbose.
  39.  
  40.  
  41.  New IBM-PC display options
  42.  --------------------------
  43.  +dxy enables display adapter type x, with palette option y.
  44.  
  45.    Supported Display Adapter Types:
  46.  
  47.      0 - (default) Autodetect display adapter from types below:
  48.      1 - Basic, Plain Vanilla VGA 320x200
  49.      2 - MVGA (Mode 13X) Tweaked VGA 360x480 (if > 320x200)
  50.      3 - Tseng Labs 3000 SVGA 640x350, 640x480, 800x600
  51.      4 - Tseng Labs 4000 SVGA 640x350, 640x400, 640x480, 800x600, 1024x768
  52.      5 - AT&T VDC600 SVGA 640x400 (with cheesy autodetect)
  53.      6 - Oak Technologies OTI-067 SVGA 640x480
  54.      7 - Video 7 SVGA, VRAM FastRAM 640x480
  55.      8 - Video 7 Vega VGA, Cirrus Chip (uses Mode 1 or 2 above)
  56.      9 - Paradise SVGA 640x480
  57.      A - Ahead Systems Version A SVGA 640x480
  58.      B - Ahead Systems Version B SVGA 640x480
  59.      C - Chips And Technologies SVGA 640x480
  60.      D - ATI VGA Wonder 640x480
  61.      E - Everex SVGA 640x480
  62.      F - Trident SVGA 640x480
  63.      G - VESA Standard SVGA 640x400, 640x480, 800x600, 1024x768, 1280x1024
  64.  
  65.      H - N reserved, unassigned (S)VGA adapter types
  66.  
  67.      O - TIGA/Hercules Graphics Workstation 16-bit
  68.      P - TIGA/Hercules Graphics Workstation 24-bit
  69.  
  70.      Q - Z reserved, unassigned True-Color adapter types
  71.  
  72.    Supported Palette Options:
  73.  
  74.      0 - (default) HSV->RGB method
  75.      3 - 3-3-2 RGB method
  76.      G - Grey Scale (optimized 64-shade palette for IBM PC's)
  77.      H - Sierra High Color pallete DAC
  78.  
  79.  
  80. TEXTURES
  81. -------- 
  82.  
  83. We don't have documentation for ONION & LEOPARD yet, but their syntax
  84. is the same as GRANITE or MARBLE. They do require a COLOR_MAP.
  85.  
  86.  
  87. IMAGEMAP - new stuff is a set of new image projection types.  To specify an
  88. imagemap, an additional parameter is optional, i.e.
  89.  
  90.    IMAGEMAP MAPTYPE 1 GIF "xxx.gif" END_MAP
  91.  
  92. Gives a spherical image map.  The types of imagemaps that are now
  93. defined are:
  94.  
  95.    0) (default) Planar map - this is the one that was already there.
  96.    
  97.    1) Spherical map - wraps the image around a sphere.
  98.    2) Cylindrical map - wraps the image around a cylinder (works good for
  99.       hyperboloids, cones, and paraboloids too).
  100.    5) Torus map - wraps the image around a torus.  For this map you need
  101.       to put the major radius of the torus into the first parameter of the
  102.       gradient vector.
  103.  
  104.    3-4) Parabolic and Hyperbolic maps - these are not implemented yet, but
  105.       will be tailored for mapping to the respective types.  The reason for
  106.       having these in addition to the cylindrical types is that these shapes
  107.       deflect differently than a cylinder.    
  108.    
  109.    NOTE: Gradient only effects planar mapping.
  110.  
  111. For all of these image mappers it is assumed that the imagemap will work
  112. in the interval 0 <= Y <= 1.  This means that you need to use the shapes:
  113. QUADRIC Sphere, QUADRIC Cylinder_Y, QUADRIC Hyperbola_Y, etc.  If the default
  114. Planar mapping is used, no object dimensions or coordinates need be changed.
  115.  
  116. See the file "mapper.dat" and the associated gif file "mapper0.gif" for an
  117. example of how the new various types of mappers work.  This file wraps the
  118. picture "rough.gif" around various shapes.
  119.  
  120.  
  121. KEYWORD: MATERIAL_MAP
  122.  
  123. BRIEFLY:
  124.  MATERIAL_MAP maps textures onto an object indexed via a bit-mapped image.
  125.  
  126. SYNTAX:
  127.  MATERIAL_MAP <orientation> Image-Type "imagefilename" (ONCE) (TURBULENCE 0.0)
  128.   TEXTURE ... END_TEXTURE
  129.   TEXTURE ... END_TEXTURE
  130.   (up to 256 textures)  
  131.  
  132.  END_MATERIAL_MAP 
  133.  
  134. DESCRIPTION:
  135.   MATERIAL_MAP is a lot like IMAGE_MAP. Image map takes a picture and 
  136.   projects it onto an image. Like gluing a picture onto a sphere. Material
  137.   map does the same, but instead of changing the color of the sphere it 
  138.   actually changes the texture of the sphere based on the color in the image.
  139.   When it finds a point that would have color number 0 projected on it, it
  140.   changes that point to the first texture in the MATERIAL_MAP definition. 
  141.   Color index number 1 will become texture number 2 and so on.
  142.  
  143. EXAMPLE:
  144.  OBJECT
  145.    SPHERE <0.0  25.0  0.0>  50.0 END_SPHERE
  146.  
  147.    TEXTURE        { X-Y oriented bitmap image }
  148.     MATERIAL_MAP <1.0 -1.0 0.0> GIF "st.gif" 
  149.     
  150.       TEXTURE 
  151.        COLOR Yellow       
  152.        SPECULAR 0.75
  153.        SCALE <7.0 1.5 3.0> 
  154.       END_TEXTURE
  155.       TEXTURE
  156.        Mirror      
  157.        SPECULAR 0.75
  158.       END_TEXTURE
  159.       TEXTURE
  160.        Dark_Wood
  161.        SPECULAR 0.75
  162.       END_TEXTURE
  163.       TEXTURE
  164.         Jade
  165.         SPECULAR 0.75 
  166.       END_TEXTURE
  167.      
  168.      END_MATERIAL_MAP
  169.      ROTATE <0.0 35.0 0.0>
  170.      SCALE < 15.0 15.0 15.0 >   
  171.    END_TEXTURE
  172. END_OBJECT
  173.  
  174.  
  175. KEYWORD: BUMPMAP
  176.  
  177. BRIEFLY:
  178.  BUMPMAP maps surface "bumps" onto an object indexed via a bit-mapped image.
  179.  
  180. SYNTAX:
  181.  BUMPMAP (<orientation>) Image-Type "imagefilename" (ONCE) (TURBULENCE 0.0)
  182.  (BUMPSIZE Height) (USE_COLOR) (USE_INDEX)
  183.  (INTERPOLATE 2 or 4)
  184.  END_MAP
  185.  
  186. DESCRIPTION:
  187.   BUMPMAP is a lot like IMAGEMAP.  IMAGEMAP takes a picture and projects it
  188.   onto an image, like gluing a picture onto a sphere.  BUMPMAP does the same,
  189.   but instead of changing the color of the sphere it actually changes the
  190.   orientation of the surface normal based on the colors in the image.
  191.   When it finds a point that would have color number 0 projected on it, it
  192.   leaves that point's surface normal alone.  Color index number 1 will become
  193.   "bumped" out from the flat surface, color number 2 further still, and so on.
  194.   Try using one of FRACTINT's continuous potential fractals for interesting
  195.   BUMPMAP effects! BUMPSIZE can be negative. Try USE_COLOUR and INTERPOLATION.
  196.  
  197. EXAMPLE:
  198.  OBJECT
  199.    SPHERE <0.0  25.0  0.0>  50.0 END_SPHERE
  200.  
  201.    TEXTURE        { X-Y oriented bitmap image }
  202.       BUMPMAP <1.0 -1.0 0.0> GIF "bumpy.gif"
  203.       BUMPSIZE 1.0  {typ. between 0 and 1.  Try > 1 for really big bumps }
  204.       INTERPOLATE 2
  205.       END_MAP
  206.       AMBIENT 0.2
  207.       DIFFUSE 0.8
  208.       SPECULAR 1.0
  209.    END_TEXTURE
  210.  
  211.    ROTATE <0.0 35.0 0.0>
  212.    SCALE < 15.0 15.0 15.0 >
  213.    END_TEXTURE
  214. END_OBJECT
  215.  
  216.  
  217. KEYWORD: GOUGEMAP
  218.  
  219. BRIEFLY:
  220.  GOUGEMAP maps indentations into an object indexed via a bit-mapped image.
  221.  
  222. SYNTAX:
  223.  GOUGEMAP <orientation> Image-Type "imagefilename" (ONCE) (TURBULENCE 0.0)
  224.  (GOUGESIZE or BUMPSIZE Depth )
  225.  END_MAP
  226.  
  227. DESCRIPTION:
  228.   GOUGEMAP is a lot like IMAGEMAP.  IMAGEMAP takes a picture and projects it
  229.   onto an image, like gluing a picture onto a sphere.  GOUGEMAP does the same,
  230.   but instead of changing the color of the sphere it actually changes the
  231.   orientation of the surface normal based on the colors in the image.
  232.   When it finds a point that would have color number 0 projected on it, it
  233.   leaves that point's surface normal alone.  Color index number 1 will become
  234.   indented from the flat surface, color number 2 further still, and so on.
  235.  
  236. EXAMPLE:
  237.  OBJECT
  238.    SPHERE <0.0  25.0  0.0>  50.0 END_SPHERE
  239.  
  240.    TEXTURE        { X-Y oriented bitmap image }
  241.       GOUGEMAP <1.0 -1.0 0.0> GIF "scratchy.gif"
  242.       GOUGESIZE 1.0  {typ. between 0 and 1.  Try > 1 for really deep gouges }
  243.       AMBIENT 0.3
  244.       DIFFUSE 0.7
  245.       PHONG 1.0
  246.    END_TEXTURE
  247.  
  248.    ROTATE <0.0 35.0 0.0>
  249.    SCALE < 15.0 15.0 15.0 >
  250.    END_TEXTURE
  251. END_OBJECT
  252.  
  253.  
  254.  
  255. POLYNOMIAL SURFACES
  256. -------------------
  257.  
  258. Polynomials of arbitrary degree are handled by one of the following
  259. declarations:
  260.  
  261.    CUBIC < 10 Coefficients > END_CUBIC,
  262.  
  263.    QUARTIC < 35 Coefficients > END_QUARTIC,
  264.  
  265.    POLY < Max-Degree > < (n+1)*(n+2)*(n+3)/6 Coefficients > END_POLY
  266.  
  267. Quartics are the only case handled as a seperate case, with code to solve
  268. them specifically.  Higher order polynomial surfaces are solved using
  269. Sturmian sequences.  (The root solver is based on code from "Graphics Gems"
  270. by Glassner, and is not debugged.  Use at your own risk for surfaces of
  271. degree higher than 4.)  Cubics and quartics seem to be safe - the code for
  272. these surfaces is the same as previous versions and suffers only from
  273. precisions problems leading to digital noise.
  274.  
  275. See "SINSURF.DAT" for a 6th order surface.  So far I haven't gotten a good
  276. render of it as a result of system crashes and too much time spent working
  277. on bicubic patches.
  278.  
  279.  
  280. CLIPPING
  281. --------
  282.  
  283. The keywords CLIPPED_BY and END_CLIP have been added to allow for chopping
  284. parts of a surface by another surface.  The effect is identical to an
  285. INTERSECTION with a transparent surface, but quite a bit faster.  See
  286. "GRAFBIC.DAT" for a Bicorn that has had its front and back chopped.
  287.  
  288.  
  289. BICUBIC PATCHES
  290. ---------------
  291.  
  292. Bicubic patches are a mesh of control points that describe the shape of
  293. a surface.  There are several types of bicubic patches, however the only
  294. one currently understood is the Bezier patch.
  295.  
  296. Bezier patches are bicubic patches that take on the values of the corner
  297. vertices of the mesh, and are influenced by the other values.  A notable
  298. computer graphic object that has this sort of patch definition is the
  299. UTAH Teapot. (See TEAPOT.DAT.)
  300.  
  301. In order to ray-trace a patch, the patch is approximated by a mesh of vertices
  302. that interpolate the patch.  By increasing the number of points in each of
  303. the two mesh parameters (u, and v), a smoother approximation to the true grid
  304. will be traced.  NOTE: Increasing the number of points increases the amount
  305. of work in proportion to U-Resolution * V-Resolution.  If the patch is going
  306. to be small on the screen then you will not need to use a very high resolution.
  307.  
  308. The definition of a BICUBIC patch takes the form:
  309.  
  310.    BICUBIC_PATCH <Patch Type> <U resolution> <V resolution>
  311.       < vertex (0,0) > < vertex (0,1) > < vertex (0,2) > < vertex (0,3) >
  312.       < vertex (1,0) > < vertex (1,1) > < vertex (1,2) > < vertex (1,3) >
  313.       < vertex (2,0) > < vertex (2,1) > < vertex (2,2) > < vertex (2,3) >
  314.       < vertex (3,0) > < vertex (3,1) > < vertex (3,2) > < vertex (3,3) >
  315.  
  316.       [ <texture>, <translate>, <rotate>, ... ]
  317.    END_BICUBIC
  318.  
  319. The value of "Patch Type" determines the shading characteristics of the
  320. patch, and the amount of storage used for mesh constants.  There are
  321. currently three allowed values for "Patch Type":
  322.  
  323.  
  324.    0) Bezier patch, only sufficient storage is allocated to store the tri-
  325.       angular vertices.
  326.  
  327.    1) Bezier patch, vertices, all plane equations defined by the triangulation
  328.       of the patch into subpatches are stored.
  329.  
  330.    2) Bezier patch, using binary subdivision to find the point of surface
  331.       intersection.
  332.  
  333.    3) Bezier patch, using binary subdivision, with vertices and all values
  334.       precomputed and stored.
  335.  
  336.    4) Bezier patch, vertices, all plane equations, normals at each vertex of
  337.       a subpatch are stored (to be used for a SMOOTH_TRIANGLE shading in each
  338.       of subpatch).
  339.  
  340. At some future date, other types of patches besides Bezier may be used.  In
  341. this case new values of Patch Type will be defined for them.
  342.  
  343. The value of "U Resolution" determines the number of steps along the
  344. U parameter (row variable) that are taken when subdividing the patch.
  345.  
  346. The value of "V Resolution" determines the number of steps along the
  347. V parameter (column variable) that are taken when subdividing the patch. 
  348.  
  349. An example of a Bezier patch is:
  350.  
  351.    BICUBIC_PATCH 1 4 4
  352.       < 0.0  0.0  2.0>  < 1.0  0.0  0.0>  < 2.0  0.0  0.0>  < 3.0  0.0 -2.0>
  353.       < 0.0  1.0  0.0>  < 1.0  1.0  0.0>  < 2.0  1.0  0.0>  < 3.0  1.0  0.0>
  354.       < 0.0  2.0  0.0>  < 1.0  2.0  0.0>  < 2.0  2.0  0.0>  < 3.0  2.0  0.0>
  355.       < 0.0  3.0  2.0>  < 1.0  3.0  0.0>  < 2.0  3.0  0.0>  < 3.0  3.0 -2.0>
  356.    END_BICUBIC
  357.  
  358. This is a patch that is interpolated by a 4x4 mesh of vertices.  This is
  359. subdivided into 2x4x4 = 32 triangles.  This second subdivision into triangles
  360. is algorithmic and occurs in two situatons, when the patch is parsed and when
  361. intersections are being calculated.  In addition the plane equation of all
  362. 32 triangles are stored so that intersection calculations can be optimized
  363. a bit.
  364.  
  365. If the Patch Type were changed from 1 to 3, normal calculations based on the
  366. normal to the patch at each of the mesh vertices would be used.  This gives
  367. the same shading effect that SMOOTH_TRIANGLE's have.
  368.  
  369. For example, the following patch definition has taken 16 co-planar points
  370. arranged in the grid 0 <= x <= 1 && 0 <= y <= 1 && z = 0, and pulled two
  371. corners down and two corners up along the z-axis. (See BEZIER.DAT.)
  372.  
  373. OBJECT
  374.    BICUBIC_PATCH 1 4 4
  375.       < 0.0  0.0  2.0>  < 1.0  0.0  0.0>  < 2.0  0.0  0.0>  < 3.0  0.0 -2.0>
  376.       < 0.0  1.0  0.0>  < 1.0  1.0  0.0>  < 2.0  1.0  0.0>  < 3.0  1.0  0.0>
  377.       < 0.0  2.0  0.0>  < 1.0  2.0  0.0>  < 2.0  2.0  0.0>  < 3.0  2.0  0.0>
  378.       < 0.0  3.0  2.0>  < 1.0  3.0  0.0>  < 2.0  3.0  0.0>  < 3.0  3.0 -2.0>
  379.       TEXTURE CHECKER COLOR RED 1.0 COLOR BLUE 1.0 ROTATE <90 0 0>
  380.               AMBIENT 0.1 DIFFUSE 0.9 PHONG 1 END_TEXTURE
  381.    END_BICUBIC
  382.    TRANSLATE <-1.5 -1.5 0>
  383.    SCALE <2 2 2>
  384.    ROTATE <30 -70 0>
  385.    BOUNDED_BY SPHERE <0 0 0> 6 END_SPHERE END_BOUND
  386. END_OBJECT
  387.  
  388.  
  389. STURMIAN SEQUENCES
  390. ------------------
  391.  
  392. There have been many improvements in calcluating 3rd and 4th order surfaces.
  393. By default they are still computed the same was as previously, but there is
  394. a new and better way:  Sturmian Sequences! - these seem to cure the majority
  395. of problems with math precision errors resulting in digital acne or outright
  396. noise bursts in the QUARTIC shapes.  The classic error-prone TEARDROP file
  397. now runs beautifully!  This takes care of some of the worst of the problems,
  398. but seems to lead to occasional problems when the normal is calculated (the
  399. surface is correct but the shading is sometimes a little off).  The bad
  400. shading isn't totally random either - it often makes sort of swirl patterns.
  401. In order to use the Sturmian Sequence method, place the keyword STURM anywhere
  402. after the end of the vectors inside a Cubic, Quartic or Bicubic Patch shape
  403. definition.
  404.  
  405. Example:
  406.  
  407. OBJECT
  408.    QUARTIC
  409.    < 1.0   0.0   0.0    0.0     2.0   0.0   0.0   2.0   0.0 -104.0
  410.      0.0   0.0   0.0    0.0     0.0   0.0   0.0   0.0   0.0    0.0
  411.      1.0   0.0   0.0    2.0     0.0  56.0   0.0   0.0   0.0    0.0
  412.      1.0   0.0 -104.0   0.0   784.0 >
  413.    STURM { <-----<<< Must be placed before the END_ statement! <----<<<< }
  414.    END_QUARTIC
  415.    .
  416.    .
  417.    .
  418. END_OBJECT
  419.  
  420.  
  421. DECLARED CONSTANTS
  422. ------------------
  423.  
  424. Here are the various types of constants allowed by the DECLARE statement:
  425.  
  426. OBJECT_CONSTANT
  427. SPHERE_CONSTANT
  428. PLANE_CONSTANT
  429. TRIANGLE_CONSTANT
  430. SMOOTH_TRIANGLE_CONSTANT
  431. QUADRIC_CONSTANT
  432. POLY_CONSTANT (QUARTIC)
  433. POLY_CONSTANT (CUBIC)
  434. POLY_CONSTANT (POLY)
  435. BICUBIC_PATCH_CONSTANT
  436. CSG_INTERSECTION_CONSTANT
  437. CSG_UNION_CONSTANT
  438. CSG_DIFFERENCE_CONSTANT
  439. COMPOSITE_CONSTANT
  440. TEXTURE_CONSTANT
  441. VIEW_POINT_CONSTANT
  442. COLOUR_CONSTANT
  443. VECTOR_CONSTANT
  444. FLOAT_CONSTANT
  445.  
  446. Smile - 
  447.  
  448. If you cannot afford a texture block, a default one will be appointed to you!
  449.