hyperspace-tunnel.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import type { Scene } from "./_helpers";
  2. export const hyperspaceTunnel: Scene = {
  3. name: "Hyperspace Tunnel",
  4. description:
  5. "Neon warp tunnel at breakneck speed -- bloom, camera shake, particles streaming past",
  6. spec: {
  7. root: "scene",
  8. elements: {
  9. scene: {
  10. type: "Group",
  11. props: { position: null, rotation: null, scale: null },
  12. children: [
  13. "cam",
  14. "controls",
  15. "tunnel",
  16. "stars",
  17. "sparkles-core",
  18. "sparkles-wide",
  19. "ambient",
  20. "center-light",
  21. "shake",
  22. "post",
  23. "fog",
  24. ],
  25. },
  26. cam: {
  27. type: "PerspectiveCamera",
  28. props: {
  29. position: [0, 0, 2],
  30. rotation: null,
  31. scale: null,
  32. fov: 80,
  33. near: 0.1,
  34. far: 200,
  35. makeDefault: true,
  36. },
  37. children: [],
  38. },
  39. controls: {
  40. type: "OrbitControls",
  41. props: {
  42. enableRotate: false,
  43. enableZoom: false,
  44. enablePan: false,
  45. },
  46. children: [],
  47. },
  48. tunnel: {
  49. type: "WarpTunnel",
  50. props: {
  51. position: null,
  52. rotation: null,
  53. scale: null,
  54. ringCount: 100,
  55. radius: 3,
  56. length: 50,
  57. speed: 12,
  58. tubeRadius: 0.025,
  59. color1: "#00ffff",
  60. color2: "#ff00ff",
  61. },
  62. children: [],
  63. },
  64. stars: {
  65. type: "Stars",
  66. props: {
  67. radius: 80,
  68. depth: 60,
  69. count: 6000,
  70. factor: 5,
  71. saturation: 0.4,
  72. fade: true,
  73. speed: 3,
  74. },
  75. children: [],
  76. },
  77. "sparkles-core": {
  78. type: "Sparkles",
  79. props: {
  80. position: [0, 0, -10],
  81. rotation: null,
  82. scale: [4, 4, 30],
  83. count: 300,
  84. speed: 3,
  85. opacity: 1,
  86. color: "#00ffff",
  87. size: 2,
  88. noise: 0.5,
  89. },
  90. children: [],
  91. },
  92. "sparkles-wide": {
  93. type: "Sparkles",
  94. props: {
  95. position: [0, 0, -15],
  96. rotation: null,
  97. scale: [6, 6, 40],
  98. count: 200,
  99. speed: 4,
  100. opacity: 0.7,
  101. color: "#ff44ff",
  102. size: 1.5,
  103. noise: 1,
  104. },
  105. children: [],
  106. },
  107. ambient: {
  108. type: "AmbientLight",
  109. props: { color: "#110033", intensity: 0.2 },
  110. children: [],
  111. },
  112. "center-light": {
  113. type: "PointLight",
  114. props: {
  115. position: [0, 0, -5],
  116. rotation: null,
  117. scale: null,
  118. color: "#00ccff",
  119. intensity: 30,
  120. distance: 30,
  121. decay: 2,
  122. castShadow: false,
  123. },
  124. children: [],
  125. },
  126. shake: {
  127. type: "CameraShake",
  128. props: {
  129. intensity: 0.3,
  130. maxYaw: 0.03,
  131. maxPitch: 0.03,
  132. maxRoll: 0.02,
  133. },
  134. children: [],
  135. },
  136. post: {
  137. type: "EffectComposer",
  138. props: { enabled: true, multisampling: 8 },
  139. children: ["bloom", "vignette"],
  140. },
  141. bloom: {
  142. type: "Bloom",
  143. props: {
  144. intensity: 2.5,
  145. luminanceThreshold: 0.1,
  146. luminanceSmoothing: null,
  147. mipmapBlur: true,
  148. },
  149. children: [],
  150. },
  151. vignette: {
  152. type: "Vignette",
  153. props: { offset: 0.3, darkness: 0.9 },
  154. children: [],
  155. },
  156. fog: {
  157. type: "Fog",
  158. props: { color: "#030008", near: 5, far: 50 },
  159. children: [],
  160. },
  161. },
  162. },
  163. };