home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fractal112 / !Fractal / Help / Raycast < prev    next >
Text File  |  1996-10-13  |  8KB  |  180 lines

  1.                                      RayCast
  2.                                      ~~~~~~~
  3.  
  4. RayCast is a 3D rendering system, like Render, 3D_Plane and 3D_View. However, it
  5. differs in one major way: It uses a lighting model, which ultimately results in
  6. a higher quality image than can be produced by the other 3D functions. However,
  7. because of its versatility, it is slightly more tricky to use.
  8. The smoother the source image, the better the final results.
  9.  
  10. Clear Files
  11. ----- -----
  12. In order to escape !Fractal's limitation of 256 colours, RayCast has to write to
  13. a file in a format called 'Clear.' These files are not sprite files, and are
  14. much larger because 65,536 times as many colours are stored. As an example, a
  15. Mode 21 (640x512) picture rendered in RayCast takes up around a megabyte!
  16. To look at these files, a viewer is required. People with expensive Colour
  17. Cards will probably already have a Clear file viewer, that will allow them to
  18. view the pictures in thousands or maybe even millions of colours.
  19. However, for people with normal systems, the ShareWare program Translatr or the
  20. ChangeFSI application that comes with RISC OS 3 will do the job nicely.
  21.  
  22. Using RayCast
  23. ----- -------
  24. When you have a fractal on the screen, that you want to render in 3D, select the
  25. required palette (and shift it if needed) BEFORE invoking RayCast. Then select
  26. RayCast from the 'Functions' panel on the main menu, and there will be a small
  27. delay while raycast scans the image.
  28. Then select the viewing elevation as required (though this can be done before
  29. hand if needed) and bring up the RayCast data entry panel, either by clicking
  30. on the appropriate tool bar icon, or using the menu entry. Set up these options
  31. as required (a brief description of each is given below). Make sure preview is
  32. still turned on. Remember to press OK to accept the values in the window.
  33. Press the redraw icon on the tool bar, and watch a horrible dotty picture
  34. being drawn. The purpose of this image is to show you where (or not) the
  35. final picture will appear on screen, whether the water level is correct, etc.
  36. If part of the image is off screen, try reducing the height scalar or twiddling
  37. the elevation. An elevation of 45 degrees requires most screen space.
  38. Note that the rotation is fixed. If you want to look at the picture from another
  39. angle, rotate the image first.
  40. Keep repeating these steps until the image is in the right place on the screen,
  41. then go to the panel and turn preview off.
  42. Now, go to the 'Write Clear File' entry on the menu, and save the icon
  43. somewhere. Note, nothing will actually be saved, but the filename will have been
  44. noted. Then press render again.
  45. Now the picture will be rendered 3 times in a row - don't panic, the program
  46. will still multi-task - but there will be pauses of about 30 second duration at
  47. the end of each rendering while the computer writes out a colour component to
  48. the Clear file. If multi-tasking, then the pointer will turn to an hourglass
  49. while the disc writing is taking place. When this has finished, load the Clear
  50. file into a viewer, sit back, and look at your wonderful creation.
  51.  
  52. What's What
  53. ------ ----
  54. Light vector:
  55.     The image is light-sourced as though a single light source is shining onto
  56. the surface, with a continuous emission of parallel photons (OK, this isn't
  57. reality) i.e. the light is straight. These values govern the direction that the
  58. light is shining towards. Note, the axes are as follows: X(horizontal),
  59. Y(vertical) and Z(depth). i.e.:
  60.  
  61. Y    Z
  62. |\  /|
  63. |  /
  64. | /
  65. |/_______>X
  66.  
  67. Defaults:
  68.     Clicking this button will return some of the options in the window to their
  69. defaults.
  70.  
  71. Smooth image:
  72.     Helps to eliminate bumpiness in the source image. Note this affects the
  73. source image permanently each time a redraw is called. It averages each pixel
  74. with each one of its neighbours.
  75.  
  76. Preview:
  77.     Governs whether a final rendering or a quick peep will be rendered.
  78.  
  79. Height Scalar:
  80.     The height scalar. Change this to alter the height mapping. A value of 1 
  81. means that all heights will be left unchanged.
  82.  
  83. Water:
  84.     Turn this on to place an imaginary 'water level' on the image. Enter a
  85. value to the right for a water level. Use 50 for the Landscape palette. Water
  86. will be coloured according to depth, and shadows will be cast onto the water.
  87.  
  88. Shadow detection:
  89.     If turned on, RayCast will cast shadows onto the landscape from the light
  90. source. Note, this will mean rendering takes slightly longer.
  91.  
  92. Dither:
  93.     If turned on, the landscape colours will be scattered slightly, resulting
  94. in a stippled effect that can sometimes help relieve the boredom of an image.
  95.  
  96. Script Interface
  97. ------ ---------
  98. As RayCast does not use the usual data entry window, the data parameters have
  99. to be changed using the Data command.
  100.  
  101. The commands supported are (all of which should be quite obvious):
  102.  
  103. water_level=xxx        : Sets the water level to a given value (0-255).
  104. water_on=0/1           : Is the water on/off?
  105.  
  106. dither_thresh=xxx      : Sets the dither threshold as in the panel
  107. dither_on=0/1          : Is dithering turned on or off?
  108. smooth_on=0/1          : Turns smoothing on or off
  109.  
  110. light_dx=x.xxx         : These set the light vector.
  111. light_dy=x.xxx
  112. light_dz=x.xxx
  113.  
  114. preview_on=0/1         : Is previewing on?
  115. shadows_on=0/1         : Is shadow detection on?
  116.  
  117. height_scalar=xx.xx    : Value of height scalar.
  118.  
  119. Note, if the window is open, these values will not automatically be updated
  120. - you will need to click 'Defaults' or re-open the window. That latter is
  121. more desirable, as it does not change any values.
  122.  
  123. Error Messages
  124. ----- --------
  125. Here lies a short description of all the error messages that are likely to occur:
  126.  
  127. Inaccuracies will result if a component of the light vector is greater than 1!
  128.   You have set a component of the light vector to more than 1, which means
  129.   shadow checking may become inaccurate. Reduce it.
  130.  
  131. RayCast water level must be less than 256!
  132.   Quite obvious really.
  133.  
  134. RayCast dither level must be less than 256!
  135.   So is this...
  136.  
  137. This option will not work if preview is on in RayCast data window!
  138.   This serves as a reminder to tell you that, if you are using a Clear file,
  139.   RayCast will not render to it unless Preview is off.
  140.  
  141. No palette in source image!
  142.   The source sprite does not have a 256 colour palette (maybe loaded elsewhere).
  143.  
  144. NCLib is unable to initialise 3D projector. Probably short of memory!
  145.   RayCast has failed in its attempt to allocate memory for perspective tables.
  146.   Free some memory, and try again.
  147.  
  148. NCLib has experienced an error when writing Clear file!
  149.   One of the stdio functions returned an error when writing out a Clear file.
  150.   Probably short of disc space (these files get big!)
  151.  
  152. Error writing Blue component to Clear file!
  153.   Problem accessing the Clear file to write out a colour component.
  154.   (can also occur with red and green components).
  155.  
  156. Any other errors are generated by !Fractal itself.
  157.  
  158. Copyright
  159. ---------
  160. The copyright of
  161.     RayCast, Stereogram, Sierpinski
  162. belongs to Neil A Carson. No part of the code may be used in any other program
  163. whatsoever without the author's permission.
  164. However, Mike Curnow's word is my word, so if he says you can do something with
  165. it, then it's fine by me.
  166. Source code is obtainable together with the source for the rest of Fractal
  167. (since it is not much use on its own) from Mike (with his permission) at the
  168. address below.
  169.  
  170. Author
  171. ------
  172. I can be contacted at:
  173.     1 Penn Close,
  174.      Abingdon,
  175.       Oxon OX14 2NX
  176.  
  177. Or on packet email, I am: neil@g7kqy.ampr.org [44.141.6.229]
  178.              (on ax25, Ben g7kqy@gb7avm may forward the odd message if you ask
  179.               him nicely).
  180.