home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / raytrace / rayce27 / speedtst.r < prev    next >
Encoding:
Text File  |  1993-11-25  |  1.8 KB  |  91 lines

  1. /* 
  2.   this was intended as a speedtest, but it's not a very good benchmark.
  3. */
  4. /*
  5.  
  6.    camera1: box 50x50x5: 67 seconds, raw
  7.          sphere 50x50x5: 46 seconds
  8.         algquad 50x50x5: 105 seconds
  9.              quad 50x50x5: 88 secs (huh?)
  10.  
  11.  comments:
  12.   - tracing a raw scene file takes about 0.4 ms/ray.
  13.   - too much time is spent doing alloc() calls.
  14.   - The algebraic is pretty good! only 20% slower than the quad!
  15.   (this of course has something to do with the big number of 0's being
  16.   multiplied, and the relative inefficiency of the supporting routines
  17.   such as add_to_queue, get_new_queue.)
  18.  
  19. */
  20.  
  21. // note: these timings were based on the Mess dos compile, and on version 2.4
  22. // or 2.5
  23.   
  24.  
  25. #declare camera1 = camera {
  26.   location <0, 0, -10>
  27.   direction <0 , 0, 2>
  28.   sky <0, 1, 0>
  29.   fov 40
  30. }
  31.  
  32. #declare camera2 = camera {
  33.   location <0, 0, -10>
  34.   direction <0, 0, -2>
  35.   sky <0, 1, 0>
  36.   fov 40
  37. }
  38.  
  39. camera { camera1 }
  40.  
  41. #declare white = color red 1.0 green 1.0 blue 1.0
  42. #declare ShinyBlue  =  texture {
  43.     ambient color blue 0.2
  44.     diffuse color blue 0.7 red 0.2 green 0.2
  45.     specular color white
  46.     roughness 0.1    
  47. }
  48.  
  49. #declare algquad = object {
  50.     algebraic { $ x^2 + y^2 + z^2 -1 $ }
  51. }
  52.  
  53. #declare quad = object {
  54.     quadric { <1, 1, 1>, <0, 0, 0>, <0, 0, 0>, -1 }
  55. }
  56.  
  57. #declare testbox1 = object { 
  58.   box { <-1, -1, -1>, <1, 1, 1> scale <0.8, 0.8, 0.8> }
  59. }
  60.  
  61. #declare testbox2 = object { 
  62.   box { <-0.8, -0.8, -0.8>, <0.8, 0.8, 0.8> }
  63. }
  64.  
  65. #declare sph = object {
  66.   sphere { <0, 0, 0>, 1 }
  67. }
  68.  
  69. #declare testobj  = object { algquad
  70.   texture { ShinyBlue }  
  71. }
  72. //#declare testobj  = object { sph }
  73. //#declare testobj = object { testbox2 }
  74.  
  75. object { testobj }
  76. object { testobj }
  77. object { testobj }
  78. object { testobj }
  79. object { testobj }
  80. object { testobj }
  81. object { testobj }
  82. object { testobj }
  83. object { testobj }
  84. object { testobj }
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.