| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134 |
- import type { Scene } from "./_helpers";
- export const splatPostFx: Scene = {
- name: "Splat + Post-Processing",
- description:
- "A gaussian splat with bloom and vignette post-processing effects",
- spec: {
- root: "scene",
- elements: {
- scene: {
- type: "Group",
- props: { position: null, rotation: null, scale: null },
- children: [
- "camera",
- "env",
- "ambient",
- "key-light",
- "splat",
- "grid",
- "fx",
- "controls",
- ],
- },
- camera: {
- type: "PerspectiveCamera",
- props: {
- position: [3, 2, 5],
- rotation: null,
- scale: null,
- fov: 50,
- near: null,
- far: null,
- makeDefault: true,
- },
- children: [],
- },
- env: {
- type: "Environment",
- props: {
- preset: "night",
- background: false,
- blur: 0.8,
- intensity: 0.4,
- },
- children: [],
- },
- ambient: {
- type: "AmbientLight",
- props: { color: "#ccccff", intensity: 0.2 },
- children: [],
- },
- "key-light": {
- type: "PointLight",
- props: {
- position: [3, 5, 3],
- rotation: null,
- scale: null,
- color: "#ffeecc",
- intensity: 30,
- distance: 20,
- decay: null,
- castShadow: null,
- },
- children: [],
- },
- splat: {
- type: "GaussianSplat",
- props: {
- src: "https://huggingface.co/datasets/dylanebert/3dgs/resolve/main/bonsai/bonsai-7k.splat",
- position: [0, 0, 0],
- rotation: null,
- scale: [1, 1, 1],
- castShadow: null,
- receiveShadow: null,
- alphaHash: null,
- toneMapped: null,
- visible: true,
- },
- children: [],
- },
- grid: {
- type: "GridHelper",
- props: {
- position: [0, -0.5, 0],
- rotation: null,
- scale: null,
- size: 20,
- divisions: 20,
- color: "#222222",
- secondaryColor: "#111111",
- },
- children: [],
- },
- fx: {
- type: "EffectComposer",
- props: { enabled: true, multisampling: 8 },
- children: ["bloom", "vignette"],
- },
- bloom: {
- type: "Bloom",
- props: {
- intensity: 0.8,
- luminanceThreshold: 0.2,
- luminanceSmoothing: 0.5,
- mipmapBlur: true,
- },
- children: [],
- },
- vignette: {
- type: "Vignette",
- props: { offset: 0.25, darkness: 0.7 },
- children: [],
- },
- controls: {
- type: "OrbitControls",
- props: {
- enableDamping: true,
- dampingFactor: null,
- enableZoom: null,
- enablePan: null,
- enableRotate: null,
- minDistance: 2,
- maxDistance: 12,
- minPolarAngle: 0.3,
- maxPolarAngle: 1.5,
- autoRotate: true,
- autoRotateSpeed: 0.5,
- target: [0, 0.5, 0],
- },
- children: [],
- },
- },
- },
- };
|