splat-showroom.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. import type { Scene } from "./_helpers";
  2. export const splatShowroom: Scene = {
  3. name: "Splat Showroom",
  4. description:
  5. "A gaussian splat on a pedestal with studio lighting and orbit controls",
  6. spec: {
  7. root: "scene",
  8. elements: {
  9. scene: {
  10. type: "Group",
  11. props: { position: null, rotation: null, scale: null },
  12. children: [
  13. "camera",
  14. "env",
  15. "ambient",
  16. "key-light",
  17. "fill-light",
  18. "splat",
  19. "grid",
  20. "controls",
  21. ],
  22. },
  23. camera: {
  24. type: "PerspectiveCamera",
  25. props: {
  26. position: [3, 2, 5],
  27. rotation: null,
  28. scale: null,
  29. fov: 50,
  30. near: null,
  31. far: null,
  32. makeDefault: true,
  33. },
  34. children: [],
  35. },
  36. env: {
  37. type: "Environment",
  38. props: {
  39. preset: "studio",
  40. background: false,
  41. blur: 0.5,
  42. intensity: 0.6,
  43. },
  44. children: [],
  45. },
  46. ambient: {
  47. type: "AmbientLight",
  48. props: { color: "#e8e0f0", intensity: 0.3 },
  49. children: [],
  50. },
  51. "key-light": {
  52. type: "DirectionalLight",
  53. props: {
  54. position: [5, 8, 3],
  55. rotation: null,
  56. scale: null,
  57. color: "#ffffff",
  58. intensity: 2,
  59. castShadow: true,
  60. },
  61. children: [],
  62. },
  63. "fill-light": {
  64. type: "PointLight",
  65. props: {
  66. position: [-3, 4, -2],
  67. rotation: null,
  68. scale: null,
  69. color: "#aaccff",
  70. intensity: 15,
  71. distance: 20,
  72. decay: null,
  73. castShadow: null,
  74. },
  75. children: [],
  76. },
  77. splat: {
  78. type: "GaussianSplat",
  79. props: {
  80. src: "https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k.splat",
  81. position: [0, 0, 0],
  82. rotation: null,
  83. scale: [1, 1, 1],
  84. castShadow: null,
  85. receiveShadow: null,
  86. alphaHash: null,
  87. toneMapped: null,
  88. visible: true,
  89. },
  90. children: [],
  91. },
  92. grid: {
  93. type: "GridHelper",
  94. props: {
  95. position: [0, -0.5, 0],
  96. rotation: null,
  97. scale: null,
  98. size: 20,
  99. divisions: 20,
  100. color: "#333333",
  101. secondaryColor: "#1a1a1a",
  102. },
  103. children: [],
  104. },
  105. controls: {
  106. type: "OrbitControls",
  107. props: {
  108. enableDamping: true,
  109. dampingFactor: null,
  110. enableZoom: null,
  111. enablePan: null,
  112. enableRotate: null,
  113. minDistance: 2,
  114. maxDistance: 15,
  115. minPolarAngle: 0.2,
  116. maxPolarAngle: 1.5,
  117. autoRotate: true,
  118. autoRotateSpeed: 0.5,
  119. target: [0, 0.5, 0],
  120. },
  121. children: [],
  122. },
  123. },
  124. },
  125. };