├── .nvmrc ├── apps └── data │ ├── .gitignore │ ├── types.d.ts │ ├── data │ ├── irradiance.bin │ ├── scattering.bin │ └── transmittance.bin │ ├── eslint.config.mjs │ ├── download.sh │ ├── tsconfig.json │ ├── tsconfig.spec.json │ ├── tsconfig.app.json │ ├── jest.config.ts │ └── src │ ├── main.ts │ └── targets │ ├── stbn.ts │ └── atmosphere.ts ├── packages ├── atmosphere │ ├── src │ │ ├── shaders │ │ │ ├── index.ts │ │ │ ├── bruneton │ │ │ │ └── index.ts │ │ │ └── precompute │ │ │ │ ├── transmittance.frag │ │ │ │ ├── directIrradiance.frag │ │ │ │ ├── indirectIrradiance.frag │ │ │ │ ├── multipleScattering.frag │ │ │ │ ├── scatteringDensity.frag │ │ │ │ └── singleScattering.frag │ │ ├── r3f │ │ │ ├── index.ts │ │ │ └── useAtmosphereTextureProps.ts │ │ ├── webgpu │ │ │ └── index.ts │ │ ├── getAltitudeCorrectionOffset.ts │ │ ├── index.ts │ │ ├── types.ts │ │ ├── StarsGeometry.ts │ │ └── helpers │ │ │ └── functions.ts │ ├── assets │ │ ├── stars.bin │ │ ├── irradiance.bin │ │ ├── irradiance.exr │ │ ├── scattering.bin │ │ ├── scattering.exr │ │ ├── transmittance.bin │ │ ├── transmittance.exr │ │ ├── higher_order_scattering.bin │ │ ├── higher_order_scattering.exr │ │ ├── single_mie_scattering.bin │ │ └── single_mie_scattering.exr │ ├── docs │ │ ├── fuji.jpg │ │ ├── iss.jpg │ │ ├── space.webp │ │ ├── cityscape.webp │ │ ├── forward.jpg │ │ ├── manhattan.jpg │ │ ├── littlest-tokyo.jpg │ │ ├── low-earth-orbit.webp │ │ ├── moon-surface.webp │ │ ├── non-geospatial.webp │ │ ├── cruising-altitude.webp │ │ ├── sun-angular-radius-01.jpg │ │ ├── altitude-correction-false.jpg │ │ ├── altitude-correction-true.jpg │ │ ├── lunar-radiance-scale-1.jpg │ │ ├── lunar-radiance-scale-5.jpg │ │ ├── sun-angular-radius-default.jpg │ │ ├── correct-geometric-error-false.jpg │ │ └── correct-geometric-error-true.jpg │ ├── .babelrc │ ├── project.json │ ├── tsconfig.json │ ├── eslint.config.mjs │ └── tsconfig.spec.json ├── clouds │ ├── src │ │ ├── r3f │ │ │ └── index.ts │ │ ├── shaders │ │ │ ├── shadow.vert │ │ │ ├── cloudsResolve.vert │ │ │ ├── shadowResolve.vert │ │ │ ├── types.glsl │ │ │ └── cloudsEffect.frag │ │ ├── index.ts │ │ ├── bayer.ts │ │ ├── Turbulence.ts │ │ ├── LocalWeather.ts │ │ ├── PassBase.ts │ │ ├── CloudShape.ts │ │ ├── CloudShapeDetail.ts │ │ ├── constants.ts │ │ ├── helpers │ │ │ └── setArrayRenderTargetLayers.ts │ │ ├── ShaderArrayPass.ts │ │ └── DensityProfile.ts │ ├── docs │ │ ├── fuji.jpg │ │ ├── cloud-shape.png │ │ ├── london.jpg │ │ ├── ray-march.png │ │ ├── tokyo.jpg │ │ └── rendering-path.png │ ├── assets │ │ ├── shape.bin │ │ ├── local_weather.png │ │ ├── shape_detail.bin │ │ └── turbulence.png │ ├── .babelrc │ ├── project.json │ ├── tsconfig.json │ ├── eslint.config.mjs │ └── tsconfig.spec.json ├── core │ ├── src │ │ ├── r3f │ │ │ ├── index.ts │ │ │ ├── types.ts │ │ │ └── EllipsoidMesh.tsx │ │ ├── shaders │ │ │ ├── generators.glsl │ │ │ ├── interleavedGradientNoise.glsl │ │ │ ├── transform.glsl │ │ │ ├── vogelDisk.glsl │ │ │ ├── turbo.glsl │ │ │ ├── packing.glsl │ │ │ ├── depth.glsl │ │ │ └── index.ts │ │ ├── constants.ts │ │ ├── webgpu │ │ │ ├── utils.ts │ │ │ ├── index.ts │ │ │ ├── OutputTextureNode.ts │ │ │ ├── OutputTexture3DNode.ts │ │ │ ├── FnVar.ts │ │ │ └── internals.ts │ │ ├── types.ts │ │ ├── QuadGeometry.ts │ │ ├── resolveIncludes.test.ts │ │ ├── capabilities.ts │ │ ├── resolveIncludes.ts │ │ ├── unrollLoops.ts │ │ ├── index.ts │ │ ├── STBNLoader.ts │ │ └── ArrayBufferLoader.ts │ ├── assets │ │ └── stbn.bin │ ├── .babelrc │ ├── project.json │ ├── tsconfig.json │ ├── eslint.config.mjs │ ├── tsconfig.spec.json │ └── README.md └── effects │ ├── src │ ├── r3f │ │ ├── Dithering.tsx │ │ ├── index.ts │ │ ├── Depth.tsx │ │ └── LensFlare.tsx │ ├── shaders │ │ ├── ditheringEffect.frag │ │ ├── lensFlareFeatures.vert │ │ ├── lensFlareEffect.frag │ │ ├── depthEffect.frag │ │ ├── geometryEffect.frag │ │ └── downsampleThreshold.vert │ ├── index.ts │ ├── DitheringEffect.ts │ └── createHaldLookupTexture.ts │ ├── .babelrc │ ├── project.json │ ├── tsconfig.json │ ├── eslint.config.mjs │ ├── tsconfig.spec.json │ └── README.md ├── storybook ├── package.json ├── assets │ ├── iss.glb │ ├── normal_noise.png │ ├── littlest_tokyo.glb │ ├── clut │ │ ├── Fuji │ │ │ ├── Fuji 160C 1 -.png │ │ │ ├── Fuji 160C 2.png │ │ │ ├── Fuji 160C 3 +.png │ │ │ ├── Fuji 400H 1 -.png │ │ │ ├── Fuji 400H 2.png │ │ │ ├── Fuji 400H 3 +.png │ │ │ ├── Fuji 800Z 1 -.png │ │ │ ├── Fuji 800Z 2.png │ │ │ ├── Fuji 800Z 3 +.png │ │ │ ├── Fuji Velvia 50.png │ │ │ ├── Fuji 160C 4 ++.png │ │ │ ├── Fuji 400H 4 ++.png │ │ │ ├── Fuji 800Z 4 ++.png │ │ │ ├── Fuji Astia 100F.png │ │ │ ├── Fuji FP-100c 1 --.png │ │ │ ├── Fuji FP-100c 2 -.png │ │ │ ├── Fuji FP-100c 3.png │ │ │ ├── Fuji FP-100c 4 Alt.png │ │ │ ├── Fuji FP-100c 5 +.png │ │ │ ├── Fuji FP-100c 6 ++.png │ │ │ ├── Fuji FP-100c 8 +++.png │ │ │ ├── Fuji Provia 100F.png │ │ │ ├── Fuji Provia 400F.png │ │ │ ├── Fuji Provia 400X.png │ │ │ ├── Fuji Sensia 100.png │ │ │ ├── Fuji Superia 100 2.png │ │ │ ├── Fuji Superia 200.png │ │ │ ├── Fuji Superia 400 2.png │ │ │ ├── Fuji Superia 800 2.png │ │ │ ├── Fuji Astia 100 Generic.png │ │ │ ├── Fuji FP-100c 7 ++ Alt.png │ │ │ ├── Fuji FP-100c Cool 1 --.png │ │ │ ├── Fuji FP-100c Cool 2 -.png │ │ │ ├── Fuji FP-100c Cool 3.png │ │ │ ├── Fuji FP-100c Cool 4 +.png │ │ │ ├── Fuji FP-100c Cool 5 ++.png │ │ │ ├── Fuji FP-100c Negative 3.png │ │ │ ├── Fuji Provia 100 Generic.png │ │ │ ├── Fuji Superia 100 1 -.png │ │ │ ├── Fuji Superia 100 3 +.png │ │ │ ├── Fuji Superia 100 4 ++.png │ │ │ ├── Fuji Superia 1600 1 -.png │ │ │ ├── Fuji Superia 1600 2.png │ │ │ ├── Fuji Superia 1600 3 +.png │ │ │ ├── Fuji Superia 1600 4 ++.png │ │ │ ├── Fuji Superia 200 XPRO.png │ │ │ ├── Fuji Superia 400 1 -.png │ │ │ ├── Fuji Superia 400 3 +.png │ │ │ ├── Fuji Superia 400 4 ++.png │ │ │ ├── Fuji Superia 800 1 -.png │ │ │ ├── Fuji Superia 800 3 +.png │ │ │ ├── Fuji Superia 800 4 ++.png │ │ │ ├── Fuji Superia HG 1600.png │ │ │ ├── Fuji Superia Reala 100.png │ │ │ ├── Fuji Superia X-Tra 800.png │ │ │ ├── Fuji Velvia 100 Generic.png │ │ │ ├── Fuji FP-100c Negative 1 --.png │ │ │ ├── Fuji FP-100c Negative 2 -.png │ │ │ ├── Fuji FP-100c Negative 4 +.png │ │ │ ├── Fuji FP-100c Negative 5 ++.png │ │ │ ├── Fuji FP-100c Negative 7 +++.png │ │ │ └── Fuji FP-100c Negative 6 ++ Alt.png │ │ ├── Agfa │ │ │ ├── Agfa Precisa 100.png │ │ │ ├── Agfa Vista 200.png │ │ │ └── Agfa Ultra Color 100.png │ │ ├── Kodak │ │ │ ├── Kodak Ektar 100.png │ │ │ ├── Kodak Elite 100 XPRO.png │ │ │ ├── Kodak Elite Chrome 200.png │ │ │ ├── Kodak Elite Chrome 400.png │ │ │ ├── Kodak Elite Color 200.png │ │ │ ├── Kodak Elite Color 400.png │ │ │ ├── Kodak Kodachrome 200.png │ │ │ ├── Kodak Kodachrome 25.png │ │ │ ├── Kodak Kodachrome 64.png │ │ │ ├── Kodak Portra 160 1 -.png │ │ │ ├── Kodak Portra 160 2.png │ │ │ ├── Kodak Portra 160 3 +.png │ │ │ ├── Kodak Portra 160 4 ++.png │ │ │ ├── Kodak Portra 160 NC 2.png │ │ │ ├── Kodak Portra 160 VC 2.png │ │ │ ├── Kodak Portra 400 1 -.png │ │ │ ├── Kodak Portra 400 2.png │ │ │ ├── Kodak Portra 400 3 +.png │ │ │ ├── Kodak Portra 400 4 ++.png │ │ │ ├── Kodak Portra 400 NC 2.png │ │ │ ├── Kodak Portra 400 UC 2.png │ │ │ ├── Kodak Portra 400 VC 2.png │ │ │ ├── Kodak Portra 800 1 -.png │ │ │ ├── Kodak Portra 800 2.png │ │ │ ├── Kodak Portra 800 3 +.png │ │ │ ├── Kodak Portra 800 4 ++.png │ │ │ ├── Kodak Portra 800 HC.png │ │ │ ├── Kodak Ektachrome 100 VS.png │ │ │ ├── Kodak Elite ExtraColor 100.png │ │ │ ├── Kodak Kodachrome 64 Generic.png │ │ │ ├── Kodak Portra 160 NC 1 -.png │ │ │ ├── Kodak Portra 160 NC 3 +.png │ │ │ ├── Kodak Portra 160 NC 4 ++.png │ │ │ ├── Kodak Portra 160 VC 1 -.png │ │ │ ├── Kodak Portra 160 VC 3 +.png │ │ │ ├── Kodak Portra 160 VC 4 ++.png │ │ │ ├── Kodak Portra 400 NC 1 -.png │ │ │ ├── Kodak Portra 400 NC 3 +.png │ │ │ ├── Kodak Portra 400 NC 4 ++.png │ │ │ ├── Kodak Portra 400 UC 1 -.png │ │ │ ├── Kodak Portra 400 UC 3 +.png │ │ │ ├── Kodak Portra 400 UC 4 ++.png │ │ │ ├── Kodak Portra 400 VC 1 -.png │ │ │ ├── Kodak Portra 400 VC 3 +.png │ │ │ ├── Kodak Portra 400 VC 4 ++.png │ │ │ ├── Kodak E-100 GX Ektachrome 100.png │ │ │ └── Kodak Ektachrome 100 VS Generic.png │ │ ├── Polaroid │ │ │ ├── Polaroid 669 3.png │ │ │ ├── Polaroid 690 3.png │ │ │ ├── Polaroid 669 1 --.png │ │ │ ├── Polaroid 669 2 -.png │ │ │ ├── Polaroid 669 4 +.png │ │ │ ├── Polaroid 669 5 ++.png │ │ │ ├── Polaroid 669 6 +++.png │ │ │ ├── Polaroid 669 Cold 3.png │ │ │ ├── Polaroid 690 1 --.png │ │ │ ├── Polaroid 690 2 -.png │ │ │ ├── Polaroid 690 4 +.png │ │ │ ├── Polaroid 690 5 ++.png │ │ │ ├── Polaroid 690 Cold 3.png │ │ │ ├── Polaroid 690 Warm 3.png │ │ │ ├── Polaroid PX-680 2 -.png │ │ │ ├── Polaroid PX-680 3.png │ │ │ ├── Polaroid PX-680 4 +.png │ │ │ ├── Polaroid PX-70 1 --.png │ │ │ ├── Polaroid PX-70 2 -.png │ │ │ ├── Polaroid PX-70 3.png │ │ │ ├── Polaroid PX-70 4 +.png │ │ │ ├── Polaroid PX-70 5 ++.png │ │ │ ├── Polaroid Polachrome.png │ │ │ ├── Polaroid 669 Cold 1 --.png │ │ │ ├── Polaroid 669 Cold 2 -.png │ │ │ ├── Polaroid 669 Cold 4 +.png │ │ │ ├── Polaroid 690 Cold 1 --.png │ │ │ ├── Polaroid 690 Cold 2 -.png │ │ │ ├── Polaroid 690 Cold 4 +.png │ │ │ ├── Polaroid 690 Cold 5 ++.png │ │ │ ├── Polaroid 690 Warm 1 --.png │ │ │ ├── Polaroid 690 Warm 2 -.png │ │ │ ├── Polaroid 690 Warm 4 +.png │ │ │ ├── Polaroid 690 Warm 5 ++.png │ │ │ ├── Polaroid PX-680 1 --.png │ │ │ ├── Polaroid PX-680 5 ++.png │ │ │ ├── Polaroid PX-680 Cold 2 -.png │ │ │ ├── Polaroid PX-680 Cold 3.png │ │ │ ├── Polaroid PX-680 Cold 4 +.png │ │ │ ├── Polaroid PX-680 Warm 2 -.png │ │ │ ├── Polaroid PX-680 Warm 3.png │ │ │ ├── Polaroid PX-680 Warm 4 +.png │ │ │ ├── Polaroid PX-70 6 +++.png │ │ │ ├── Polaroid PX-70 Cold 1 --.png │ │ │ ├── Polaroid PX-70 Cold 2 -.png │ │ │ ├── Polaroid PX-70 Cold 3.png │ │ │ ├── Polaroid PX-70 Cold 4 +.png │ │ │ ├── Polaroid PX-70 Cold 5 ++.png │ │ │ ├── Polaroid PX-70 Warm 1 --.png │ │ │ ├── Polaroid PX-70 Warm 2 -.png │ │ │ ├── Polaroid PX-70 Warm 3.png │ │ │ ├── Polaroid PX-70 Warm 4 +.png │ │ │ ├── Polaroid PX-70 Warm 5 ++.png │ │ │ ├── Polaroid PX-100UV+ Cold 1 --.png │ │ │ ├── Polaroid PX-100UV+ Cold 2 -.png │ │ │ ├── Polaroid PX-100UV+ Cold 3.png │ │ │ ├── Polaroid PX-100UV+ Cold 4 +.png │ │ │ ├── Polaroid PX-100UV+ Cold 5 ++.png │ │ │ ├── Polaroid PX-100UV+ Cold 6 +++.png │ │ │ ├── Polaroid PX-100UV+ Warm 1 --.png │ │ │ ├── Polaroid PX-100UV+ Warm 2 -.png │ │ │ ├── Polaroid PX-100UV+ Warm 3.png │ │ │ ├── Polaroid PX-100UV+ Warm 4 +.png │ │ │ ├── Polaroid PX-100UV+ Warm 5 ++.png │ │ │ ├── Polaroid PX-100UV+ Warm 6 +++.png │ │ │ ├── Polaroid PX-680 Cold 1 --.png │ │ │ ├── Polaroid PX-680 Cold 5 ++.png │ │ │ ├── Polaroid PX-680 Cold 6 ++ Alt.png │ │ │ ├── Polaroid PX-680 Warm 1 --.png │ │ │ ├── Polaroid PX-680 Warm 5 ++.png │ │ │ ├── Polaroid Time Zero (Expired) 1 ---.png │ │ │ ├── Polaroid Time Zero (Expired) 2 --.png │ │ │ ├── Polaroid Time Zero (Expired) 3 -.png │ │ │ ├── Polaroid Time Zero (Expired) 4.png │ │ │ ├── Polaroid Time Zero (Expired) 5 +.png │ │ │ ├── Polaroid Time Zero (Expired) 6 ++.png │ │ │ ├── Polaroid Time Zero (Expired) Cold 1 ---.png │ │ │ ├── Polaroid Time Zero (Expired) Cold 2 --.png │ │ │ ├── Polaroid Time Zero (Expired) Cold 3 -.png │ │ │ └── Polaroid Time Zero (Expired) Cold 4.png │ │ ├── README.md │ │ └── Lomography │ │ │ ├── Lomography Redscale 100.png │ │ │ └── Lomography X-Pro Slide 200.png │ ├── hdri │ │ └── wooden_lounge_4k.hdr │ └── littlest_tokyo_emissive.jpg ├── src │ ├── README.mdx │ ├── helpers │ │ ├── springOptions.ts │ │ ├── states.ts │ │ ├── HaldLUT.tsx │ │ ├── Stats.tsx │ │ ├── useLocationControls.tsx │ │ └── GoogleMapsAPIKeyPrompt.tsx │ ├── clouds │ │ ├── README.mdx │ │ ├── BuildingBlocks-Shape.tsx │ │ ├── BuildingBlocks-Turbulence.tsx │ │ ├── BuildingBlocks-LocalWeather.tsx │ │ ├── BuildingBlocks-ShapeDetail.tsx │ │ ├── Clouds.stories.tsx │ │ └── BuildingBlocks.stories.tsx │ ├── atmosphere │ │ ├── README.mdx │ │ ├── Sky.stories.tsx │ │ ├── Stars.stories.tsx │ │ ├── Atmosphere.stories.tsx │ │ ├── BuildingBlocks.stories.tsx │ │ ├── 3DTilesRenderer.stories.tsx │ │ └── Stars-BlackBodyChromaticity.tsx │ ├── worker │ │ ├── worker.ts │ │ ├── transfer.ts │ │ └── pool.ts │ ├── effects │ │ ├── GBuffer.stories.tsx │ │ └── LensFlare.stories.tsx │ ├── core │ │ ├── Camera.stories.tsx │ │ └── Ellipsoid.stories.tsx │ └── plugins │ │ └── ReorientationPlugin.ts ├── .storybook │ ├── theme.ts │ ├── style.css │ └── manager.ts ├── tsconfig.json ├── project.json ├── eslint.config.mjs ├── tsconfig.lib.json └── tsconfig.storybook.json ├── storybook-webgpu ├── package.json ├── assets │ ├── b787.glb │ ├── iss.glb │ ├── moon │ │ ├── color.webp │ │ ├── normal.webp │ │ ├── color_large.webp │ │ └── normal_large.webp │ ├── seaside.webp │ ├── blue_marble │ │ ├── clouds.webp │ │ ├── color.webp │ │ ├── emissive.webp │ │ └── ocean.webp │ ├── littlest_tokyo │ │ ├── model.glb │ │ └── emissive.jpg │ └── hdri │ │ └── wooden_lounge_4k.hdr ├── src │ ├── helpers │ │ ├── springOptions.ts │ │ └── StoryContext.ts │ ├── core │ │ ├── README.mdx │ │ ├── LensFlare.stories.tsx │ │ └── TemporalAntialias.stories.tsx │ ├── atmosphere │ │ ├── README.mdx │ │ ├── Space.stories.tsx │ │ ├── AtmosphereLight.stories.tsx │ │ ├── LowEarthOrbit.stories.tsx │ │ ├── CruisingAltitude.stories.tsx │ │ ├── NonGeospatial.stories.tsx │ │ ├── 3DTilesRenderer.stories.tsx │ │ └── Cityscape.stories.tsx │ ├── worker │ │ ├── worker.ts │ │ ├── transfer.ts │ │ └── pool.ts │ ├── hooks │ │ ├── useMaybeMotionValue.ts │ │ ├── useGuardedFrame.ts │ │ ├── useGLTF.ts │ │ ├── useControl.ts │ │ ├── usePointOfView.ts │ │ └── useCombinedChange.ts │ ├── plugins │ │ ├── fade │ │ │ └── TilesFadePlugin.ts │ │ └── ReorientationPlugin.ts │ ├── controls │ │ └── rendererControls.ts │ └── components │ │ └── Stats.tsx ├── .storybook │ ├── manager.ts │ ├── style.css │ ├── preview-head.html │ └── theme.ts ├── tsconfig.json ├── types │ └── 3d-tiles-renderer.d.ts ├── project.json ├── eslint.config.mjs ├── tsconfig.lib.json └── tsconfig.storybook.json ├── vitest.workspace.ts ├── .vscode ├── extensions.json └── settings.json ├── types └── postprocessing.d.ts ├── .prettierignore ├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── storybook-webgpu.yaml │ ├── build.yaml │ └── storybook.yaml └── LICENSE /.nvmrc: -------------------------------------------------------------------------------- 1 | lts/jod 2 | -------------------------------------------------------------------------------- /apps/data/.gitignore: -------------------------------------------------------------------------------- 1 | /data 2 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/index.ts: -------------------------------------------------------------------------------- 1 | export {} 2 | -------------------------------------------------------------------------------- /storybook/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /storybook-webgpu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module" 3 | } 4 | -------------------------------------------------------------------------------- /packages/clouds/src/r3f/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Clouds' 2 | export * from './CloudLayer' 3 | -------------------------------------------------------------------------------- /apps/data/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*?raw' { 2 | const content: string 3 | export default content 4 | } 5 | -------------------------------------------------------------------------------- /vitest.workspace.ts: -------------------------------------------------------------------------------- 1 | export default [ 2 | '**/vite.config.{mjs,js,ts,mts}', 3 | '**/vitest.config.{mjs,js,ts,mts}' 4 | ] 5 | -------------------------------------------------------------------------------- /packages/core/src/r3f/index.ts: -------------------------------------------------------------------------------- 1 | export * from './EastNorthUpFrame' 2 | export * from './EllipsoidMesh' 3 | export type * from './types' 4 | -------------------------------------------------------------------------------- /storybook/assets/iss.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4ba72f0a605a512c20ff2ac4ee8434f00004bf0527b73f10c498059ad586208e 3 | size 5587988 4 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "esbenp.prettier-vscode", 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /apps/data/data/irradiance.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0b6deaced96cfe5a8b865eb894c5516057a68ea6cd6a6b7f7ad22f51b6b79302 3 | size 16384 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/fuji.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:af760c69c4e6a0cee2f875a058957d0225808e87571348515eb30f513178297b 3 | size 1525513 4 | -------------------------------------------------------------------------------- /packages/core/assets/stbn.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:51f52f21e5578384585050390821a0a486dcb81e11a716fa7b92fbb6515ba852 3 | size 1048576 4 | -------------------------------------------------------------------------------- /storybook/src/README.mdx: -------------------------------------------------------------------------------- 1 | import ReadMe from '../../README.md?raw' 2 | 3 | import { Markdown } from '@storybook/addon-docs/blocks' 4 | 5 | {ReadMe} 6 | -------------------------------------------------------------------------------- /apps/data/data/scattering.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3ac64751b977b4f9626a3f7bcd354816b6df12fbd49aebe245e0d801621211d1 3 | size 16777216 4 | -------------------------------------------------------------------------------- /apps/data/data/transmittance.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0fd3ad4e6e25681e04a00a112f9131f9bf2b5538a37f536d3a0a0a96af2c4591 3 | size 262144 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/stars.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e2e90b39b342f63003020b43af0e4f88bed3c96c2d04c59d93a43195cc8ae68 3 | size 90960 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/fuji.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:536ffa337b394a223e14e2c4e70b98522f20f9b9184b29848c82702b89b866a1 3 | size 2057050 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/iss.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bfb15483bbfcdda829cd8cdd2caaa9dce447d877acb3ce6c371959e01463ee10 3 | size 1025244 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/space.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:75ce38c4645e6ab14d1218596666960633419d5712e3fcde5dfa52f287d858ce 3 | size 31180 4 | -------------------------------------------------------------------------------- /packages/clouds/assets/shape.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ef65cf6156894720c00bf572c49e3e254f8899c4b5158246e5a35a1922e2519c 3 | size 2097152 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/cloud-shape.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4c24fcc5c5f4ae22716e7730f953682a626bc61beee02dd5f59e7d71f13b5b17 3 | size 34982 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/london.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0bd7693b4b2992e41a67bc538310f0d3695cf9019a39b1722752c24387e49490 3 | size 1990056 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/ray-march.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:338484020b6e06f10e5ddc79b6b2994ca215c50a40b028194ea47b9f343c2b5f 3 | size 98800 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/tokyo.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:843ea3876bf9fc24a3c4ee9ddc17c61c0e453ad3baa4a5562a3563b4af24c4a5 3 | size 1728473 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/b787.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5bfdcbc10bd517a00ce9e2442f61c7b164ff6fb6ff0e92d205d169af26f6b8c2 3 | size 2161896 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/iss.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4ba72f0a605a512c20ff2ac4ee8434f00004bf0527b73f10c498059ad586208e 3 | size 5587988 4 | -------------------------------------------------------------------------------- /storybook/assets/normal_noise.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ae405188fb8b81fa14536deb6caf418127d3fefffe931cf4bd77d5b9807356fa 3 | size 854631 4 | -------------------------------------------------------------------------------- /apps/data/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | 3 | import baseConfig from '../../eslint.config.mjs' 4 | 5 | export default defineConfig(baseConfig) 6 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/irradiance.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:126bd4ff0419e04c877639caf9e3cd64a139ae511cf315a23a0c989fc47b51a5 3 | size 8192 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/irradiance.exr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ca1cbc65648055b496389a08aa60fc7e529f59290dd36f4ee0a3aecda4085d87 3 | size 2253 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/cityscape.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:080994de19a290d9211fe24ae2c364b3e4a465ed44fc1d56bf15ceadbf780f44 3 | size 314260 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/forward.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c8ecc5e03095ff6ce73af80ed1382eb1b8d842190882fb5590ac8de05cc4e1f2 3 | size 353298 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/manhattan.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a385025937a6107f0c9dad5c8dd3f41884d5881e13d4c4b3e61a8dc21dc6e5f2 3 | size 2600309 4 | -------------------------------------------------------------------------------- /packages/clouds/assets/local_weather.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b84daef855dc5eebcc9b174fe832ba75a98e44b846dde201bce354417cc08031 3 | size 679653 4 | -------------------------------------------------------------------------------- /packages/clouds/assets/shape_detail.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c09112199c6e0281b74ff5283c11c2943ae082650b9b67978cf5d59ed2956e4f 3 | size 32768 4 | -------------------------------------------------------------------------------- /packages/clouds/assets/turbulence.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ec2b1b0af4a6a6104102b21e58beb300b0a3d334c0281d84fde8c91d322910f9 3 | size 49691 4 | -------------------------------------------------------------------------------- /packages/clouds/docs/rendering-path.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:77b9685fe2a06a6b347fc800f25560932d246566cccffd0bc6530fdcfc9df56e 3 | size 90131 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/moon/color.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a494fbda896fff825d48413a5c8087d8ccdae534bd85d65677951fb130bb6054 3 | size 61134 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/moon/normal.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7664d68dbf943a0dedda5552e2c08c11f9c588e99161c6fb1ec46ab405cfe343 3 | size 49524 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/seaside.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7219fc159dc8dc10a0329001e031cf632d88452c724e20877d959896ececebe0 3 | size 2902934 4 | -------------------------------------------------------------------------------- /storybook/assets/littlest_tokyo.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8375c2aa6808e28ad1cb9c0d43e1513f57ffd7865244bf66bbbd5bb0e907e06d 3 | size 4133072 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/scattering.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:82c505fe6e3b7f1995c650cc8a1478f42bd510029bf63845e9485c078aef6617 3 | size 8388608 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/scattering.exr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6e6331c196f3d6c524543062bfe9d5fcf52201ac3d62cd443dfedfe58a53b2ce 3 | size 4094331 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/transmittance.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a2a0dd1464048d92e7bfdf385a9108e8d9c3e2748684f1f64523587d5894180a 3 | size 131072 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/transmittance.exr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aef6aba1a70ac159e92495feed1dfb62755f3acd918d954f28638c95f999af1b 3 | size 27977 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/littlest-tokyo.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0442ea68a5229500bce6239f06ba2953d4b3929a7a217234ace729545532768b 3 | size 1021947 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/low-earth-orbit.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:af262918abff4eabf209593bb991ea4c69e247bb59b7db54b18a496c045a7743 3 | size 126112 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/moon-surface.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ab919fc380e1d8d11dbcbb7e62818d7b784a0c377bbe26654bdeeb3e9100f1e6 3 | size 10222 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/non-geospatial.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e31db1e1d03ea19d15d8bbc01afdf1164cb04795673778f045ed901edfc8ad6c 3 | size 74062 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/moon/color_large.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:215fd11db4ca83d28f61c13d80c16cc82b4ac8336424a627de6b23cd5b910519 3 | size 225886 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 160C 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f7878306662e72b6c7c93ba78f67f7ca44feae3a27a226bafe2eab22befbe6b 3 | size 1886451 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 160C 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bb95177af22d6396e32e33c504dd45bdf55d0fa73e0bf9a045c22079bb5ae183 3 | size 1887561 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 160C 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f58699ea074464427b8654c902ff755788b53e5f17cdbfe138de3031f6f7fd1a 3 | size 1887465 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 400H 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1ec23c41995797342686c107ac769bd1408798445edcdbdb138ab2d26f52db93 3 | size 1925956 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 400H 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6368343e1b72350d225418d391973949825c0ce15367446a4c6e371dc5b86141 3 | size 1935900 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 400H 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:50ee5bb101696190fe70b980f7fb6995f522217aff38fb6f1f7cfd74f8271d00 3 | size 1922360 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 800Z 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a23b1fce7ba532d6960eed436bd6341564a6fb8a0d7f86d9fc70846d46e25d9 3 | size 1927247 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 800Z 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:04461634c722b21d5901e07aa3f9b1db91e4331ca1c91adb91b8bff1371eae59 3 | size 1942293 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 800Z 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:466020958ff13c9f4385a6c883c2231febe7e592a79cf9dbef82ed89f1ca7a91 3 | size 1960490 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Velvia 50.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e8e61b7550ca647aa11ca59544131522d3d249bc36bc282cacfe2a21aa2ae7ad 3 | size 926055 4 | -------------------------------------------------------------------------------- /storybook/assets/hdri/wooden_lounge_4k.hdr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f35b639371330250d5ef1d0143ea732fde5a1506034b73ca8582e1741776d6a 3 | size 25217583 4 | -------------------------------------------------------------------------------- /storybook/assets/littlest_tokyo_emissive.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96ed2c34eaac62e6cf2da12adfa70e80d81990e2b4f561327389ca49f2669b47 3 | size 424058 4 | -------------------------------------------------------------------------------- /storybook/src/helpers/springOptions.ts: -------------------------------------------------------------------------------- 1 | import type { SpringOptions } from 'motion/react' 2 | 3 | export const springOptions: SpringOptions = { 4 | mass: 1, 5 | damping: 20 6 | } 7 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "typescript.preferences.importModuleSpecifier": "project-relative", 3 | "[glsl]": { 4 | "editor.defaultFormatter": "esbenp.prettier-vscode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/cruising-altitude.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:695a44d723202665333ca5b64d769691f6f98e7f74930d04c11c8c54b8b3d270 3 | size 116086 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/sun-angular-radius-01.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7ee7ff5c89b8e3485e8d976019b42039575455a4795fcb6218c3052c81b34766 3 | size 252181 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/blue_marble/clouds.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ecd6ccc2e45ea941cefafdd8c3da66a10b354d19145934414f7268b32bf6a028 3 | size 5578398 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/blue_marble/color.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e88411ab35cdd8cfeb10892a6d4aeb47d8f7335d11418d925a5a0aed12a5a1d1 3 | size 1671010 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/blue_marble/emissive.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:76ee3122cbaea202ac1adcb2d3fb583bdd2110990c778bdbc69cde78035a915f 3 | size 388894 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/blue_marble/ocean.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:af041db9d80ff1fd54379bee8ed82887634c0c9bb088eeedf15cc5b50843ce37 3 | size 531036 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/littlest_tokyo/model.glb: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8375c2aa6808e28ad1cb9c0d43e1513f57ffd7865244bf66bbbd5bb0e907e06d 3 | size 4133072 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/moon/normal_large.webp: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:622e46e064d139c225b16331ec6d9612c9e213ebfe8e8ca46a0a8767486702fb 3 | size 247146 4 | -------------------------------------------------------------------------------- /storybook-webgpu/src/helpers/springOptions.ts: -------------------------------------------------------------------------------- 1 | import type { SpringOptions } from 'motion/react' 2 | 3 | export const springOptions: SpringOptions = { 4 | mass: 1, 5 | damping: 20 6 | } 7 | -------------------------------------------------------------------------------- /storybook/assets/clut/Agfa/Agfa Precisa 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:01b1df6a96d2e45d24d09e884f36bb08c6018034b9247be7f8388df3c1636362 3 | size 1192657 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Agfa/Agfa Vista 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1af775f5a47909cdb198df7a989604816932059884dde93a54b1ea2112d5f74f 3 | size 1092414 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 160C 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:122b9dc19fb214108e493103323c5572cf258d2e744d41611aa1e3d5c1cf8586 3 | size 1891966 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 400H 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:98746cf2a33cc4974badb981b7c415f46ff56eef779a09c5b5969f1d7dbd120b 3 | size 1933029 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji 800Z 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:31204f2698b457a1dccc730b58fa70fe93d4d3e694f70d9d4dc9933cecbac54a 3 | size 1960506 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Astia 100F.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8438929d2db9cdb173c5804b5a78a7da76b76a3b386f179de0e37659e6aecdd4 3 | size 1085300 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28a77d7e1a6648ee868b6a5cc3f2eeadbe5083e494525e04c8c75fcbb06dadcb 3 | size 2118451 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:78d73f7c2eeddf341b57c4d5826ed32862aa56f55bdf1756e337e0f9ac36e757 3 | size 2116761 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b7f7ec3d8dd8dd47f48d67061f56e65d174a26adaec1fb10b58c109cd76363c8 3 | size 2101351 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 4 Alt.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:43f904fba141740ceadeaa3559d37f6a83af4a13f625cacd90ef213d08b2b0f9 3 | size 1058691 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 5 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6309f027469a53e5c0caca39b4d2756d969329c2829affea12c0bb2cfeaae7ba 3 | size 2080916 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 6 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:22bab4e2760c47d9b55fa8e4627696cd7aedc033f9132b01098b92d90578ca2f 3 | size 2093823 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 8 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7b7c90d6400e753e99e41f541dab18932d0dfb6e63f1af82c4d9391625fe5af5 3 | size 2013792 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Provia 100F.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bcc61690ab5d41236e5d777d37ec75156659165d0889ca2448f5c04b0435deb4 3 | size 894969 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Provia 400F.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1576191784c752e8dfeff2d819ffa2851f97065c5ed2569d1d0d75a707be6427 3 | size 1125117 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Provia 400X.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d67cdb5f839395ddf8f22b8ef291d574288fc2891fb7f4058974d672aa6f37e6 3 | size 923190 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Sensia 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7a765ad8fcbc143f2d12f4470b781c101f769881fe0880e0cce28b97817ad9c1 3 | size 878694 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 100 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ce100f8f4cd56ca5bfbfe956d052ed4e55c98cc59adb9892b9ae20254fcdfa18 3 | size 1937088 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a01899672bb1bee89824a2f8141c698ca7252230f853b268377bf01dd46c5f10 3 | size 1144678 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 400 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b3c593577e30f16678f1e14ad8352cb48612918a9be2e2a19ad22658c7b7ea48 3 | size 2033185 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 800 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:121db29aabb10abff42763a3c589cbd8b5e0214dcc542cbcbb1ec1b19706a7a8 3 | size 1998534 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Ektar 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c84bc8368856bc73ccb007c9b1642c755ee5dad74a18ae27cf2f8fd4b36e431b 3 | size 3895589 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a918365f2a14370811f4ac503a9f92eb7afa49bd5ea2c90379c472a3ed948961 3 | size 2007028 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:44863903208f376e80f17291346583f527ffee83a91616f86dbb9579c1f7ada4 3 | size 1972681 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/higher_order_scattering.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:857847f34fc9c856866506015a3d3fc4bd60c18eaf961bde8d6e567df503d6bc 3 | size 8388608 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/higher_order_scattering.exr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ba8a7e76db3f3f2f2bfc655a9bb986e85b1ef2e001085adc9db686ac368a4f5e 3 | size 3583044 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/single_mie_scattering.bin: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d40b0f08cc8cc14ced4f3ea8a83ff9a3a0ee75d8c90665ff456dba176a958ee 3 | size 8388608 4 | -------------------------------------------------------------------------------- /packages/atmosphere/assets/single_mie_scattering.exr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ece93d6c6aca2ed6b30c61c63eeba6294bd872c635ccca53e0359af790e727fe 3 | size 1949394 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/altitude-correction-false.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5e5a1be40cc2c043598765e8a9d3266c8a9ec52459fb5718688618b90e758811 3 | size 208604 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/altitude-correction-true.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:12cc8c2949d477b0694c6bd20ce2517ee50d583886ca224af1914c63c35feb1a 3 | size 219357 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/lunar-radiance-scale-1.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7860a2316b24217a1a07eb2b3d7d6a00ddb4679b0ed21368cae4f55f4639fbc6 3 | size 270520 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/lunar-radiance-scale-5.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8f66851a7fb56e4a8ea0c764c0ad922f5d66563a2b1df6d38dbc11442ad536f2 3 | size 268054 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/sun-angular-radius-default.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a2756235649e37d8404062da5cadea80ba3951dc65b1bdebed17b6e095dc2889 3 | size 246350 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/hdri/wooden_lounge_4k.hdr: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4f35b639371330250d5ef1d0143ea732fde5a1506034b73ca8582e1741776d6a 3 | size 25217583 4 | -------------------------------------------------------------------------------- /storybook-webgpu/assets/littlest_tokyo/emissive.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96ed2c34eaac62e6cf2da12adfa70e80d81990e2b4f561327389ca49f2669b47 3 | size 424058 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Agfa/Agfa Ultra Color 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:27b41faa95debd3d714f85326d15c2ecc4fa8d6d7893c640838b583a8f47098b 3 | size 1091408 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Astia 100 Generic.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e92ab39b56464a6d7489125ae4e6cd9b455a08d7af92b55e23d5d14db0be98b4 3 | size 711107 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c 7 ++ Alt.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c59ac175281bd3a74fbbf524e013a0609e0feb89bc2340ead23f69e29a77b289 3 | size 2006025 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Cool 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:134208f6a32946b2274dd5ad8c4aec1f2c50c0b60c76d840cdb28fed8a0e235f 3 | size 2088965 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Cool 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a2eb0647a7a1ed5ce0feb19fee8b66c36d6d7a2ea527e207168ab6da5ee182e 3 | size 2123986 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Cool 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:eb8b58956424acd884d7d1714b7a5c2420b925ba56bcf64822b1d4a54374f79a 3 | size 2099613 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Cool 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:13e147200e0fd29604ea01c830af5e24192661948d121c8686dd09fa94499f84 3 | size 2115750 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Cool 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:54e0731843e9b2ca2abca5895fc230617fefa995e32f45cc11ef2beae04383d8 3 | size 2106820 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7a06b08ed7b5200bcec84953d9817b64de7f2f90fb5dfc4e6ee5c6755ad99aef 3 | size 2092242 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Provia 100 Generic.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0c19c2f31571417338b02ca0a58b1cf631d8a16a8a5be17263ee1d83eaa1a6cb 3 | size 605115 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 100 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1fc7954649176505f516614f86f8eeed8e973d9ba96200b79b0ca6e56c574743 3 | size 1923747 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 100 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b3d19d1d2ad5ae301ce3081ecda9a9f62920870dcba60e6afa29c5836032e8d 3 | size 1947785 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 100 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:33063bbbf9a7c6581f325b2deaf5c3e0cdec35438189ef154daf3cbeacc90362 3 | size 1964228 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 1600 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:361f8f366caa7756f4fc3ca9fbf1726712cf72bfdff675d04000283412e5f69f 3 | size 2006204 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 1600 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6b04ebb0d736159debfe3d08fb132b32a5ca793012ad585de93587bc8efab44e 3 | size 2012398 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 1600 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:48305b7a441a2af6540104e40c7164669f87d449f7d49d51d5f8720276c49c3e 3 | size 1963520 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 1600 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9d7a5f2f202ebdb1291bd6ff3d2366838ed53adae42c1db137ca2a86cb116301 3 | size 1921524 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 200 XPRO.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f1d7a2a0fd166aa9f8523fb4ed5912da4b365b2180424f4ffb3f4cb4798c81d3 3 | size 1020842 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 400 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8e113380703569a1ed0d6eba6c37fb947072c4e1430a60a72b11d43021a4766b 3 | size 2013814 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 400 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:81444dbf16670d7ccd62c5732854d7c215b49cffc4d5981b00f3b0c1bb0d1d2f 3 | size 2033346 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 400 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d874cc22e36af1b5538ffbd6f0cd7c85cea1239f42e53e39d2fab9e215302302 3 | size 2038963 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 800 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4faa3e041d1e84c898dd36cca2ca3266166a8364c2f56372ffe1b6ef1a62a834 3 | size 2004809 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 800 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:40ffe3d4c813c970764ce9d5691d03374082bb0f5e48cb5eb5b6cf8fe24ee823 3 | size 2030843 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia 800 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:62b7bc7b2ff086acf7b35ff76bb6e55cf7736373667418c70b160f9ccc722abd 3 | size 2001840 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia HG 1600.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f32ddbbead65bacc15032a0f1fc7f12536556a1dbb3bed4449cb1d94ee56b01c 3 | size 948358 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia Reala 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c9b2eed779e91c37005d5310e98b521d4416321350512a288830ccf3ddf3151a 3 | size 1068418 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Superia X-Tra 800.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:426ddecc1fe3e0efacdba84dd960059135748fa62c951e16fa9deac9ec6a836e 3 | size 1163178 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji Velvia 100 Generic.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4d8e7266229068a1ac4aadeebf1dcb28d7f5f2b385ba059f61c50f777325c7c0 3 | size 734037 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite 100 XPRO.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:34b832630c03fd8d6b6496cafe18da3b2d54c2bcad46eb87c2b32b3341e25b8e 3 | size 1166722 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite Chrome 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bef6469089f2b80055e144858ad7923cd9378327c530a1195acb07bcc9fb0f9a 3 | size 1044092 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite Chrome 400.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7c0f9636a9bed01ccfe4da1db3fefdb995bc5b19c396132b1af4d3ae7f880eb1 3 | size 1118760 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite Color 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb43c3ec8e61709a2e13c8be0801db2b3aef84fe08008989fa896e79c2b8b8a3 3 | size 966505 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite Color 400.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5f8e4cc27ec92bc1110af628045e0a377f623912a66e170c4d889736cc1cedbc 3 | size 1070314 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Kodachrome 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6cf5bb61fcd720004cbf270354e746f25a02ae827234946dd8a14a5709d1397d 3 | size 808331 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Kodachrome 25.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a4c1f44df86c4f55520e9ef94af776ed05d552f00689373ef362431e5a9eb1f5 3 | size 1045808 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Kodachrome 64.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1d96346f4fc1a19f2b0ef018c4b39713319f0b6c7832842993477688a61b7cc8 3 | size 907598 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:54eb9c6d9c6ff62efdcd059637e9f55a7522a949f30bb16854368d01c9fefead 3 | size 1888662 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e6f74fff2da54c92d78f035e7a69f5ebe664ffdab2b89062603e36e0eddc8caf 3 | size 1894949 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2237aa8df9d52ee4dfc3bd226d0d838276ad46e2e82d1335c240f06fb646160f 3 | size 1911170 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6a1724b3edf7d1efd1696cdf3fe3160e3b0e2fb168a6808bb4a02f6af270e271 3 | size 1907143 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 NC 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b0cf570ed2150d713b510319bf896105196dfc59c3e21ec453c5900684a5d576 3 | size 1985840 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 VC 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cf226228f47ea0c906f633a7df3a50297a5161025a2cd538ba21f172bb6d1191 3 | size 2014077 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7e61230367c6b58f749a5c676da6fddd7fdae1b49879c5eebb76eae1bc245d88 3 | size 2007636 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5a89f5dd12753c4daddccbb9b19087a1c89472218fd7c3086e6eb37b2aac3bb1 3 | size 2025122 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:31966c31d50d6ede1c680ea19b86abafa3ac8c460c656b85a13fd4d033b17463 3 | size 2022347 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:004277507d43e868eb0ec2428ed45f446c9dc5f8a9feb3aad8f6e94317e5ba87 3 | size 2051009 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 NC 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0490ca2bb916986b7866d6dcc75a5e98473f16124cbac8b54fcdc9327b6dbed9 3 | size 2007458 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 UC 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c8a9a658e7a87eb03dd3e8978c1307660208002c3f055541b03d0c0d61bc16e4 3 | size 2052677 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 VC 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b2b9aa9dff77080d64cb3f7d5e57abeb0329569ba1e26caceab9e31560eadd34 3 | size 2009349 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 800 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d6b3db6301c2524d8bdebe864cbddd455c03fe3abd9830f7fec770ebfa577953 3 | size 1923006 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 800 2.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96cce024d81d19ab58c9e4a4a02aec554c54414ae91ad3f6178629e542ac93eb 3 | size 1947302 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 800 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b6b7b1d73f6594dfe408743eb670ba31fd570375a126dd45aabffd821703c805 3 | size 1972878 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 800 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ae668a7541a53aea7669a84909b7b33e0cf54f228c1610c7da5cb3deec3dc054 3 | size 2021347 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 800 HC.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2802bb2e6a587e02e9795040eed6463a9c032c9b2545106e8208b524c23b3595 3 | size 1932252 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cdb6719fd585dc2250d0fb8f3b909ccb91952c812cfeec0699d40d76f5b46066 3 | size 2043337 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5782db31c57226c3619867559fd355f83b14f213c8238341f8f34c1d66b1bf2b 3 | size 2042413 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:05a5990f9c929d9835826caa3cbc0a948e79aa643c965141f3c41222f60e14cc 3 | size 1952448 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7f893f84ba0f7dadd30f6d599f3cb74c729cd9e77d5e5ab22d0c93a71b66ca80 3 | size 1900243 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 6 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:24d738af2c177fc485fce27e1a810e985a8058fb77e16222c9402e7683dd2b62 3 | size 1869486 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 Cold 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:afe43fac64ece8f04496139682baf2929e18a2fcbdc73354741c6d9936a699c6 3 | size 1975074 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0d51673b6d6df97cfe1a45b8a5adb9f45ca0526338ad461d424bbd686ef55941 3 | size 1910070 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:46cda06bf97e7274db90c185497fb91453f5afa40e475767475a228335900924 3 | size 1965164 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:637d0ba8258a618bce9538d467f5afd8b174c158066bddfa4c2ab2444f527875 3 | size 1995532 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:126c4d197bdd0bd8a1053e87182b43fe9735beaf804617a3daa74029e22882bf 3 | size 1917240 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Cold 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f75527df381e27bd6c808f12dd4aa081d9d2324b34ff0029fd4a9265002f66a0 3 | size 2017642 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Warm 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b0e233fbd9368da1eb2eeac42e5f27d17b7091c5a24ab95affb18bfda4d870e7 3 | size 1926495 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9441c68649c1d12ebdd6de724754530caa948dd8c8a0143fef2101ee6691a32d 3 | size 2021403 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c849b2218e97859b859c614169522f0484ce3ec6e883f2a42236174887d73354 3 | size 1986636 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e6cb16db7e7b20fc491d18a2e79a1f4385df5cb3531b0e162ab4ad80be131b9d 3 | size 1968163 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88f9cb9efea79ed141a1483d119b0274c012c2a87b25f60c2387365dff8c3052 3 | size 1996066 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ab2db588d9fd524ab23d2dc1089d8479e04b5cadea2f4baf5726545564b9f84c 3 | size 1998306 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:79138bd0a580cd8c3e73bf32931f26929db95e9827101dc229d0e4024892d1c7 3 | size 1957870 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a5a2c626b82dc58b35c58bf053b3aa2340ae80edd424c01c8077fecdcfbbe1b9 3 | size 1968706 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:18407ba0cd53397e337c3450a6d61329266c3af11ad19d0039175f4658ba0ba5 3 | size 1900030 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Polachrome.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9ebc48ad8670700858845ac8c4a5fc5428faee618bd4bb295f9cd5cb2c677aca 3 | size 921362 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/README.md: -------------------------------------------------------------------------------- 1 | Source: https://rawpedia.rawtherapee.com/Film_Simulation 2 | 3 | ```sh 4 | magick hald:8 -depth 8 {in} -hald-clut {out} 5 | optipng -o1 -silent {inout} 6 | ``` 7 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/correct-geometric-error-false.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0026c45431099ed8151062f42fda885c3bd081b67ac3867aa6f98a6d4ad5da54 3 | size 211828 4 | -------------------------------------------------------------------------------- /packages/atmosphere/docs/correct-geometric-error-true.jpg: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fd98c653cbf066388c0e93066d9a5476bebc5638dfdb0f85941a3d1b846627e2 3 | size 199891 4 | -------------------------------------------------------------------------------- /storybook-webgpu/src/core/README.mdx: -------------------------------------------------------------------------------- 1 | import ReadMe from '../../../packages/core/WEBGPU.md?raw' 2 | 3 | import { Markdown } from '@storybook/addon-docs/blocks' 4 | 5 | {ReadMe} 6 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ddf23bc9a2276dff7b5a4ae81d3cd6c966f080c66d28dad4bf2d11d22166f1c5 3 | size 2108293 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:83de1238bef93cae3b3f4e5416ad31cbbda08decb4c1a2c9fdc9d5755ebd06b3 3 | size 2051580 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2f9c55826423c1d53dfa29f30360935205c30832c39b6af6f0881b31fd11a5cf 3 | size 2079796 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:76acd0554d1c94faff9e530200ac416030bc3ff0e339159ddeb6f3e11c95735f 3 | size 2022877 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 7 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d09b26ff2d9e2f6774cfd8db8161285c10ba594423f1b8c61293248292751394 3 | size 2000142 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Ektachrome 100 VS.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f18ce1537f367bc3dda3f6fa0c911d969e3713556daa401f708e88c5d372771c 3 | size 1037885 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Elite ExtraColor 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:02fe3c312c3a0c9068a77f76fcaac66a0f6b1b8d5df5f06912d0d2e497189ac3 3 | size 1114078 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Kodachrome 64 Generic.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b437aa5f658d52224313674caa69eb1567afc81d75648f167be5c8a5a7a48c42 3 | size 820126 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 NC 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96a68c8170fcc1cf6a7a200d51507138814d07cef11b9a354a7bd3bd7ab14c22 3 | size 1968964 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 NC 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:806af9fe9bb350ee2b6cb6774e6726b76eb3820aafe24624ae917783d6f34699 3 | size 2021928 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 NC 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9b2e8cd1aee2ba15d073458d14c95a599c062fa7712f9456b22593eeb2bd2eb4 3 | size 1962849 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 VC 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6dc9edc6f881056bf722abfefb74fee7d995f946194f875993670578e044bbad 3 | size 1995214 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 VC 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:999728c37912e299b5033d9b3942fc9908d35b90b4747b07f0f24a050f566094 3 | size 2008177 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 160 VC 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:28d7c629d570a718bd61290be9ec2b7de1a25011e951c3d69aab3368ad0594b5 3 | size 2003324 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 NC 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:88ae3fd04dfa99ba1899832ba1f0305d0e576b10d7903305a2dbd11bb5734f1a 3 | size 1983841 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 NC 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:806af9fe9bb350ee2b6cb6774e6726b76eb3820aafe24624ae917783d6f34699 3 | size 2021928 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 NC 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9152a2763ea22a1c73fac4f9f0ccfb61e21231df4253009ca0752e8ce385d8a8 3 | size 2036444 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 UC 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:66c5f9a2d35a0b74259cefc046644cbff86d7146009af999920b6106720444b1 3 | size 2033406 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 UC 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fb9399cf4d7829aea52145e9ccf5b34d9bafc85e889b262fdbe8daa40fc2c696 3 | size 2031989 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 UC 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0492caa052f6af6dd3d2d4e4ca423adb73abfc0855ca7f9d6e9cef648ea82058 3 | size 2052912 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 VC 1 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a875626c64884866f07fcc6d9b737cbef44d1d2611241c4030597c9ef2e302d4 3 | size 1997829 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 VC 3 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf2f7c0c19927efc5a4da9a9e20621d8549516cc796217cad06919356609ce23 3 | size 1993430 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Portra 400 VC 4 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:911e4d5fde33997171049f9146f817e79c18d76e7011e54983afc91dbdc91521 3 | size 2009395 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 Cold 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:10defbab459fb0c2661656cc3ffa861abbd72fb3cd565a3255405e5d065d7ea6 3 | size 1982895 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 Cold 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:98e5afd56df4f177e2f91949c54fbf5f0c2761cbc8da603c9d279fea5a2cc2e6 3 | size 1980614 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 669 Cold 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:c8ccac18263cbb0505bdd25c28a2b9766c5e667fd0dcb6bd28675e6ba6b57782 3 | size 1956292 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Cold 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5bdcf035c0c517923c61ada85baa85077d346da071055f1935e4788cdad2743c 3 | size 1972457 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Cold 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9c4d524c633eb660c1d7a9ba4dc3fae23879b9540d4a0cee77efe29b2d534614 3 | size 2000408 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Cold 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a8ee9e1111fe920fbef3e0df04eed2e814c3ded1806d103d09d2825c0f2d286f 3 | size 2027761 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Cold 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9776397241703e919c37eb86f7fe4ac11f31a75b3128023a844c527c63285510 3 | size 1937542 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Warm 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:96ad67244ddbab5edcadfc13ddcbfdb07a8217e74b59e0650861c1dc67c43dbd 3 | size 1899238 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Warm 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:38b6e54ad0b16f16e4234be08cef93f5e731061bfa47bdb50c14f13cc16e3def 3 | size 1911692 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Warm 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:04717f9a5df7c61fea5da1e6b3b0ac28c334d02c7291c62c6d167c6e30a9eb7c 3 | size 1947795 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid 690 Warm 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:ae7e3ffca5b147701add1443b7d367dc19c579aac6087b631bff4792f54620cc 3 | size 1930686 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e454f1ed13860e1adb485fa701b10e948dfde7de3f3d4749c9a063f61823aba4 3 | size 2033061 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:21fe7a89ed87725d633b5b29b4754ab8f5d970488389bc1169a90dba9a401861 3 | size 1956256 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:99ca4b96e1ab0cb083bbca9f79586296856c665ce1beef8096fd8b85425b9d68 3 | size 2013754 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:21674c19c5d76c5bc9dbc0003be48f71c8643d5a873ffc4a608357fc5701124f 3 | size 2018662 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:b8da2766b452cce280462981cc9fda11cbdbbffee084bf53f54f6a027a105741 3 | size 2017333 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Warm 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1b84f3c7b94f23fc2c787074952c41ed108aeea2a64cb09eab3b163fcfd022a9 3 | size 1964700 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Warm 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:53c3b35b4c82c2b563a06472cd5dab165bbe440e2eb71a456912823cea3d808c 3 | size 1938701 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Warm 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:60635059a0e5eecbae04a3a38b880c2d6a71d4dbcfce266963e3bb428bc6e2e8 3 | size 1919687 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 6 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f97de538b017f1930300a89fe32cec984bc7162c3983057012f92df5f6d44838 3 | size 1814782 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Cold 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:aa817f4a553039e3fcec16e1d8220df3db194a353214ef757f07642b762b8e45 3 | size 2031135 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Cold 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a8b62cba2a7d5fcd93258d0b1012d8ada63a70ee0dbb79c2d81f96eefad52abd 3 | size 1976549 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Cold 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3d0494142ca6c3bd072f538438f75868a9fd001a433259422eacc86c4801ff79 3 | size 1976752 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Cold 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:435e86b7a4b4157453405688427fc4fcbb6a6d35f8a10d7c03dff235177e4536 3 | size 1972178 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Cold 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4a0a7a98c1d4b5d539550c5ad97f3c3acad9adbc81fdc976dc7edd7341973575 3 | size 1886509 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Warm 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:76a9645e1e83cee0d7470f3f8721de06876a9cb9a379975c65e91264015f89dc 3 | size 2007058 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Warm 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0c3d6adfd2c7dcbaf5dfc93d47057343204e407c2833a8d61fdccade15918c77 3 | size 1970620 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Warm 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc9ed4e57995959a3dbc4ec144261fc07f78afc832263f2cfa65c7bf6410c45b 3 | size 1955563 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Warm 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:759b9f9999b83e94db59240b1b02132ddb33d8d0fc86cd8ada0960e0d94965bc 3 | size 1979000 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-70 Warm 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:3e550f5ee488b154a654ba2b8d9ea6f7e550e7693abe12d6458b843f16a1eb12 3 | size 1911674 4 | -------------------------------------------------------------------------------- /storybook/src/clouds/README.mdx: -------------------------------------------------------------------------------- 1 | import ReadMe from '../../../packages/clouds/README.md?raw' 2 | 3 | import { Markdown } from '@storybook/addon-docs/blocks' 4 | 5 | {ReadMe} 6 | -------------------------------------------------------------------------------- /storybook/assets/clut/Fuji/Fuji FP-100c Negative 6 ++ Alt.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a76708b68ee09b25835676eae7e6aff5ef2be5182c6c20350511f9fe01af290d 3 | size 2047463 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak E-100 GX Ektachrome 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f6eb111dbebe8fa7c0f8fd7f60582ecaed251ece023dda4c5bb78ec595283b73 3 | size 1036072 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Kodak/Kodak Ektachrome 100 VS Generic.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:565d0d3ec441f88a91f273a87707fad4fedd9e494e9d4d931098abfa1a8a4009 3 | size 887788 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Lomography/Lomography Redscale 100.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a04fed62a27134dce81e1225b0b2af536e2cb5f8df7ac4e72d7d73fd0feb1be8 3 | size 1211120 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Lomography/Lomography X-Pro Slide 200.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f664496444f00dab6c63fb7e5ad943a355f9670b2b12688609dc50e50c33dd35 3 | size 1033924 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a1f7971bd3991d55fd5cc96540b7c33fba1e3e4eeffe0ca292e145ba456e78af 3 | size 1547514 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0b7cd04571c81ebbb37c5862d020945654ae5bc375977da7f89faa05246fcc92 3 | size 1524635 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:7c6f998c12f898f8a292d58964057e2fec35669a51552af53738fcb34413d1b0 3 | size 1524790 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fc3541beacfa35ccaf99c31b3996e4d1d38a7608d27a7f1d1595552fd848f31c 3 | size 1513850 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a8518fc14026ace42c251f9ca76627889a0e9f037ddfef02f4030f302623c130 3 | size 1485766 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Cold 6 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9cf7d90de8a93438c06378edbd8880d70715967ac88afeff8c366602d4e428e8 3 | size 1506634 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6cebb98dece70196565b109fb2f6403ae0cdafb2b1b2921590d5565a7aaebc2c 3 | size 1543216 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 2 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:2af6124afda369d2170e810012ababbb68e9fa4767cb3d48b27b3147a496e212 3 | size 1510483 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 3.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a40965fae09a1c7f8f5f4f493715866f385eec900eb72f6665f55c0351749552 3 | size 1495282 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 4 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:fa77ad9d6e24ada5290da255b1926bed62bb3bdce414d2d4e20635bc350dd7b9 3 | size 1439511 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a5bb47e3a594a7bf6ccfbb44fdae3d0f75911fa1be5f31dd397b3de36a6c8dd6 3 | size 1421414 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-100UV+ Warm 6 +++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:db67d9174f9ca5f7a0893f2024091199f6e08d0613358a4ebf6008f44c3bc338 3 | size 1472809 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a7e035d704838e37ae1263ae5acdbf7bafeba0111362fd8811c506e8f461f51b 3 | size 1997359 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:413374a34b6d03d5419b08e620e7680ace78c61afdf192d4f228ec7cea7a5c70 3 | size 1957669 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Cold 6 ++ Alt.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:bf07595ee683689c11d86c5527a1c7d4adb5380654cf0e7a5278b4fcec95434d 3 | size 1913061 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Warm 1 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8803054b38b88d90db200b7ad5932bba1bfeedd6d67d0c9360935b6413f2997d 3 | size 1973330 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid PX-680 Warm 5 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cb1332a74f1cb36eea7e8de0a00dfed1ac5a6b7a00a1ebabe02f0957583bd0b2 3 | size 1937045 4 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/README.mdx: -------------------------------------------------------------------------------- 1 | import ReadMe from '../../../packages/atmosphere/README.md?raw' 2 | 3 | import { Markdown } from '@storybook/addon-docs/blocks' 4 | 5 | {ReadMe} 6 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 1 ---.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:f8007c040adac0b19430ab04bd0beb3dd69b5f5661b45c0f1696eb4cff9c19d9 3 | size 1865391 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 2 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5787c65a094cd487c38d454a3e3cfdc79ea8264154acb2db17400cbeb49dc89d 3 | size 1829263 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 3 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d5f878a2e909a51951e810167e377387f2d317c8a1a7a860d1551bcb5715c2c1 3 | size 1718231 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 4.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:0769ac2fea1946c9c0d1ba24cf1d5cd4d826a898a6a489fba407161f722e8f14 3 | size 1689497 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 5 +.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:876046b78866c5f980732c390126d3e52ca906ab0cda175065e84bb73273063d 3 | size 1560979 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) 6 ++.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1528440ca5632c2a2081c84654f18ca04529c55a73d8552bea219caa39d5f1d0 3 | size 1640537 4 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/README.mdx: -------------------------------------------------------------------------------- 1 | import ReadMe from '../../../packages/atmosphere/WEBGPU.md?raw' 2 | 3 | import { Markdown } from '@storybook/addon-docs/blocks' 4 | 5 | {ReadMe} 6 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) Cold 1 ---.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4514e0ebe273119f93882788e3e2c365c591f036029219d63bfdecbea11c3db3 3 | size 1878814 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) Cold 2 --.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:d645311eda8ef1d61520e314ade112aa8e57c76e5e4aeb1077294907ca20709d 3 | size 1842384 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) Cold 3 -.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4704955dde51fa5e3481a6aef27e208902f9245716eb615c68435ebdafde69cc 3 | size 1767505 4 | -------------------------------------------------------------------------------- /storybook/assets/clut/Polaroid/Polaroid Time Zero (Expired) Cold 4.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1ea8595d9ed1aadcad7c07f8c96579aa0d6b5d6c6d2bc61348dbafa513afa997 3 | size 1685441 4 | -------------------------------------------------------------------------------- /packages/effects/src/r3f/Dithering.tsx: -------------------------------------------------------------------------------- 1 | import { wrapEffect } from '@react-three/postprocessing' 2 | 3 | import { DitheringEffect } from '../DitheringEffect' 4 | 5 | export const Dithering = wrapEffect(DitheringEffect) 6 | -------------------------------------------------------------------------------- /packages/effects/src/r3f/index.ts: -------------------------------------------------------------------------------- 1 | export * from './Depth' 2 | export * from './Dithering' 3 | export * from './EffectComposer' 4 | export * from './Geometry' 5 | export * from './LensFlare' 6 | export * from './Normal' 7 | -------------------------------------------------------------------------------- /packages/clouds/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/react/babel", 5 | { 6 | "runtime": "automatic", 7 | "useBuiltIns": "usage" 8 | } 9 | ] 10 | ], 11 | "plugins": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/react/babel", 5 | { 6 | "runtime": "automatic", 7 | "useBuiltIns": "usage" 8 | } 9 | ] 10 | ], 11 | "plugins": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/effects/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/react/babel", 5 | { 6 | "runtime": "automatic", 7 | "useBuiltIns": "usage" 8 | } 9 | ] 10 | ], 11 | "plugins": [] 12 | } 13 | -------------------------------------------------------------------------------- /packages/atmosphere/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@nx/react/babel", 5 | { 6 | "runtime": "automatic", 7 | "useBuiltIns": "usage" 8 | } 9 | ] 10 | ], 11 | "plugins": [] 12 | } 13 | -------------------------------------------------------------------------------- /storybook-webgpu/.storybook/manager.ts: -------------------------------------------------------------------------------- 1 | import { addons } from 'storybook/manager-api' 2 | 3 | import { main } from './theme' 4 | 5 | addons.setConfig({ 6 | theme: main, 7 | initialActive: 'canvas', 8 | panelPosition: 'right' 9 | }) 10 | -------------------------------------------------------------------------------- /types/postprocessing.d.ts: -------------------------------------------------------------------------------- 1 | import type { Camera, Material } from 'three' 2 | 3 | declare module 'postprocessing' { 4 | interface DepthMaskMaterial { 5 | fullscreenMaterial: Material 6 | copyCameraSettings: (camera: Camera) => void 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/clouds/src/shaders/shadow.vert: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | 3 | layout(location = 0) in vec3 position; 4 | 5 | out vec2 vUv; 6 | 7 | void main() { 8 | vUv = position.xy * 0.5 + 0.5; 9 | gl_Position = vec4(position.xy, 1.0, 1.0); 10 | } 11 | -------------------------------------------------------------------------------- /storybook/.storybook/theme.ts: -------------------------------------------------------------------------------- 1 | import { create } from 'storybook/theming' 2 | 3 | export default create({ 4 | base: 'light', 5 | brandTitle: '@takram/three-geospatial', 6 | brandUrl: 'https://github.com/takram-design-engineering/three-geospatial/' 7 | }) 8 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | /dist 3 | /coverage 4 | /.nx/cache 5 | /.nx/workspace-data 6 | /pnpm-lock.yaml 7 | /tsconfig.base.json 8 | *.bin 9 | *.jpg 10 | *.png 11 | *.webp 12 | *.hdr 13 | *.exr 14 | *.glb 15 | -------------------------------------------------------------------------------- /packages/clouds/src/shaders/cloudsResolve.vert: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | 3 | layout(location = 0) in vec3 position; 4 | 5 | out vec2 vUv; 6 | 7 | void main() { 8 | vUv = position.xy * 0.5 + 0.5; 9 | gl_Position = vec4(position.xy, 1.0, 1.0); 10 | } 11 | -------------------------------------------------------------------------------- /packages/clouds/src/shaders/shadowResolve.vert: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | 3 | layout(location = 0) in vec3 position; 4 | 5 | out vec2 vUv; 6 | 7 | void main() { 8 | vUv = position.xy * 0.5 + 0.5; 9 | gl_Position = vec4(position.xy, 1.0, 1.0); 10 | } 11 | -------------------------------------------------------------------------------- /storybook/.storybook/style.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | #storybook-root { 4 | width: 100%; 5 | height: 100%; 6 | font-family: 'DM Sans', sans-serif; 7 | } 8 | 9 | a { 10 | color: inherit; 11 | &:hover { 12 | text-decoration: none; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /storybook/src/worker/worker.ts: -------------------------------------------------------------------------------- 1 | /* eslint-env worker */ 2 | 3 | import workerpool from 'workerpool' 4 | 5 | import { toCreasedNormals } from './tasks/toCreasedNormals' 6 | 7 | export const methods = { toCreasedNormals } 8 | 9 | workerpool.worker(methods) 10 | -------------------------------------------------------------------------------- /storybook-webgpu/src/worker/worker.ts: -------------------------------------------------------------------------------- 1 | /* eslint-env worker */ 2 | 3 | import workerpool from 'workerpool' 4 | 5 | import { toCreasedNormals } from './tasks/toCreasedNormals' 6 | 7 | export const methods = { toCreasedNormals } 8 | 9 | workerpool.worker(methods) 10 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/ditheringEffect.frag: -------------------------------------------------------------------------------- 1 | #define DITHERING 2 | 3 | #include 4 | 5 | void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { 6 | outputColor = vec4(saturate(dithering(inputColor.rgb)), inputColor.a); 7 | } 8 | -------------------------------------------------------------------------------- /storybook-webgpu/.storybook/style.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | #storybook-root { 4 | width: 100%; 5 | height: 100%; 6 | font-family: 'Inter', sans-serif; 7 | line-height: 1.6; 8 | } 9 | 10 | a { 11 | color: inherit; 12 | &:hover { 13 | text-decoration: none; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/effects/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './createHaldLookupTexture' 2 | export * from './DepthEffect' 3 | export * from './DitheringEffect' 4 | export * from './GeometryPass' 5 | export * from './LensFlareEffect' 6 | export * from './NormalEffect' 7 | export * from './setupMaterialsForGeometryPass' 8 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/lensFlareFeatures.vert: -------------------------------------------------------------------------------- 1 | uniform vec2 texelSize; 2 | 3 | out vec2 vUv; 4 | out vec2 vAspectRatio; 5 | 6 | void main() { 7 | vUv = position.xy * 0.5 + 0.5; 8 | vAspectRatio = vec2(texelSize.x / texelSize.y, 1.0); 9 | gl_Position = vec4(position.xy, 1.0, 1.0); 10 | } 11 | -------------------------------------------------------------------------------- /storybook/.storybook/manager.ts: -------------------------------------------------------------------------------- 1 | import { addons } from 'storybook/manager-api' 2 | 3 | import theme from './theme' 4 | 5 | addons.setConfig({ 6 | theme, 7 | initialActive: 'canvas', 8 | // https://github.com/storybookjs/storybook/issues/7149#issuecomment-2096502983 9 | bottomPanelHeight: 0 10 | }) 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /packages/core/src/shaders/generators.glsl: -------------------------------------------------------------------------------- 1 | float checker(const vec2 uv, const vec2 repeats) { 2 | vec2 c = floor(repeats * uv); 3 | float result = mod(c.x + c.y, 2.0); 4 | return sign(result); 5 | } 6 | 7 | float checker(const vec2 uv, const float repeats) { 8 | return checker(uv, vec2(repeats)); 9 | } 10 | -------------------------------------------------------------------------------- /storybook/src/effects/GBuffer.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './GBuffer-Basic' 4 | 5 | export default { 6 | title: 'effects/G-Buffer', 7 | parameters: { 8 | layout: 'fullscreen' 9 | } 10 | } satisfies Meta 11 | 12 | export const Basic = _Basic 13 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.bin filter=lfs diff=lfs merge=lfs -text 2 | *.jpg filter=lfs diff=lfs merge=lfs -text 3 | *.png filter=lfs diff=lfs merge=lfs -text 4 | *.webp filter=lfs diff=lfs merge=lfs -text 5 | *.hdr filter=lfs diff=lfs merge=lfs -text 6 | *.exr filter=lfs diff=lfs merge=lfs -text 7 | *.glb filter=lfs diff=lfs merge=lfs -text 8 | -------------------------------------------------------------------------------- /packages/core/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "core", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/core/src", 5 | "projectType": "library", 6 | "tags": ["type:lib"], 7 | "targets": { 8 | "build": { 9 | "dependsOn": ["typecheck"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /storybook/src/effects/LensFlare.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './LensFlare-Basic' 4 | 5 | export default { 6 | title: 'effects/Lens Flare', 7 | parameters: { 8 | layout: 'fullscreen' 9 | } 10 | } satisfies Meta 11 | 12 | export const Basic = _Basic 13 | -------------------------------------------------------------------------------- /packages/clouds/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "clouds", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/clouds/src", 5 | "projectType": "library", 6 | "tags": ["type:lib"], 7 | "targets": { 8 | "build": { 9 | "dependsOn": ["typecheck"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/core/src/shaders/interleavedGradientNoise.glsl: -------------------------------------------------------------------------------- 1 | // Reference: https://advances.realtimerendering.com/s2014/index.html#_NEXT_GENERATION_POST 2 | 3 | float interleavedGradientNoise(const vec2 coord) { 4 | const vec3 magic = vec3(0.06711056, 0.00583715, 52.9829189); 5 | return fract(magic.z * fract(dot(coord, magic.xy))); 6 | } 7 | -------------------------------------------------------------------------------- /storybook/src/core/Camera.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _PointOfView from './Camera-PointOfView' 4 | 5 | export default { 6 | title: 'core/Camera', 7 | parameters: { 8 | layout: 'fullscreen' 9 | } 10 | } satisfies Meta 11 | 12 | export const PointOfView = _PointOfView 13 | -------------------------------------------------------------------------------- /packages/effects/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "effects", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/effects/src", 5 | "projectType": "library", 6 | "tags": ["type:lib"], 7 | "targets": { 8 | "build": { 9 | "dependsOn": ["typecheck"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/effects/src/r3f/Depth.tsx: -------------------------------------------------------------------------------- 1 | import { wrapEffect } from '@react-three/postprocessing' 2 | import type { ComponentPropsWithoutRef } from 'react' 3 | 4 | import { DepthEffect } from '../DepthEffect' 5 | 6 | export const Depth = wrapEffect(DepthEffect) 7 | 8 | export interface DepthProps extends ComponentPropsWithoutRef {} 9 | -------------------------------------------------------------------------------- /packages/atmosphere/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atmosphere", 3 | "$schema": "../../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "packages/atmosphere/src", 5 | "projectType": "library", 6 | "tags": ["type:lib"], 7 | "targets": { 8 | "build": { 9 | "dependsOn": ["typecheck"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/atmosphere/src/r3f/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AerialPerspective' 2 | export * from './Atmosphere' 3 | export * from './LightingMask' 4 | export * from './separateProps' 5 | export * from './Sky' 6 | export * from './SkyLight' 7 | export * from './Stars' 8 | export * from './SunLight' 9 | export * from './useAtmosphereTextureProps' 10 | -------------------------------------------------------------------------------- /apps/data/download.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | readonly root="$(cd "$(dirname "$0")"; pwd)" 4 | 5 | mkdir -p "${root}/data" 6 | 7 | curl http://tdc-www.harvard.edu/catalogs/ybsc5.gz | gunzip - >"${root}/data/ybsc5" 8 | curl --location https://github.com/NVIDIAGameWorks/SpatiotemporalBlueNoiseSDK/raw/refs/heads/main/STBN.zip | bsdtar -x --directory "${root}/data" 9 | -------------------------------------------------------------------------------- /packages/clouds/src/shaders/types.glsl: -------------------------------------------------------------------------------- 1 | struct GroundIrradiance { 2 | vec3 sun; 3 | vec3 sky; 4 | }; 5 | 6 | struct CloudsIrradiance { 7 | vec3 minSun; 8 | vec3 minSky; 9 | vec3 maxSun; 10 | vec3 maxSky; 11 | }; 12 | 13 | struct CloudDensityProfile { 14 | vec4 expTerms; 15 | vec4 exponents; 16 | vec4 linearTerms; 17 | vec4 constantTerms; 18 | }; 19 | -------------------------------------------------------------------------------- /apps/data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "files": [], 4 | "include": [], 5 | "references": [ 6 | { 7 | "path": "./tsconfig.app.json" 8 | }, 9 | { 10 | "path": "./tsconfig.spec.json" 11 | } 12 | ], 13 | "compilerOptions": { 14 | "esModuleInterop": true, 15 | "jsx": "preserve" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/useMaybeMotionValue.ts: -------------------------------------------------------------------------------- 1 | import { MotionValue, motionValue } from 'motion/react' 2 | import { useMemo } from 'react' 3 | 4 | export function useMaybeMotionValue( 5 | value: T | MotionValue 6 | ): MotionValue { 7 | return useMemo( 8 | () => (value instanceof MotionValue ? value : motionValue(value)), 9 | [value] 10 | ) 11 | } 12 | -------------------------------------------------------------------------------- /storybook-webgpu/.storybook/preview-head.html: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | -------------------------------------------------------------------------------- /apps/data/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "moduleResolution": "node10", 7 | "types": ["jest", "node"] 8 | }, 9 | "include": [ 10 | "jest.config.ts", 11 | "src/**/*.test.ts", 12 | "src/**/*.spec.ts", 13 | "src/**/*.d.ts" 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /apps/data/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "preserve", 6 | "moduleResolution": "bundler", 7 | "types": ["node"] 8 | }, 9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], 10 | "include": ["src/**/*.ts", "../../types/**/*.ts", "types.d.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/core/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const STBN_TEXTURE_WIDTH = 128 2 | export const STBN_TEXTURE_HEIGHT = 128 3 | export const STBN_TEXTURE_DEPTH = 64 4 | 5 | // Reference to the latest assets. 6 | const ref = '9627216cc50057994c98a2118f3c4a23765d43b9' 7 | export const DEFAULT_STBN_URL = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${ref}/packages/core/assets/stbn.bin` 8 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/Sky.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './Sky-Basic' 4 | import _EnvironmentMap from './Sky-EnvironmentMap' 5 | 6 | export default { 7 | title: 'atmosphere/Sky', 8 | parameters: { 9 | layout: 'fullscreen' 10 | } 11 | } satisfies Meta 12 | 13 | export const Basic = _Basic 14 | export const EnvironmentMap = _EnvironmentMap 15 | -------------------------------------------------------------------------------- /storybook/src/worker/transfer.ts: -------------------------------------------------------------------------------- 1 | import workerpool from 'workerpool' 2 | 3 | // Type parameter is for inference. 4 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 5 | export interface TransferResult {} 6 | 7 | export function Transfer( 8 | message: T, 9 | transfer: Transferable[] 10 | ): TransferResult { 11 | return new workerpool.Transfer(message, transfer) 12 | } 13 | -------------------------------------------------------------------------------- /storybook-webgpu/src/worker/transfer.ts: -------------------------------------------------------------------------------- 1 | import workerpool from 'workerpool' 2 | 3 | // Type parameter is for inference. 4 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 5 | export interface TransferResult {} 6 | 7 | export function Transfer( 8 | message: T, 9 | transfer: Transferable[] 10 | ): TransferResult { 11 | return new workerpool.Transfer(message, transfer) 12 | } 13 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/bruneton/index.ts: -------------------------------------------------------------------------------- 1 | import _common from './common.glsl?raw' 2 | import _definitions from './definitions.glsl?raw' 3 | import _precompute from './precompute.glsl?raw' 4 | import _runtime from './runtime.glsl?raw' 5 | 6 | export const runtime: string = _runtime 7 | export const common: string = _common 8 | export const definitions: string = _definitions 9 | export const precompute: string = _precompute 10 | -------------------------------------------------------------------------------- /packages/core/src/shaders/transform.glsl: -------------------------------------------------------------------------------- 1 | vec3 screenToView( 2 | const vec2 uv, 3 | const float depth, 4 | const float viewZ, 5 | const mat4 projectionMatrix, 6 | const mat4 inverseProjectionMatrix 7 | ) { 8 | vec4 clip = vec4(vec3(uv, depth) * 2.0 - 1.0, 1.0); 9 | float clipW = projectionMatrix[2][3] * viewZ + projectionMatrix[3][3]; 10 | clip *= clipW; 11 | return (inverseProjectionMatrix * clip).xyz; 12 | } 13 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/lensFlareEffect.frag: -------------------------------------------------------------------------------- 1 | uniform sampler2D bloomBuffer; 2 | uniform sampler2D featuresBuffer; 3 | uniform float intensity; 4 | 5 | void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { 6 | vec3 bloom = texture(bloomBuffer, uv).rgb; 7 | vec3 features = texture(featuresBuffer, uv).rgb; 8 | outputColor = vec4(inputColor.rgb + (bloom + features) * intensity, inputColor.a); 9 | } 10 | -------------------------------------------------------------------------------- /storybook/src/helpers/states.ts: -------------------------------------------------------------------------------- 1 | import { atom, type SetStateAction } from 'jotai' 2 | 3 | export const googleMapsApiKeyAtom = atom('') 4 | 5 | export const needsApiKeyPrimitiveAtom = atom(false) 6 | export const needsApiKeyAtom = atom( 7 | get => get(needsApiKeyPrimitiveAtom) && get(googleMapsApiKeyAtom) === '', 8 | (get, set, value: SetStateAction) => { 9 | set(needsApiKeyPrimitiveAtom, value) 10 | } 11 | ) 12 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/utils.ts: -------------------------------------------------------------------------------- 1 | import { NodeBuilder, type Renderer } from 'three/webgpu' 2 | 3 | export function isWebGPU( 4 | target: NodeBuilder | Renderer | Renderer['backend'] 5 | ): boolean { 6 | const backend = 7 | target instanceof NodeBuilder 8 | ? target.renderer.backend 9 | : 'backend' in target 10 | ? target.backend 11 | : target 12 | return backend.isWebGPUBackend === true 13 | } 14 | -------------------------------------------------------------------------------- /storybook-webgpu/src/helpers/StoryContext.ts: -------------------------------------------------------------------------------- 1 | import type { Args } from '@storybook/react-vite' 2 | import { atom, type PrimitiveAtom } from 'jotai' 3 | import { createContext } from 'react' 4 | 5 | export interface StoryContextValue { 6 | argsAtom: PrimitiveAtom 7 | updateArgs?: (newArgs: Partial) => void 8 | } 9 | 10 | export const StoryContext = createContext({ 11 | argsAtom: atom({}) 12 | }) 13 | -------------------------------------------------------------------------------- /apps/data/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { type Config } from 'jest' 3 | 4 | export default { 5 | displayName: 'data', 6 | preset: '../../jest.preset.js', 7 | testEnvironment: 'node', 8 | transform: { 9 | '^.+\\.[tj]s$': ['ts-jest', { tsconfig: '/tsconfig.spec.json' }] 10 | }, 11 | moduleFileExtensions: ['ts', 'js', 'html'], 12 | coverageDirectory: '../../coverage/apps/data' 13 | } satisfies Config 14 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/Stars.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './Stars-Basic' 4 | import _BlackBodyChromaticity from './Stars-BlackBodyChromaticity' 5 | 6 | export default { 7 | title: 'atmosphere/Stars', 8 | parameters: { 9 | layout: 'fullscreen' 10 | } 11 | } satisfies Meta 12 | 13 | export const Basic = _Basic 14 | export const BlackBodyChromaticity = _BlackBodyChromaticity 15 | -------------------------------------------------------------------------------- /packages/core/src/shaders/vogelDisk.glsl: -------------------------------------------------------------------------------- 1 | // Reference: https://www.gamedev.net/tutorials/programming/graphics/contact-hardening-soft-shadows-made-fast-r4906/ 2 | 3 | vec2 vogelDisk(const int index, const int sampleCount, const float phi) { 4 | const float goldenAngle = 2.39996322972865332; 5 | float r = sqrt(float(index) + 0.5) / sqrt(float(sampleCount)); 6 | float theta = float(index) * goldenAngle + phi; 7 | return r * vec2(cos(theta), sin(theta)); 8 | } 9 | -------------------------------------------------------------------------------- /storybook/src/core/Ellipsoid.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _EastNorthUp from './Ellipsoid-EastNorthUp' 4 | import _OsculatingSphere from './Ellipsoid-OsculatingSphere' 5 | 6 | export default { 7 | title: 'core/Ellipsoid', 8 | parameters: { 9 | layout: 'fullscreen' 10 | } 11 | } satisfies Meta 12 | 13 | export const EastNorthUp = _EastNorthUp 14 | export const OsculatingSphere = _OsculatingSphere 15 | -------------------------------------------------------------------------------- /packages/clouds/src/shaders/cloudsEffect.frag: -------------------------------------------------------------------------------- 1 | uniform sampler2D cloudsBuffer; 2 | 3 | void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { 4 | #ifdef SKIP_RENDERING 5 | outputColor = inputColor; 6 | #else // SKIP_RENDERING 7 | vec4 clouds = texture(cloudsBuffer, uv); 8 | outputColor.rgb = inputColor.rgb * (1.0 - clouds.a) + clouds.rgb; 9 | outputColor.a = inputColor.a * (1.0 - clouds.a) + clouds.a; 10 | #endif // SKIP_RENDERING 11 | } 12 | -------------------------------------------------------------------------------- /packages/atmosphere/src/webgpu/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AerialPerspectiveNode' 2 | export * from './AtmosphereContextNode' 3 | export * from './AtmosphereLight' 4 | export * from './AtmosphereLightNode' 5 | export * from './AtmosphereLUTNode' 6 | export * from './AtmosphereParameters' 7 | export * from './MoonNode' 8 | export * from './runtime' 9 | export * from './SkyEnvironmentNode' 10 | export * from './SkyNode' 11 | export * from './StarsNode' 12 | export * from './SunNode' 13 | -------------------------------------------------------------------------------- /packages/core/src/types.ts: -------------------------------------------------------------------------------- 1 | import type { FloatType, HalfFloatType, Uniform } from 'three' 2 | 3 | export type Callable = (...args: any) => any 4 | 5 | export type UniformMap = Omit, 'get'> & { 6 | get: (key: K) => T[K] 7 | set: (key: K, value: T[K]) => void 8 | } 9 | 10 | export type AnyFloatType = typeof FloatType | typeof HalfFloatType 11 | 12 | export function reinterpretType(value: unknown): asserts value is T {} 13 | -------------------------------------------------------------------------------- /packages/clouds/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "allowJs": false, 5 | "esModuleInterop": false, 6 | "allowSyntheticDefaultImports": true, 7 | "strict": true, 8 | "types": ["vite/client"] 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.spec.json" 18 | } 19 | ], 20 | "extends": "../../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /packages/core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "allowJs": false, 5 | "esModuleInterop": false, 6 | "allowSyntheticDefaultImports": true, 7 | "strict": true, 8 | "types": ["vite/client"] 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.spec.json" 18 | } 19 | ], 20 | "extends": "../../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /packages/effects/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "allowJs": false, 5 | "esModuleInterop": false, 6 | "allowSyntheticDefaultImports": true, 7 | "strict": true, 8 | "types": ["vite/client"] 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.spec.json" 18 | } 19 | ], 20 | "extends": "../../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /storybook-webgpu/src/plugins/fade/TilesFadePlugin.ts: -------------------------------------------------------------------------------- 1 | import { TilesFadePlugin as TilesFadePluginBase } from '3d-tiles-renderer/plugins' 2 | 3 | import { FadeMaterialManager } from './FadeMaterialManager' 4 | 5 | export class TilesFadePlugin extends TilesFadePluginBase { 6 | declare protected _fadeMaterialManager: unknown 7 | 8 | constructor(...args: ConstructorParameters) { 9 | super(...args) 10 | this._fadeMaterialManager = new FadeMaterialManager() 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/atmosphere/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "allowJs": false, 5 | "esModuleInterop": false, 6 | "allowSyntheticDefaultImports": true, 7 | "strict": true, 8 | "types": ["vite/client"] 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.spec.json" 18 | } 19 | ], 20 | "extends": "../../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /storybook-webgpu/.storybook/theme.ts: -------------------------------------------------------------------------------- 1 | import { create, themes } from 'storybook/theming' 2 | 3 | export const main = create({ 4 | base: 'dark', 5 | brandTitle: '@takram/three-geospatial/webgpu', 6 | brandUrl: 'https://github.com/takram-design-engineering/three-geospatial', 7 | fontCode: `Consolas, ${themes.normal.fontCode}` 8 | }) 9 | 10 | export const docs = create({ 11 | base: 'light', 12 | fontBase: `Inter, ${themes.normal.fontBase}`, 13 | fontCode: `Consolas, ${themes.normal.fontCode}` 14 | }) 15 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/transmittance.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | layout(location = 0) out vec4 transmittance; 11 | 12 | void main() { 13 | transmittance.rgb = ComputeTransmittanceToTopAtmosphereBoundaryTexture( 14 | ATMOSPHERE, 15 | gl_FragCoord.xy 16 | ); 17 | transmittance.a = 1.0; 18 | } 19 | -------------------------------------------------------------------------------- /storybook/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "jsxImportSource": "@emotion/react", 5 | "allowJs": false, 6 | "esModuleInterop": false, 7 | "allowSyntheticDefaultImports": true, 8 | "strict": true 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.storybook.json" 18 | } 19 | ], 20 | "extends": "../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /storybook-webgpu/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "jsx": "react-jsx", 4 | "jsxImportSource": "@emotion/react", 5 | "allowJs": false, 6 | "esModuleInterop": false, 7 | "allowSyntheticDefaultImports": true, 8 | "strict": true 9 | }, 10 | "files": [], 11 | "include": [], 12 | "references": [ 13 | { 14 | "path": "./tsconfig.lib.json" 15 | }, 16 | { 17 | "path": "./tsconfig.storybook.json" 18 | } 19 | ], 20 | "extends": "../tsconfig.base.json" 21 | } 22 | -------------------------------------------------------------------------------- /packages/core/src/shaders/turbo.glsl: -------------------------------------------------------------------------------- 1 | // A fifth-order polynomial approximation of Turbo color map. 2 | // See: https://observablehq.com/@mbostock/turbo 3 | // prettier-ignore 4 | vec3 turbo(const float x) { 5 | float r = 0.1357 + x * (4.5974 - x * (42.3277 - x * (130.5887 - x * (150.5666 - x * 58.1375)))); 6 | float g = 0.0914 + x * (2.1856 + x * (4.8052 - x * (14.0195 - x * (4.2109 + x * 2.7747)))); 7 | float b = 0.1067 + x * (12.5925 - x * (60.1097 - x * (109.0745 - x * (88.5066 - x * 26.8183)))); 8 | return vec3(r, g, b); 9 | } 10 | -------------------------------------------------------------------------------- /packages/core/src/QuadGeometry.ts: -------------------------------------------------------------------------------- 1 | import { BufferGeometry, Float32BufferAttribute, Sphere, Vector3 } from 'three' 2 | 3 | export class QuadGeometry extends BufferGeometry { 4 | constructor() { 5 | super() 6 | this.boundingSphere = new Sphere() 7 | this.boundingSphere.set(new Vector3(), Infinity) 8 | this.setAttribute( 9 | 'position', 10 | new Float32BufferAttribute([-1, 3, 0, -1, -1, 0, 3, -1, 0], 3) 11 | ) 12 | this.setAttribute('uv', new Float32BufferAttribute([0, -1, 0, 1, 2, 1], 2)) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /storybook/src/clouds/BuildingBlocks-Shape.tsx: -------------------------------------------------------------------------------- 1 | import { Canvas } from '@react-three/fiber' 2 | import type { StoryFn } from '@storybook/react-vite' 3 | 4 | import { CloudShape } from '@takram/three-clouds' 5 | 6 | import { Procedural3DTextureViewer } from './helpers/Procedural3DTextureViewer' 7 | 8 | const Story: StoryFn = () => ( 9 | 10 | new CloudShape()} 12 | fileName='shape.bin' 13 | /> 14 | 15 | ) 16 | 17 | export default Story 18 | -------------------------------------------------------------------------------- /storybook/src/clouds/BuildingBlocks-Turbulence.tsx: -------------------------------------------------------------------------------- 1 | import { Canvas } from '@react-three/fiber' 2 | import type { StoryFn } from '@storybook/react-vite' 3 | 4 | import { Turbulence } from '@takram/three-clouds' 5 | 6 | import { ProceduralTextureViewer } from './helpers/ProceduralTextureViewer' 7 | 8 | const Story: StoryFn = () => ( 9 | 10 | new Turbulence()} 12 | fileName='turbulence.png' 13 | /> 14 | 15 | ) 16 | 17 | export default Story 18 | -------------------------------------------------------------------------------- /packages/core/src/resolveIncludes.test.ts: -------------------------------------------------------------------------------- 1 | import { resolveIncludes } from './resolveIncludes' 2 | 3 | describe('resolveIncludes', () => { 4 | test('delimited paths', () => { 5 | expect( 6 | resolveIncludes('#include "scope/lib"', { 7 | scope: { 8 | lib: 'imported' 9 | } 10 | }) 11 | ).toBe('imported') 12 | 13 | expect(() => 14 | resolveIncludes('#include "scope/lib"', { 15 | other: { 16 | lib: 'imported' 17 | } 18 | }) 19 | ).toThrow() 20 | }) 21 | }) 22 | -------------------------------------------------------------------------------- /storybook/src/clouds/BuildingBlocks-LocalWeather.tsx: -------------------------------------------------------------------------------- 1 | import { Canvas } from '@react-three/fiber' 2 | import type { StoryFn } from '@storybook/react-vite' 3 | 4 | import { LocalWeather } from '@takram/three-clouds' 5 | 6 | import { ProceduralTextureViewer } from './helpers/ProceduralTextureViewer' 7 | 8 | const Story: StoryFn = () => ( 9 | 10 | new LocalWeather()} 12 | fileName='local_weather.png' 13 | /> 14 | 15 | ) 16 | 17 | export default Story 18 | -------------------------------------------------------------------------------- /packages/core/src/capabilities.ts: -------------------------------------------------------------------------------- 1 | import { WebGLRenderer } from 'three' 2 | import type { Renderer } from 'three/webgpu' 3 | 4 | export function isFloatLinearSupported( 5 | renderer: Renderer | WebGLRenderer 6 | ): boolean { 7 | return renderer instanceof WebGLRenderer 8 | ? renderer.getContext().getExtension('OES_texture_float_linear') != null 9 | : (( 10 | renderer.backend as (typeof renderer)['backend'] & { 11 | hasFeature?: (name: string) => boolean 12 | } 13 | ).hasFeature?.('float32-filterable') ?? false) 14 | } 15 | -------------------------------------------------------------------------------- /storybook-webgpu/types/3d-tiles-renderer.d.ts: -------------------------------------------------------------------------------- 1 | declare module '3d-tiles-renderer/src/three/plugins/fade/wrapFadeMaterial.js' { 2 | import type { Material } from 'three' 3 | 4 | export function wrapFadeMaterial( 5 | material: Material, 6 | previousOnBeforeCompile: unknown 7 | ): FadeParams 8 | } 9 | 10 | declare module '3d-tiles-renderer/src/three/plugins/fade/FadeMaterialManager.js' { 11 | import type { Material } from 'three' 12 | 13 | export class FadeMaterialManager { 14 | protected prepareMaterial(material: Material): void 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /storybook/src/clouds/BuildingBlocks-ShapeDetail.tsx: -------------------------------------------------------------------------------- 1 | import { Canvas } from '@react-three/fiber' 2 | import type { StoryFn } from '@storybook/react-vite' 3 | 4 | import { CloudShapeDetail } from '@takram/three-clouds' 5 | 6 | import { Procedural3DTextureViewer } from './helpers/Procedural3DTextureViewer' 7 | 8 | const Story: StoryFn = () => ( 9 | 10 | new CloudShapeDetail()} 12 | fileName='shape_detail.bin' 13 | /> 14 | 15 | ) 16 | 17 | export default Story 18 | -------------------------------------------------------------------------------- /packages/clouds/src/index.ts: -------------------------------------------------------------------------------- 1 | export type { QualityPreset as CloudsQualityPreset } from './qualityPresets' 2 | export type { FrustumSplitMode } from './helpers/splitFrustum' 3 | 4 | export * from './CloudLayer' 5 | export * from './CloudLayers' 6 | export * from './CloudsEffect' 7 | export * from './CloudShape' 8 | export * from './CloudShapeDetail' 9 | export * from './constants' 10 | export * from './DensityProfile' 11 | export * from './LocalWeather' 12 | export * from './Procedural3DTexture' 13 | export * from './ProceduralTexture' 14 | export * from './Turbulence' 15 | -------------------------------------------------------------------------------- /packages/core/src/r3f/types.ts: -------------------------------------------------------------------------------- 1 | import type { MathType, MathTypes } from '@react-three/fiber' 2 | 3 | export type OverwriteMathProps = { 4 | [K in keyof T]: Exclude extends MathTypes 5 | ? T[K] extends undefined 6 | ? MathType> | undefined 7 | : MathType> 8 | : T[K] 9 | } 10 | 11 | export type ExpandNestedProps = { 12 | [K in keyof NonNullable as K extends string 13 | ? `${Prop}-${K}` 14 | : 'never']: NonNullable[K] 15 | } 16 | -------------------------------------------------------------------------------- /storybook-webgpu/src/plugins/ReorientationPlugin.ts: -------------------------------------------------------------------------------- 1 | import { ReorientationPlugin as ReorientationPluginBase } from '3d-tiles-renderer/plugins' 2 | 3 | declare module '3d-tiles-renderer/plugins' { 4 | interface ReorientationPlugin { 5 | lat?: number 6 | lon?: number 7 | height?: number 8 | } 9 | } 10 | 11 | export class ReorientationPlugin extends ReorientationPluginBase { 12 | update(): void { 13 | const { lat, lon, height } = this 14 | if (lat != null && lon != null) { 15 | this.transformLatLonHeightToOrigin(lat, lon, height) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /storybook/src/plugins/ReorientationPlugin.ts: -------------------------------------------------------------------------------- 1 | import { ReorientationPlugin as ReorientationPluginBase } from '3d-tiles-renderer/plugins' 2 | 3 | declare module '3d-tiles-renderer/plugins' { 4 | interface ReorientationPlugin { 5 | lat?: number 6 | lon?: number 7 | height?: number 8 | } 9 | } 10 | 11 | export class ReorientationPlugin extends ReorientationPluginBase { 12 | invalidate(): void { 13 | const { lat, lon, height } = this 14 | if (lat != null && lon != null) { 15 | this.transformLatLonHeightToOrigin(lat, lon, height) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/depthEffect.frag: -------------------------------------------------------------------------------- 1 | #include "core/depth" 2 | #include "core/turbo" 3 | 4 | uniform float near; 5 | uniform float far; 6 | 7 | void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { 8 | float depth = readDepth(uv); 9 | depth = reverseLogDepth(depth, cameraNear, cameraFar); 10 | depth = linearizeDepth(depth, near, far) / far; 11 | 12 | #ifdef USE_TURBO 13 | vec3 color = turbo(1.0 - depth); 14 | #else // USE_TURBO 15 | vec3 color = vec3(depth); 16 | #endif // USE_TURBO 17 | 18 | outputColor = vec4(color, inputColor.a); 19 | } 20 | -------------------------------------------------------------------------------- /storybook/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "storybook", 3 | "$schema": "../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "storybook/src", 5 | "projectType": "application", 6 | "tags": ["type:tool"], 7 | "// targets": "to see all targets run: nx show project storybook --web", 8 | "targets": { 9 | "build-storybook": { 10 | "executor": "nx:run-commands", 11 | "options": { 12 | "commands": [ 13 | "tsc --noEmit -p tsconfig.storybook.json", 14 | "storybook build" 15 | ], 16 | "cwd": "storybook" 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /storybook/src/clouds/Clouds.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './Clouds-Basic' 4 | import _CustomLayers from './Clouds-CustomLayers' 5 | import _Vanilla from './Clouds-Vanilla' 6 | import _WorldOriginRebasing from './Clouds-WorldOriginRebasing' 7 | 8 | export default { 9 | title: 'clouds/Clouds', 10 | parameters: { 11 | layout: 'fullscreen' 12 | } 13 | } satisfies Meta 14 | 15 | export const Basic = _Basic 16 | export const CustomLayers = _CustomLayers 17 | export const WorldOriginRebasing = _WorldOriginRebasing 18 | export const Vanilla = _Vanilla 19 | -------------------------------------------------------------------------------- /packages/core/src/shaders/packing.glsl: -------------------------------------------------------------------------------- 1 | // Reference: https://jcgt.org/published/0003/02/01/paper.pdf 2 | 3 | vec2 signNotZero(vec2 v) { 4 | return vec2(v.x >= 0.0 ? 1.0 : -1.0, v.y >= 0.0 ? 1.0 : -1.0); 5 | } 6 | 7 | vec2 packNormalToVec2(vec3 v) { 8 | vec2 p = v.xy * (1.0 / (abs(v.x) + abs(v.y) + abs(v.z))); 9 | return v.z <= 0.0 10 | ? (1.0 - abs(p.yx)) * signNotZero(p) 11 | : p; 12 | } 13 | 14 | vec3 unpackVec2ToNormal(vec2 e) { 15 | vec3 v = vec3(e.xy, 1.0 - abs(e.x) - abs(e.y)); 16 | if (v.z < 0.0) { 17 | v.xy = (1.0 - abs(v.yx)) * signNotZero(v.xy); 18 | } 19 | return normalize(v); 20 | } 21 | -------------------------------------------------------------------------------- /packages/clouds/src/bayer.ts: -------------------------------------------------------------------------------- 1 | import { Vector2 } from 'three' 2 | 3 | // prettier-ignore 4 | export const bayerIndices: readonly number[] = [ 5 | 0, 8, 2, 10, 6 | 12, 4, 14, 6, 7 | 3, 11, 1, 9, 8 | 15, 7, 13, 5 9 | ] 10 | 11 | export const bayerOffsets: readonly Vector2[] = 12 | /*#__PURE__*/ bayerIndices.reduce((result, _, index) => { 13 | const offset = new Vector2() 14 | for (let i = 0; i < 16; ++i) { 15 | if (bayerIndices[i] === index) { 16 | offset.set(((i % 4) + 0.5) / 4, (Math.floor(i / 4) + 0.5) / 4) 17 | break 18 | } 19 | } 20 | return [...result, offset] 21 | }, []) 22 | -------------------------------------------------------------------------------- /storybook-webgpu/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "storybook-webgpu", 3 | "$schema": "../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "storybook-webgpu/src", 5 | "projectType": "application", 6 | "tags": ["type:tool"], 7 | "// targets": "to see all targets run: nx show project storybook-webgpu --web", 8 | "targets": { 9 | "build-storybook": { 10 | "executor": "nx:run-commands", 11 | "options": { 12 | "commands": [ 13 | "tsc --noEmit -p tsconfig.storybook.json", 14 | "storybook build" 15 | ], 16 | "cwd": "storybook-webgpu" 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/Atmosphere.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _Basic from './Atmosphere-Basic' 4 | import _LightingMask from './Atmosphere-LightingMask' 5 | import _Vanilla from './Atmosphere-Vanilla' 6 | import _WorldOriginRebasing from './Atmosphere-WorldOriginRebasing' 7 | 8 | export default { 9 | title: 'atmosphere/Atmosphere', 10 | parameters: { 11 | layout: 'fullscreen' 12 | } 13 | } satisfies Meta 14 | 15 | export const Basic = _Basic 16 | export const LightingMask = _LightingMask 17 | export const WorldOriginRebasing = _WorldOriginRebasing 18 | export const Vanilla = _Vanilla 19 | -------------------------------------------------------------------------------- /packages/core/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | 3 | import baseConfig from '../../eslint.config.mjs' 4 | 5 | export default defineConfig( 6 | baseConfig, 7 | { 8 | files: ['**/*.json'], 9 | rules: { 10 | '@nx/dependency-checks': [ 11 | 'error', 12 | { 13 | ignoredFiles: ['**/eslint.config.mjs', '**/vite.config.ts'] 14 | } 15 | ] 16 | }, 17 | languageOptions: { 18 | parser: await import('jsonc-eslint-parser') 19 | } 20 | }, 21 | { 22 | files: ['**/*.tsx'], 23 | rules: { 24 | 'react/display-name': 'error' 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /packages/clouds/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | 3 | import baseConfig from '../../eslint.config.mjs' 4 | 5 | export default defineConfig( 6 | baseConfig, 7 | { 8 | files: ['**/*.json'], 9 | rules: { 10 | '@nx/dependency-checks': [ 11 | 'error', 12 | { 13 | ignoredFiles: ['**/eslint.config.mjs', '**/vite.config.ts'] 14 | } 15 | ] 16 | }, 17 | languageOptions: { 18 | parser: await import('jsonc-eslint-parser') 19 | } 20 | }, 21 | { 22 | files: ['**/*.tsx'], 23 | rules: { 24 | 'react/display-name': 'error' 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /packages/effects/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | 3 | import baseConfig from '../../eslint.config.mjs' 4 | 5 | export default defineConfig( 6 | baseConfig, 7 | { 8 | files: ['**/*.json'], 9 | rules: { 10 | '@nx/dependency-checks': [ 11 | 'error', 12 | { 13 | ignoredFiles: ['**/eslint.config.mjs', '**/vite.config.ts'] 14 | } 15 | ] 16 | }, 17 | languageOptions: { 18 | parser: await import('jsonc-eslint-parser') 19 | } 20 | }, 21 | { 22 | files: ['**/*.tsx'], 23 | rules: { 24 | 'react/display-name': 'error' 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/geometryEffect.frag: -------------------------------------------------------------------------------- 1 | #include "core/packing" 2 | 3 | uniform sampler2D geometryBuffer; 4 | 5 | void mainImage(const vec4 inputColor, const vec2 uv, out vec4 outputColor) { 6 | vec4 normalMetalnessRoughness = texture(geometryBuffer, uv); 7 | 8 | #ifdef OUTPUT_NORMAL 9 | vec3 normal = unpackVec2ToNormal(texture(geometryBuffer, uv).xy); 10 | outputColor = vec4(normal * 0.5 + 0.5, inputColor.a); 11 | #endif // OUTPUT_NORMAL 12 | 13 | #ifdef OUTPUT_PBR 14 | outputColor = vec4( 15 | vec3(normalMetalnessRoughness.b, normalMetalnessRoughness.a, 0.0), 16 | inputColor.a 17 | ); 18 | #endif // OUTPUT_PBR 19 | } 20 | -------------------------------------------------------------------------------- /packages/atmosphere/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'eslint/config' 2 | 3 | import baseConfig from '../../eslint.config.mjs' 4 | 5 | export default defineConfig( 6 | baseConfig, 7 | { 8 | files: ['**/*.json'], 9 | rules: { 10 | '@nx/dependency-checks': [ 11 | 'error', 12 | { 13 | ignoredFiles: ['**/eslint.config.mjs', '**/vite.config.ts'] 14 | } 15 | ] 16 | }, 17 | languageOptions: { 18 | parser: await import('jsonc-eslint-parser') 19 | } 20 | }, 21 | { 22 | files: ['**/*.tsx'], 23 | rules: { 24 | 'react/display-name': 'error' 25 | } 26 | } 27 | ) 28 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/directIrradiance.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | uniform sampler2D transmittanceTexture; 11 | 12 | layout(location = 0) out vec4 outputColor; 13 | 14 | void main() { 15 | vec3 deltaIrradiance; 16 | vec3 irradiance; 17 | deltaIrradiance = ComputeDirectIrradianceTexture( 18 | ATMOSPHERE, 19 | transmittanceTexture, 20 | gl_FragCoord.xy 21 | ); 22 | irradiance = vec3(0.0); 23 | outputColor = vec4(OUTPUT, 1.0); 24 | } 25 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/Space.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story } from './Space-Story' 5 | 6 | import Code from './Space-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Space', 10 | tags: ['order:0'], 11 | parameters: { 12 | docs: { 13 | codePanel: true, 14 | source: { 15 | language: 'tsx' 16 | } 17 | } 18 | } 19 | } satisfies Meta 20 | 21 | export const Space = createStory(Story, { 22 | parameters: { 23 | docs: { 24 | source: { 25 | code: Code 26 | } 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /packages/atmosphere/src/getAltitudeCorrectionOffset.ts: -------------------------------------------------------------------------------- 1 | import { Vector3 } from 'three' 2 | 3 | import type { Ellipsoid } from '@takram/three-geospatial' 4 | 5 | const vectorScratch = /*#__PURE__*/ new Vector3() 6 | 7 | export function getAltitudeCorrectionOffset( 8 | cameraPosition: Vector3, 9 | bottomRadius: number, 10 | ellipsoid: Ellipsoid, 11 | result: Vector3 12 | ): Vector3 { 13 | const surfacePosition = ellipsoid.projectOnSurface( 14 | cameraPosition, 15 | vectorScratch 16 | ) 17 | return surfacePosition != null 18 | ? ellipsoid 19 | .getOsculatingSphereCenter(surfacePosition, bottomRadius, result) 20 | .negate() 21 | : result.setScalar(0) 22 | } 23 | -------------------------------------------------------------------------------- /packages/clouds/src/Turbulence.ts: -------------------------------------------------------------------------------- 1 | import { resolveIncludes } from '@takram/three-geospatial' 2 | import { math } from '@takram/three-geospatial/shaders' 3 | 4 | import { ProceduralTextureBase } from './ProceduralTexture' 5 | 6 | import perlin from './shaders/perlin.glsl?raw' 7 | import tileableNoise from './shaders/tileableNoise.glsl?raw' 8 | import fragmentShader from './shaders/turbulence.frag?raw' 9 | 10 | export class Turbulence extends ProceduralTextureBase { 11 | constructor() { 12 | super({ 13 | size: 128, 14 | fragmentShader: resolveIncludes(fragmentShader, { 15 | core: { math }, 16 | perlin, 17 | tileableNoise 18 | }) 19 | }) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /storybook-webgpu/src/core/LensFlare.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story as LensFlareStory } from './LensFlare-Story' 5 | 6 | import LensFlareCode from './LensFlare-Story?raw' 7 | 8 | export default { 9 | title: 'core/Lens Flare', 10 | parameters: { 11 | docs: { 12 | codePanel: true, 13 | source: { 14 | language: 'tsx' 15 | } 16 | } 17 | } 18 | } satisfies Meta 19 | 20 | export const LensFlare = createStory(LensFlareStory, { 21 | parameters: { 22 | docs: { 23 | source: { 24 | code: LensFlareCode 25 | } 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /packages/clouds/src/LocalWeather.ts: -------------------------------------------------------------------------------- 1 | import { resolveIncludes } from '@takram/three-geospatial' 2 | import { math } from '@takram/three-geospatial/shaders' 3 | 4 | import { ProceduralTextureBase } from './ProceduralTexture' 5 | 6 | import fragmentShader from './shaders/localWeather.frag?raw' 7 | import perlin from './shaders/perlin.glsl?raw' 8 | import tileableNoise from './shaders/tileableNoise.glsl?raw' 9 | 10 | export class LocalWeather extends ProceduralTextureBase { 11 | constructor() { 12 | super({ 13 | size: 512, 14 | fragmentShader: resolveIncludes(fragmentShader, { 15 | core: { math }, 16 | perlin, 17 | tileableNoise 18 | }) 19 | }) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /storybook/src/helpers/HaldLUT.tsx: -------------------------------------------------------------------------------- 1 | import { useTexture } from '@react-three/drei' 2 | import { LUT, type LUTProps } from '@react-three/postprocessing' 3 | import type { LUT3DEffect } from 'postprocessing' 4 | import { useMemo, type FC, type RefAttributes } from 'react' 5 | 6 | import { createHaldLookupTexture } from '@takram/three-geospatial-effects' 7 | 8 | export const HaldLUT: FC< 9 | Omit, 'lut'> & { 10 | path: string 11 | } 12 | > = ({ ref: forwardedRef, path, ...props }) => { 13 | const texture = useTexture(path) 14 | const lut = useMemo(() => createHaldLookupTexture(texture), [texture]) 15 | return 16 | } 17 | -------------------------------------------------------------------------------- /packages/effects/src/DitheringEffect.ts: -------------------------------------------------------------------------------- 1 | import { BlendFunction, Effect } from 'postprocessing' 2 | 3 | import fragmentShader from './shaders/ditheringEffect.frag?raw' 4 | 5 | export interface DitheringEffectOptions { 6 | blendFunction?: BlendFunction 7 | } 8 | 9 | export const ditheringOptionsDefaults = { 10 | blendFunction: BlendFunction.NORMAL 11 | } satisfies DitheringEffectOptions 12 | 13 | export class DitheringEffect extends Effect { 14 | constructor(options?: DitheringEffectOptions) { 15 | const { blendFunction } = { 16 | ...ditheringOptionsDefaults, 17 | ...options 18 | } 19 | 20 | super('DitheringEffect', fragmentShader, { 21 | blendFunction 22 | }) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/AtmosphereLight.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story as BasicStory } from './AtmosphereLight-Basic' 5 | 6 | import BasicCode from './AtmosphereLight-Basic?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Atmosphere Light', 10 | parameters: { 11 | docs: { 12 | codePanel: true, 13 | source: { 14 | language: 'tsx' 15 | } 16 | } 17 | } 18 | } satisfies Meta 19 | 20 | export const Basic = createStory(BasicStory, { 21 | parameters: { 22 | docs: { 23 | source: { 24 | code: BasicCode 25 | } 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/LowEarthOrbit.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story } from './LowEarthOrbit-Story' 5 | 6 | import Code from './LowEarthOrbit-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Low Earth Orbit', 10 | tags: ['order:1'], 11 | parameters: { 12 | docs: { 13 | codePanel: true, 14 | source: { 15 | language: 'tsx' 16 | } 17 | } 18 | } 19 | } satisfies Meta 20 | 21 | export const LowEarthOrbit = createStory(Story, { 22 | parameters: { 23 | docs: { 24 | source: { 25 | code: Code 26 | } 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /packages/atmosphere/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './AerialPerspectiveEffect' 2 | export * from './AtmosphereMaterialBase' 3 | export * from './AtmosphereParameters' 4 | export * from './blackBodyChromaticity' 5 | export * from './celestialDirections' 6 | export * from './constants' 7 | export * from './getAltitudeCorrectionOffset' 8 | export * from './getSunLightColor' 9 | export * from './LightingMaskPass' 10 | export * from './PrecomputedTexturesGenerator' 11 | export * from './PrecomputedTexturesLoader' 12 | export * from './SkyLightProbe' 13 | export * from './SkyMaterial' 14 | export * from './StarsGeometry' 15 | export * from './StarsMaterial' 16 | export * from './SunDirectionalLight' 17 | export type * from './types' 18 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/useGuardedFrame.ts: -------------------------------------------------------------------------------- 1 | import { useFrame, type RenderCallback } from '@react-three/fiber' 2 | import { useRef } from 'react' 3 | 4 | // Terminates when the callback throws an error, instead of executing it and 5 | // throwing errors every frame. 6 | export function useGuardedFrame( 7 | callback: RenderCallback, 8 | renderPriority?: number 9 | ): void { 10 | const errorRef = useRef(undefined) 11 | useFrame((state, delta, frame) => { 12 | if (errorRef.current != null) { 13 | return 14 | } 15 | try { 16 | callback(state, delta, frame) 17 | } catch (error) { 18 | errorRef.current = error 19 | throw error 20 | } 21 | }, renderPriority) 22 | } 23 | -------------------------------------------------------------------------------- /packages/clouds/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/vitest", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ], 12 | "jsx": "react-jsx" 13 | }, 14 | "include": [ 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/core/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/vitest", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ], 12 | "jsx": "react-jsx" 13 | }, 14 | "include": [ 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /storybook/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import storybook from 'eslint-plugin-storybook' 2 | import { defineConfig } from 'eslint/config' 3 | import tseslint from 'typescript-eslint' 4 | 5 | import baseConfig from '../eslint.config.mjs' 6 | 7 | export default defineConfig( 8 | baseConfig, 9 | storybook.configs['flat/recommended'], 10 | { 11 | files: ['.storybook/preview.tsx'], 12 | extends: [tseslint.configs.disableTypeChecked] 13 | }, 14 | { 15 | ignores: ['storybook-static'] 16 | }, 17 | { 18 | files: ['**/*.ts', '**/*.tsx'], 19 | rules: { 20 | 'storybook/no-uninstalled-addons': [ 21 | 'error', 22 | { packageJsonLocation: '../package.json' } 23 | ] 24 | } 25 | } 26 | ) 27 | -------------------------------------------------------------------------------- /packages/atmosphere/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/vitest", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ], 12 | "jsx": "react-jsx" 13 | }, 14 | "include": [ 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/effects/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "./out-tsc/vitest", 5 | "types": [ 6 | "vitest/globals", 7 | "vitest/importMeta", 8 | "vite/client", 9 | "node", 10 | "vitest" 11 | ], 12 | "jsx": "react-jsx" 13 | }, 14 | "include": [ 15 | "vite.config.ts", 16 | "vite.config.mts", 17 | "vitest.config.ts", 18 | "vitest.config.mts", 19 | "src/**/*.test.ts", 20 | "src/**/*.spec.ts", 21 | "src/**/*.test.tsx", 22 | "src/**/*.spec.tsx", 23 | "src/**/*.test.js", 24 | "src/**/*.spec.js", 25 | "src/**/*.test.jsx", 26 | "src/**/*.spec.jsx", 27 | "src/**/*.d.ts" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/CruisingAltitude.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story } from './CruisingAltitude-Story' 5 | 6 | import Code from './CruisingAltitude-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Cruising Altitude', 10 | tags: ['order:2'], 11 | parameters: { 12 | docs: { 13 | codePanel: true, 14 | source: { 15 | language: 'tsx' 16 | } 17 | } 18 | } 19 | } satisfies Meta 20 | 21 | export const CruisingAltitude = createStory(Story, { 22 | parameters: { 23 | docs: { 24 | source: { 25 | code: Code 26 | } 27 | } 28 | } 29 | }) 30 | -------------------------------------------------------------------------------- /.github/workflows/storybook-webgpu.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - 'main' 5 | 6 | permissions: 7 | contents: read 8 | 9 | jobs: 10 | trigger: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/github-script@v7 14 | with: 15 | github-token: ${{ secrets.WEBGPU_GITHUB_TOKEN }} 16 | script: | 17 | await github.request('POST /repos/{owner}/{repo}/dispatches', { 18 | owner: 'takram-design-engineering', 19 | repo: 'three-geospatial-webgpu', 20 | event_type: 'deploy', 21 | client_payload: { 22 | sha: context.sha, 23 | ref: 'main' 24 | } 25 | }) 26 | -------------------------------------------------------------------------------- /packages/clouds/src/PassBase.ts: -------------------------------------------------------------------------------- 1 | import { Pass } from 'postprocessing' 2 | import { Camera } from 'three' 3 | 4 | import type { CascadedShadowMaps } from './CascadedShadowMaps' 5 | 6 | export interface PassBaseOptions { 7 | shadow: CascadedShadowMaps 8 | } 9 | 10 | export abstract class PassBase extends Pass { 11 | shadow: CascadedShadowMaps 12 | 13 | private _mainCamera = new Camera() 14 | 15 | constructor(name: string, options: PassBaseOptions) { 16 | super(name) 17 | const { shadow } = options 18 | this.shadow = shadow 19 | } 20 | 21 | override get mainCamera(): Camera { 22 | return this._mainCamera 23 | } 24 | 25 | override set mainCamera(value: Camera) { 26 | this._mainCamera = value 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /storybook/src/clouds/BuildingBlocks.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _LocalWeather from './BuildingBlocks-LocalWeather' 4 | import _Shape from './BuildingBlocks-Shape' 5 | import _ShapeDetail from './BuildingBlocks-ShapeDetail' 6 | import _Turbulence from './BuildingBlocks-Turbulence' 7 | import _VolumetricShape from './BuildingBlocks-VolumetricShape' 8 | 9 | export default { 10 | title: 'clouds/Building Blocks', 11 | parameters: { 12 | layout: 'fullscreen' 13 | } 14 | } satisfies Meta 15 | 16 | export const LocalWeather = _LocalWeather 17 | export const Shape = _Shape 18 | export const ShapeDetail = _ShapeDetail 19 | export const Turbulence = _Turbulence 20 | export const VolumetricShape = _VolumetricShape 21 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/index.ts: -------------------------------------------------------------------------------- 1 | export * from './accessors' 2 | export * from './debug' 3 | export * from './DownsampleThresholdNode' 4 | export * from './FnLayout' 5 | export * from './FnVar' 6 | export * from './GaussianBlurNode' 7 | export * from './generators' 8 | export * from './HighpVelocityNode' 9 | export * from './KawaseBlurNode' 10 | export * from './LensFlareNode' 11 | export * from './math' 12 | export * from './MipmapBlurNode' 13 | export * from './MipmapSurfaceBlurNode' 14 | export * from './node' 15 | export * from './OutputTexture3DNode' 16 | export * from './OutputTextureNode' 17 | export * from './RTTextureNode' 18 | export * from './sampling' 19 | export * from './TemporalAntialiasNode' 20 | export * from './transformations' 21 | export * from './utils' 22 | -------------------------------------------------------------------------------- /storybook-webgpu/src/core/TemporalAntialias.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story as TemporalAntialiasStory } from './TemporalAntialias-Story' 5 | 6 | import TemporalAntialiasCode from './TemporalAntialias-Story?raw' 7 | 8 | export default { 9 | title: 'core/Temporal Antialias', 10 | parameters: { 11 | docs: { 12 | codePanel: true, 13 | source: { 14 | language: 'tsx' 15 | } 16 | } 17 | } 18 | } satisfies Meta 19 | 20 | export const TemporalAntialias = createStory(TemporalAntialiasStory, { 21 | parameters: { 22 | docs: { 23 | source: { 24 | code: TemporalAntialiasCode 25 | } 26 | } 27 | } 28 | }) 29 | -------------------------------------------------------------------------------- /packages/clouds/src/CloudShape.ts: -------------------------------------------------------------------------------- 1 | import { resolveIncludes } from '@takram/three-geospatial' 2 | import { math } from '@takram/three-geospatial/shaders' 3 | 4 | import { CLOUD_SHAPE_TEXTURE_SIZE } from './constants' 5 | import { Procedural3DTextureBase } from './Procedural3DTexture' 6 | 7 | import fragmentShader from './shaders/cloudShape.frag?raw' 8 | import perlin from './shaders/perlin.glsl?raw' 9 | import tileableNoise from './shaders/tileableNoise.glsl?raw' 10 | 11 | export class CloudShape extends Procedural3DTextureBase { 12 | constructor() { 13 | super({ 14 | size: CLOUD_SHAPE_TEXTURE_SIZE, 15 | fragmentShader: resolveIncludes(fragmentShader, { 16 | core: { math }, 17 | perlin, 18 | tileableNoise 19 | }) 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /packages/atmosphere/src/r3f/useAtmosphereTextureProps.ts: -------------------------------------------------------------------------------- 1 | import { useLoader, useThree } from '@react-three/fiber' 2 | 3 | import { DEFAULT_PRECOMPUTED_TEXTURES_URL } from '../constants' 4 | import { PrecomputedTexturesLoader } from '../PrecomputedTexturesLoader' 5 | import type { PrecomputedTextures } from '../types' 6 | 7 | const loader = new PrecomputedTexturesLoader() 8 | 9 | /** 10 | * @deprecated Use useLoader with PrecomputedTexturesLoader instead. 11 | * This will be removed in the future release. 12 | */ 13 | export function useAtmosphereTextureProps( 14 | url = DEFAULT_PRECOMPUTED_TEXTURES_URL 15 | ): { textures: PrecomputedTextures } { 16 | const renderer = useThree(({ gl }) => gl) 17 | const textures = useLoader(loader.setType(renderer), url) 18 | return { textures } 19 | } 20 | -------------------------------------------------------------------------------- /packages/core/src/shaders/depth.glsl: -------------------------------------------------------------------------------- 1 | // cSpell:words logdepthbuf 2 | 3 | float reverseLogDepth(const float depth, const float near, const float far) { 4 | #if defined(USE_LOGDEPTHBUF) || defined(USE_LOGARITHMIC_DEPTH_BUFFER) 5 | float d = pow(2.0, depth * log2(far + 1.0)) - 1.0; 6 | float a = far / (far - near); 7 | float b = far * near / (near - far); 8 | return a + b / d; 9 | #else // defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(USE_LOGARITHMIC_DEPTH_BUFFER) 10 | return depth; 11 | #endif // defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(USE_LOGARITHMIC_DEPTH_BUFFER) 12 | } 13 | 14 | float linearizeDepth(const float depth, const float near, const float far) { 15 | float ndc = depth * 2.0 - 1.0; 16 | return 2.0 * near * far / (far + near - ndc * (far - near)); 17 | } 18 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/useGLTF.ts: -------------------------------------------------------------------------------- 1 | import { useLoader, type ObjectMap } from '@react-three/fiber' 2 | import { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js' 3 | import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js' 4 | import { GLTFLoader, type GLTF } from 'three/examples/jsm/loaders/GLTFLoader.js' 5 | 6 | const dracoLoader = new DRACOLoader() 7 | dracoLoader.setDecoderPath('https://www.gstatic.com/draco/v1/decoders/') 8 | 9 | const gltfLoader = new GLTFLoader() 10 | gltfLoader.setDRACOLoader(dracoLoader) 11 | gltfLoader.setMeshoptDecoder(MeshoptDecoder) 12 | 13 | // Drei (three-stdlib)'s useGLTF produces inconsistent materials for some GLTFs. 14 | export function useGLTF(path: string): GLTF & ObjectMap { 15 | return useLoader(gltfLoader, path) 16 | } 17 | -------------------------------------------------------------------------------- /packages/core/src/resolveIncludes.ts: -------------------------------------------------------------------------------- 1 | const includePattern = /^[ \t]*#include +"([\w\d./]+)"/gm 2 | 3 | interface Includes { 4 | [key: string]: string | Includes 5 | } 6 | 7 | export function resolveIncludes(source: string, includes: Includes): string { 8 | return source.replace(includePattern, (match, path: string) => { 9 | const components = path.split('/') 10 | const include = components.reduce( 11 | (parent, component) => 12 | typeof parent !== 'string' && parent != null 13 | ? parent[component] 14 | : undefined, 15 | includes 16 | ) 17 | if (typeof include !== 'string') { 18 | throw new Error(`Could not find include for ${path}.`) 19 | } 20 | return resolveIncludes(include, includes) 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /packages/clouds/src/CloudShapeDetail.ts: -------------------------------------------------------------------------------- 1 | import { resolveIncludes } from '@takram/three-geospatial' 2 | import { math } from '@takram/three-geospatial/shaders' 3 | 4 | import { CLOUD_SHAPE_DETAIL_TEXTURE_SIZE } from './constants' 5 | import { Procedural3DTextureBase } from './Procedural3DTexture' 6 | 7 | import fragmentShader from './shaders/cloudShapeDetail.frag?raw' 8 | import perlin from './shaders/perlin.glsl?raw' 9 | import tileableNoise from './shaders/tileableNoise.glsl?raw' 10 | 11 | export class CloudShapeDetail extends Procedural3DTextureBase { 12 | constructor() { 13 | super({ 14 | size: CLOUD_SHAPE_DETAIL_TEXTURE_SIZE, 15 | fragmentShader: resolveIncludes(fragmentShader, { 16 | core: { math }, 17 | perlin, 18 | tileableNoise 19 | }) 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/NonGeospatial.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story as NonGeospatialStory } from './NonGeospatial-Story' 5 | 6 | import NonGeospatialCode from './NonGeospatial-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Non-geospatial', 10 | tags: ['order:4'], 11 | parameters: { 12 | docs: { 13 | codePanel: true, 14 | source: { 15 | language: 'tsx' 16 | } 17 | } 18 | } 19 | } satisfies Meta 20 | 21 | export const NonGeospatial = createStory(NonGeospatialStory, { 22 | parameters: { 23 | docs: { 24 | source: { 25 | code: NonGeospatialCode 26 | } 27 | } 28 | } 29 | }) 30 | 31 | NonGeospatial.storyName = 'Non-geospatial' 32 | -------------------------------------------------------------------------------- /packages/effects/src/r3f/LensFlare.tsx: -------------------------------------------------------------------------------- 1 | import type { ElementProps } from '@react-three/fiber' 2 | import { useEffect, useMemo, type FC } from 'react' 3 | 4 | import { 5 | LensFlareEffect, 6 | lensFlareEffectOptionsDefaults 7 | } from '../LensFlareEffect' 8 | 9 | export interface LensFlareProps extends ElementProps {} 10 | 11 | export const LensFlare: FC = ({ 12 | ref: forwardedRef, 13 | ...props 14 | }) => { 15 | const { blendFunction: _, ...others } = { 16 | ...lensFlareEffectOptionsDefaults, 17 | ...props 18 | } 19 | 20 | const effect = useMemo(() => new LensFlareEffect(), []) 21 | useEffect(() => { 22 | return () => { 23 | effect.dispose() 24 | } 25 | }, [effect]) 26 | 27 | return 28 | } 29 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/useControl.ts: -------------------------------------------------------------------------------- 1 | import type { Args } from '@storybook/react-vite' 2 | import { useAtomValue } from 'jotai' 3 | import { selectAtom } from 'jotai/utils' 4 | import { useCallback, useContext, useRef } from 'react' 5 | import shallowEqual from 'shallowequal' 6 | 7 | import { StoryContext } from '../helpers/StoryContext' 8 | 9 | export function useControl( 10 | selector: (args: TArgs) => T 11 | ): T { 12 | const { argsAtom } = useContext(StoryContext) 13 | const selectorRef = useRef(selector) 14 | selectorRef.current = selector 15 | // The selector function must be stable. 16 | const selectorCallback = useCallback((args: Args) => { 17 | return selectorRef.current(args as TArgs) 18 | }, []) 19 | return useAtomValue(selectAtom(argsAtom, selectorCallback, shallowEqual)) 20 | } 21 | -------------------------------------------------------------------------------- /packages/core/src/unrollLoops.ts: -------------------------------------------------------------------------------- 1 | // Based on: https://github.com/mrdoob/three.js/blob/r170/src/renderers/webgl/WebGLProgram.js#L294 2 | 3 | const unrollLoopPattern = 4 | /#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*(?:i\s*\+\+|\+\+\s*i)\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g 5 | 6 | function loopReplacer( 7 | match: string, 8 | start: string, 9 | end: string, 10 | snippet: string 11 | ): string { 12 | let string = '' 13 | for (let i = parseInt(start, 10); i < parseInt(end, 10); ++i) { 14 | string += snippet 15 | .replace(/\[\s*i\s*\]/g, '[' + i + ']') 16 | .replace(/UNROLLED_LOOP_INDEX/g, `${i}`) 17 | } 18 | return string 19 | } 20 | 21 | export function unrollLoops(string: string): string { 22 | return string.replace(unrollLoopPattern, loopReplacer) 23 | } 24 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/BuildingBlocks.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import _HigherOrderScattering from './BuildingBlocks-HigherOrderScattering' 4 | import _Irradiance from './BuildingBlocks-Irradiance' 5 | import _Scattering from './BuildingBlocks-Scattering' 6 | import _SingleMieScattering from './BuildingBlocks-SingleMieScattering' 7 | import _Transmittance from './BuildingBlocks-Transmittance' 8 | 9 | export default { 10 | title: 'atmosphere/Building Blocks', 11 | parameters: { 12 | layout: 'fullscreen' 13 | } 14 | } satisfies Meta 15 | 16 | export const Transmittance = _Transmittance 17 | export const Scattering = _Scattering 18 | export const Irradiance = _Irradiance 19 | export const SingleMieScattering = _SingleMieScattering 20 | export const HigherOrderScattering = _HigherOrderScattering 21 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - main 5 | - develop 6 | - release 7 | - release/** 8 | - fiber-v8 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | node-version: ['20.x', '22.x'] 20 | steps: 21 | - uses: actions/checkout@v4 22 | with: 23 | lfs: true 24 | 25 | - uses: pnpm/action-setup@v4 26 | with: 27 | version: 9 28 | 29 | - uses: actions/setup-node@v4 30 | with: 31 | node-version: ${{ matrix.node-version }} 32 | cache: 'pnpm' 33 | 34 | - run: pnpm install --frozen-lockfile 35 | 36 | - run: npx nx build-libs 37 | 38 | - run: npx nx build-storybook 39 | -------------------------------------------------------------------------------- /storybook/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": [ 6 | "node", 7 | "vite/client", 8 | "@nx/react/typings/cssmodule.d.ts", 9 | "@nx/react/typings/image.d.ts" 10 | ] 11 | }, 12 | "exclude": [ 13 | "src/**/*.spec.ts", 14 | "src/**/*.test.ts", 15 | "src/**/*.spec.tsx", 16 | "src/**/*.test.tsx", 17 | "src/**/*.spec.js", 18 | "src/**/*.test.js", 19 | "src/**/*.spec.jsx", 20 | "src/**/*.test.jsx", 21 | "**/*.stories.ts", 22 | "**/*.stories.js", 23 | "**/*.stories.jsx", 24 | "**/*.stories.tsx" 25 | ], 26 | "include": [ 27 | "src/**/*.js", 28 | "src/**/*.jsx", 29 | "src/**/*.ts", 30 | "src/**/*.tsx", 31 | "../types/**/*.ts", 32 | "types/**/*.ts" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/effects/src/createHaldLookupTexture.ts: -------------------------------------------------------------------------------- 1 | import { LookupTexture, RawImageData } from 'postprocessing' 2 | import type { Texture } from 'three' 3 | 4 | import { reinterpretType } from '@takram/three-geospatial' 5 | 6 | export function createHaldLookupTexture(texture: Texture): LookupTexture { 7 | reinterpretType(texture.image) 8 | const { width, height } = texture.image 9 | if (width !== height) { 10 | throw new Error('Hald CLUT image must be square.') 11 | } 12 | const size = Math.cbrt(width * height) 13 | if (size % 1 !== 0) { 14 | throw new Error('Hald CLUT image must be cubic.') 15 | } 16 | const { data } = RawImageData.from(texture.image) 17 | const lut = new LookupTexture(data, size) 18 | lut.name = texture.name 19 | lut.type = texture.type 20 | texture.colorSpace = lut.colorSpace 21 | return lut 22 | } 23 | -------------------------------------------------------------------------------- /storybook-webgpu/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import storybook from 'eslint-plugin-storybook' 2 | import { defineConfig } from 'eslint/config' 3 | import tseslint from 'typescript-eslint' 4 | 5 | import baseConfig from '../eslint.config.mjs' 6 | 7 | export default defineConfig( 8 | baseConfig, 9 | storybook.configs['flat/recommended'], 10 | { 11 | files: ['.storybook/preview.tsx'], 12 | extends: [tseslint.configs.disableTypeChecked] 13 | }, 14 | { 15 | ignores: ['storybook-static'] 16 | }, 17 | { 18 | files: ['**/*.ts', '**/*.tsx'], 19 | rules: { 20 | 'storybook/no-uninstalled-addons': [ 21 | 'error', 22 | { packageJsonLocation: '../package.json' } 23 | ], 24 | 'react-hooks/exhaustive-deps': [ 25 | 'warn', 26 | { additionalHooks: 'useResource' } 27 | ] 28 | } 29 | } 30 | ) 31 | -------------------------------------------------------------------------------- /storybook-webgpu/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "types": [ 6 | "node", 7 | "vite/client", 8 | "@nx/react/typings/cssmodule.d.ts", 9 | "@nx/react/typings/image.d.ts" 10 | ] 11 | }, 12 | "exclude": [ 13 | "src/**/*.spec.ts", 14 | "src/**/*.test.ts", 15 | "src/**/*.spec.tsx", 16 | "src/**/*.test.tsx", 17 | "src/**/*.spec.js", 18 | "src/**/*.test.js", 19 | "src/**/*.spec.jsx", 20 | "src/**/*.test.jsx", 21 | "**/*.stories.ts", 22 | "**/*.stories.js", 23 | "**/*.stories.jsx", 24 | "**/*.stories.tsx" 25 | ], 26 | "include": [ 27 | "src/**/*.js", 28 | "src/**/*.jsx", 29 | "src/**/*.ts", 30 | "src/**/*.tsx", 31 | "../types/**/*.ts", 32 | "types/**/*.ts" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/3DTilesRenderer.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta, StoryFn } from '@storybook/react-vite' 2 | 3 | import { Story } from './3DTilesRenderer-Story' 4 | 5 | export default { 6 | title: 'atmosphere/3D Tiles Renderer Integration', 7 | parameters: { 8 | layout: 'fullscreen' 9 | } 10 | } satisfies Meta 11 | 12 | export const Manhattan: StoryFn = () => ( 13 | 23 | ) 24 | 25 | export const Fuji: StoryFn = () => ( 26 | 36 | ) 37 | -------------------------------------------------------------------------------- /apps/data/src/main.ts: -------------------------------------------------------------------------------- 1 | import path from 'node:path' 2 | import minimist from 'minimist' 3 | 4 | import atmosphere from './targets/atmosphere' 5 | import stars from './targets/stars' 6 | import stbn from './targets/stbn' 7 | 8 | const targets: Record Promise | undefined> = { 9 | atmosphere, 10 | stars, 11 | stbn 12 | } 13 | 14 | function printTargets(): void { 15 | console.log('Available targets:') 16 | Object.keys(targets).forEach(name => { 17 | console.log(` - ${path.parse(name).name}`) 18 | }) 19 | } 20 | 21 | async function main(): Promise { 22 | const argv = minimist(process.argv.slice(2)) 23 | const target = targets[argv.target] 24 | if (target == null) { 25 | printTargets() 26 | process.exit(0) 27 | } 28 | await target() 29 | } 30 | 31 | main().catch((error: unknown) => { 32 | console.error(error) 33 | process.exit(1) 34 | }) 35 | -------------------------------------------------------------------------------- /packages/core/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ArrayBufferLoader' 2 | export * from './bufferGeometry' 3 | export * from './capabilities' 4 | export * from './constants' 5 | export * from './DataTextureLoader' 6 | export * from './decorators' 7 | export * from './defineShorthand' 8 | export * from './Ellipsoid' 9 | export * from './EllipsoidGeometry' 10 | export * from './EXR3DTextureLoader' 11 | export * from './EXRTextureLoader' 12 | export * from './Geodetic' 13 | export * from './math' 14 | export * from './PointOfView' 15 | export * from './QuadGeometry' 16 | export * from './Rectangle' 17 | export * from './resolveIncludes' 18 | export * from './STBNLoader' 19 | export * from './TileCoordinate' 20 | export * from './TilingScheme' 21 | export * from './typedArray' 22 | export * from './TypedArrayLoader' 23 | export * from './typedArrayParsers' 24 | export * from './types' 25 | export * from './unrollLoops' 26 | -------------------------------------------------------------------------------- /packages/clouds/src/constants.ts: -------------------------------------------------------------------------------- 1 | export const CLOUD_SHAPE_TEXTURE_SIZE = 128 2 | export const CLOUD_SHAPE_DETAIL_TEXTURE_SIZE = 32 3 | 4 | // Reference to the latest assets. 5 | const ref = '45a1c6c1bb9fd38b3680fd120795ff4c32df68ff' 6 | export const DEFAULT_LOCAL_WEATHER_URL = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${ref}/packages/clouds/assets/local_weather.png` 7 | export const DEFAULT_SHAPE_URL = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${ref}/packages/clouds/assets/shape.bin` 8 | export const DEFAULT_SHAPE_DETAIL_URL = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${ref}/packages/clouds/assets/shape_detail.bin` 9 | export const DEFAULT_TURBULENCE_URL = `https://media.githubusercontent.com/media/takram-design-engineering/three-geospatial/${ref}/packages/clouds/assets/turbulence.png` 10 | -------------------------------------------------------------------------------- /storybook/tsconfig.storybook.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "emitDecoratorMetadata": true, 5 | "outDir": "", 6 | "types": ["vite/client"] 7 | }, 8 | "files": [ 9 | "../node_modules/@nx/react/typings/styled-jsx.d.ts", 10 | "../node_modules/@nx/react/typings/cssmodule.d.ts", 11 | "../node_modules/@nx/react/typings/image.d.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.spec.ts", 15 | "src/**/*.test.ts", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.js", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.tsx", 20 | "src/**/*.spec.jsx", 21 | "src/**/*.test.js" 22 | ], 23 | "include": [ 24 | "src/**/*.js", 25 | "src/**/*.jsx", 26 | "src/**/*.ts", 27 | "src/**/*.tsx", 28 | "src/**/*.mdx", 29 | ".storybook/*.js", 30 | ".storybook/*.ts", 31 | "../types/**/*.ts", 32 | "types/**/*.ts" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/OutputTextureNode.ts: -------------------------------------------------------------------------------- 1 | import type { Texture } from 'three' 2 | import { TextureNode, type Node, type NodeBuilder } from 'three/webgpu' 3 | 4 | export class OutputTextureNode extends TextureNode { 5 | static override get type(): string { 6 | return 'OutputTextureNode' 7 | } 8 | 9 | owner: Node 10 | 11 | constructor(owner: Node, texture: Texture) { 12 | super(texture) 13 | this.owner = owner 14 | this.setUpdateMatrix(false) 15 | } 16 | 17 | override setup(builder: NodeBuilder): unknown { 18 | this.owner.build(builder) 19 | return super.setup(builder) 20 | } 21 | 22 | override clone(): this { 23 | // @ts-expect-error Ignore 24 | return new this.constructor(this.owner, this.value) 25 | } 26 | } 27 | 28 | export const outputTexture = ( 29 | ...args: ConstructorParameters 30 | ): OutputTextureNode => new OutputTextureNode(...args) 31 | -------------------------------------------------------------------------------- /storybook-webgpu/tsconfig.storybook.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "emitDecoratorMetadata": true, 5 | "outDir": "", 6 | "types": ["vite/client"] 7 | }, 8 | "files": [ 9 | "../node_modules/@nx/react/typings/styled-jsx.d.ts", 10 | "../node_modules/@nx/react/typings/cssmodule.d.ts", 11 | "../node_modules/@nx/react/typings/image.d.ts" 12 | ], 13 | "exclude": [ 14 | "src/**/*.spec.ts", 15 | "src/**/*.test.ts", 16 | "src/**/*.spec.js", 17 | "src/**/*.test.js", 18 | "src/**/*.spec.tsx", 19 | "src/**/*.test.tsx", 20 | "src/**/*.spec.jsx", 21 | "src/**/*.test.js" 22 | ], 23 | "include": [ 24 | "src/**/*.js", 25 | "src/**/*.jsx", 26 | "src/**/*.ts", 27 | "src/**/*.tsx", 28 | "src/**/*.mdx", 29 | ".storybook/*.js", 30 | ".storybook/*.ts", 31 | "../types/**/*.ts", 32 | "types/**/*.ts" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /packages/atmosphere/src/types.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | Data3DTexture, 3 | DataArrayTexture, 4 | Matrix4, 5 | Texture, 6 | Vector2 7 | } from 'three' 8 | 9 | export interface PrecomputedTextures { 10 | irradianceTexture: Texture 11 | scatteringTexture: Data3DTexture 12 | transmittanceTexture: Texture 13 | singleMieScatteringTexture?: Data3DTexture 14 | higherOrderScatteringTexture?: Data3DTexture 15 | } 16 | 17 | export interface AtmosphereOverlay { 18 | map: Texture 19 | } 20 | 21 | export interface AtmosphereShadowLength { 22 | map: Texture 23 | } 24 | 25 | export interface AtmosphereShadow { 26 | map: DataArrayTexture 27 | mapSize: Vector2 28 | cascadeCount: number 29 | intervals: Vector2[] 30 | matrices: Matrix4[] 31 | inverseMatrices: Matrix4[] 32 | far: number 33 | topHeight: number 34 | } 35 | 36 | export interface AtmosphereLightingMask { 37 | map: Texture 38 | channel: 'r' | 'g' | 'b' | 'a' 39 | } 40 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/OutputTexture3DNode.ts: -------------------------------------------------------------------------------- 1 | import type { Texture } from 'three' 2 | import { Texture3DNode, type Node, type NodeBuilder } from 'three/webgpu' 3 | 4 | export class OutputTexture3DNode extends Texture3DNode { 5 | static override get type(): string { 6 | return 'OutputTexture3DNode' 7 | } 8 | 9 | owner: Node 10 | 11 | constructor(owner: Node, texture: Texture) { 12 | super(texture) 13 | this.owner = owner 14 | this.setUpdateMatrix(false) 15 | } 16 | 17 | override setup(builder: NodeBuilder): unknown { 18 | this.owner.build(builder) 19 | return super.setup(builder) 20 | } 21 | 22 | override clone(): this { 23 | // @ts-expect-error Ignore 24 | return new this.constructor(this.owner, this.value) 25 | } 26 | } 27 | 28 | export const outputTexture3D = ( 29 | ...args: ConstructorParameters 30 | ): OutputTexture3DNode => new OutputTexture3DNode(...args) 31 | -------------------------------------------------------------------------------- /packages/core/src/r3f/EllipsoidMesh.tsx: -------------------------------------------------------------------------------- 1 | import { 2 | extend, 3 | type ElementProps, 4 | type ThreeElement 5 | } from '@react-three/fiber' 6 | import type { FC } from 'react' 7 | import type { Mesh } from 'three' 8 | 9 | import { EllipsoidGeometry } from '../EllipsoidGeometry' 10 | 11 | declare module '@react-three/fiber' { 12 | interface ThreeElements { 13 | ellipsoidGeometry: ThreeElement 14 | } 15 | } 16 | 17 | export interface EllipsoidMeshProps 18 | extends Omit, 'args'> { 19 | args?: ConstructorParameters 20 | } 21 | 22 | export const EllipsoidMesh: FC = ({ 23 | ref: forwardedRef, 24 | args, 25 | children, 26 | ...props 27 | }) => { 28 | extend({ EllipsoidGeometry }) 29 | return ( 30 | 31 | 32 | {children} 33 | 34 | ) 35 | } 36 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/3DTilesRenderer.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story } from './3DTilesRenderer-Story' 5 | 6 | import Code from './3DTilesRenderer-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/3D Tiles Renderer Integration', 10 | parameters: { 11 | docs: { 12 | codePanel: true, 13 | source: { 14 | language: 'tsx' 15 | } 16 | } 17 | } 18 | } satisfies Meta 19 | 20 | export const Fuji = createStory(Story, { 21 | props: { 22 | longitude: 138.5973, 23 | latitude: 35.2138, 24 | heading: 71, 25 | pitch: -31, 26 | distance: 7000 27 | }, 28 | args: { 29 | toneMappingExposure: 10, 30 | dayOfYear: 260, 31 | timeOfDay: 16 32 | }, 33 | parameters: { 34 | docs: { 35 | source: { 36 | code: Code 37 | } 38 | } 39 | } 40 | }) 41 | -------------------------------------------------------------------------------- /packages/atmosphere/src/StarsGeometry.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BufferGeometry, 3 | InterleavedBuffer, 4 | InterleavedBufferAttribute, 5 | Sphere, 6 | Vector3 7 | } from 'three' 8 | 9 | export class StarsGeometry extends BufferGeometry { 10 | constructor(data: ArrayBuffer) { 11 | super() 12 | const int16Array = new Int16Array(data) 13 | const uint8Array = new Uint8Array(data) 14 | const int16Buffer = new InterleavedBuffer(int16Array, 5) 15 | const uint8Buffer = new InterleavedBuffer(uint8Array, 10) 16 | this.setAttribute( 17 | 'position', 18 | new InterleavedBufferAttribute(int16Buffer, 3, 0, true) 19 | ) 20 | this.setAttribute( 21 | 'magnitude', 22 | new InterleavedBufferAttribute(uint8Buffer, 1, 6, true) 23 | ) 24 | this.setAttribute( 25 | 'color', 26 | new InterleavedBufferAttribute(uint8Buffer, 3, 7, true) 27 | ) 28 | this.boundingSphere = new Sphere(new Vector3(), 1) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /storybook-webgpu/src/atmosphere/Cityscape.stories.tsx: -------------------------------------------------------------------------------- 1 | import type { Meta } from '@storybook/react-vite' 2 | 3 | import { createStory } from '../components/createStory' 4 | import { Story } from './3DTilesRenderer-Story' 5 | 6 | import StoryCode from './3DTilesRenderer-Story?raw' 7 | 8 | export default { 9 | title: 'atmosphere/Cityscape', 10 | tags: ['order:3'], 11 | parameters: { 12 | docs: { 13 | codePanel: true, 14 | source: { 15 | language: 'tsx' 16 | } 17 | } 18 | } 19 | } satisfies Meta 20 | 21 | export const Cityscape = createStory(Story, { 22 | props: { 23 | longitude: -73.9709, 24 | latitude: 40.7589, 25 | heading: -155, 26 | pitch: -35, 27 | distance: 3000 28 | }, 29 | args: { 30 | toneMappingExposure: 60, 31 | dayOfYear: 1, 32 | timeOfDay: 7.6 33 | }, 34 | parameters: { 35 | docs: { 36 | source: { 37 | code: StoryCode 38 | } 39 | } 40 | } 41 | }) 42 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/usePointOfView.ts: -------------------------------------------------------------------------------- 1 | import { useThree } from '@react-three/fiber' 2 | import { useLayoutEffect } from 'react' 3 | 4 | import { Geodetic, PointOfView, radians } from '@takram/three-geospatial' 5 | 6 | export interface PointOfViewProps { 7 | longitude: number 8 | latitude: number 9 | height?: number 10 | heading: number 11 | pitch: number 12 | distance: number 13 | } 14 | 15 | export function usePointOfView({ 16 | longitude, 17 | latitude, 18 | height = 0, 19 | heading, 20 | pitch, 21 | distance 22 | }: PointOfViewProps): void { 23 | const camera = useThree(({ camera }) => camera) 24 | useLayoutEffect(() => { 25 | new PointOfView(distance, radians(heading), radians(pitch)).decompose( 26 | new Geodetic(radians(longitude), radians(latitude), height).toECEF(), 27 | camera.position, 28 | camera.quaternion, 29 | camera.up 30 | ) 31 | }, [longitude, latitude, height, heading, pitch, distance, camera]) 32 | } 33 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/indirectIrradiance.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | uniform mat3 luminanceFromRadiance; 11 | uniform sampler3D singleRayleighScatteringTexture; 12 | uniform sampler3D singleMieScatteringTexture; 13 | uniform sampler3D multipleScatteringTexture; 14 | uniform int scatteringOrder; 15 | 16 | layout(location = 0) out vec4 outputColor; 17 | 18 | void main() { 19 | vec3 deltaIrradiance; 20 | vec3 irradiance; 21 | deltaIrradiance = ComputeIndirectIrradianceTexture( 22 | ATMOSPHERE, 23 | singleRayleighScatteringTexture, 24 | singleMieScatteringTexture, 25 | multipleScatteringTexture, 26 | gl_FragCoord.xy, 27 | scatteringOrder 28 | ); 29 | irradiance = luminanceFromRadiance * deltaIrradiance; 30 | outputColor = vec4(OUTPUT, 1.0); 31 | } 32 | -------------------------------------------------------------------------------- /packages/core/src/STBNLoader.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Data3DTexture, 3 | NearestFilter, 4 | RedFormat, 5 | RepeatWrapping, 6 | type LoadingManager 7 | } from 'three' 8 | 9 | import { 10 | STBN_TEXTURE_DEPTH, 11 | STBN_TEXTURE_HEIGHT, 12 | STBN_TEXTURE_WIDTH 13 | } from './constants' 14 | import { DataTextureLoader } from './DataTextureLoader' 15 | import { parseUint8Array } from './typedArrayParsers' 16 | 17 | export class STBNLoader extends DataTextureLoader { 18 | constructor(manager?: LoadingManager) { 19 | super( 20 | Data3DTexture, 21 | parseUint8Array, 22 | { 23 | format: RedFormat, 24 | minFilter: NearestFilter, 25 | magFilter: NearestFilter, 26 | wrapS: RepeatWrapping, 27 | wrapT: RepeatWrapping, 28 | wrapR: RepeatWrapping, 29 | width: STBN_TEXTURE_WIDTH, 30 | height: STBN_TEXTURE_HEIGHT, 31 | depth: STBN_TEXTURE_DEPTH 32 | }, 33 | manager 34 | ) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /storybook/src/worker/pool.ts: -------------------------------------------------------------------------------- 1 | import workerpool, { type Pool } from 'workerpool' 2 | import type { ExecOptions } from 'workerpool/types/types' 3 | 4 | import type { TransferResult } from './transfer' 5 | import type { methods } from './worker' 6 | import worker from './worker?worker&url' 7 | 8 | let pool: Pool | undefined 9 | 10 | function createPool(): Pool { 11 | return (pool ??= workerpool.pool(worker, { 12 | workerOpts: { 13 | type: 'module' 14 | } 15 | })) 16 | } 17 | 18 | type Method = keyof typeof methods 19 | type MethodParams = Parameters<(typeof methods)[T]> 20 | type MethodReturnType< 21 | T extends Method, 22 | R = Awaited> 23 | > = R extends TransferResult ? U : R 24 | 25 | export async function queueTask( 26 | method: T, 27 | params?: MethodParams, 28 | options?: ExecOptions 29 | ): Promise> { 30 | return await createPool().exec(method, params, options) 31 | } 32 | -------------------------------------------------------------------------------- /storybook-webgpu/src/worker/pool.ts: -------------------------------------------------------------------------------- 1 | import workerpool, { type Pool } from 'workerpool' 2 | import type { ExecOptions } from 'workerpool/types/types' 3 | 4 | import type { TransferResult } from './transfer' 5 | import type { methods } from './worker' 6 | import worker from './worker?worker&url' 7 | 8 | let pool: Pool | undefined 9 | 10 | function createPool(): Pool { 11 | return (pool ??= workerpool.pool(worker, { 12 | workerOpts: { 13 | type: 'module' 14 | } 15 | })) 16 | } 17 | 18 | type Method = keyof typeof methods 19 | type MethodParams = Parameters<(typeof methods)[T]> 20 | type MethodReturnType< 21 | T extends Method, 22 | R = Awaited> 23 | > = R extends TransferResult ? U : R 24 | 25 | export async function queueTask( 26 | method: T, 27 | params?: MethodParams, 28 | options?: ExecOptions 29 | ): Promise> { 30 | return await createPool().exec(method, params, options) 31 | } 32 | -------------------------------------------------------------------------------- /storybook-webgpu/src/hooks/useCombinedChange.ts: -------------------------------------------------------------------------------- 1 | import type { MotionValue } from 'motion/react' 2 | import { useEffect, useRef } from 'react' 3 | 4 | type InferValues = T extends [ 5 | MotionValue, 6 | ...infer Rest extends MotionValue[] 7 | ] 8 | ? [U, ...InferValues] 9 | : [] 10 | 11 | export function useCombinedChange( 12 | values: T, 13 | onChange: (values: InferValues) => void 14 | ): void { 15 | const ref = useRef(values.map(value => value.get()) as InferValues) 16 | onChange(ref.current) // Initial callback 17 | 18 | useEffect(() => { 19 | const offs = values.map((value, i) => 20 | value.on('change', value => { 21 | ref.current[i] = value 22 | onChange(ref.current) 23 | }) 24 | ) 25 | return () => { 26 | offs.forEach(off => { 27 | off() 28 | }) 29 | } 30 | // eslint-disable-next-line react-hooks/exhaustive-deps 31 | }, [...values, onChange]) 32 | } 33 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/multipleScattering.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | uniform mat3 luminanceFromRadiance; 11 | uniform sampler2D transmittanceTexture; 12 | uniform sampler3D scatteringDensityTexture; 13 | uniform int layer; 14 | 15 | layout(location = 0) out vec4 outputColor; 16 | 17 | void main() { 18 | vec4 deltaMultipleScattering; 19 | vec4 scattering; 20 | float nu; 21 | deltaMultipleScattering.rgb = ComputeMultipleScatteringTexture( 22 | ATMOSPHERE, 23 | transmittanceTexture, 24 | scatteringDensityTexture, 25 | vec3(gl_FragCoord.xy, float(layer) + 0.5), 26 | nu 27 | ); 28 | deltaMultipleScattering.a = 1.0; 29 | scattering = vec4( 30 | luminanceFromRadiance * deltaMultipleScattering.rgb / RayleighPhaseFunction(nu), 31 | 0.0 32 | ); 33 | outputColor = OUTPUT; 34 | } 35 | -------------------------------------------------------------------------------- /packages/clouds/src/helpers/setArrayRenderTargetLayers.ts: -------------------------------------------------------------------------------- 1 | import type { WebGLArrayRenderTarget, WebGLRenderer } from 'three' 2 | import invariant from 'tiny-invariant' 3 | 4 | export function setArrayRenderTargetLayers( 5 | renderer: WebGLRenderer, 6 | outputBuffer: WebGLArrayRenderTarget 7 | ): void { 8 | const property: any = renderer.properties.get(outputBuffer.texture) 9 | const glTexture: WebGLTexture | undefined = property.__webglTexture 10 | 11 | const gl = renderer.getContext() 12 | invariant(gl instanceof WebGL2RenderingContext) 13 | 14 | renderer.setRenderTarget(outputBuffer) 15 | const drawBuffers: number[] = [] 16 | if (glTexture != null) { 17 | for (let layer = 0; layer < outputBuffer.depth; ++layer) { 18 | gl.framebufferTextureLayer( 19 | gl.FRAMEBUFFER, 20 | gl.COLOR_ATTACHMENT0 + layer, 21 | glTexture, 22 | 0, 23 | layer 24 | ) 25 | drawBuffers.push(gl.COLOR_ATTACHMENT0 + layer) 26 | } 27 | } 28 | gl.drawBuffers(drawBuffers) 29 | } 30 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/scatteringDensity.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | uniform sampler2D transmittanceTexture; 11 | uniform sampler3D singleRayleighScatteringTexture; 12 | uniform sampler3D singleMieScatteringTexture; 13 | uniform sampler3D multipleScatteringTexture; 14 | uniform sampler2D irradianceTexture; 15 | uniform int scatteringOrder; 16 | uniform int layer; 17 | 18 | layout(location = 0) out vec4 scatteringDensity; 19 | 20 | void main() { 21 | scatteringDensity.rgb = ComputeScatteringDensityTexture( 22 | ATMOSPHERE, 23 | transmittanceTexture, 24 | singleRayleighScatteringTexture, 25 | singleMieScatteringTexture, 26 | multipleScatteringTexture, 27 | irradianceTexture, 28 | vec3(gl_FragCoord.xy, float(layer) + 0.5), 29 | scatteringOrder 30 | ); 31 | scatteringDensity.a = 1.0; 32 | } 33 | -------------------------------------------------------------------------------- /storybook-webgpu/src/controls/rendererControls.ts: -------------------------------------------------------------------------------- 1 | import type { ArgTypes } from '@storybook/react-vite' 2 | 3 | export interface RendererArgs { 4 | showStats: boolean 5 | forceWebGL: boolean 6 | pixelRatio: number 7 | } 8 | 9 | export const rendererArgs = ( 10 | defaults?: Partial 11 | ): RendererArgs => ({ 12 | showStats: false, 13 | forceWebGL: false, 14 | pixelRatio: Math.min(window.devicePixelRatio, 2), 15 | ...defaults 16 | }) 17 | 18 | export const rendererArgTypes = (): ArgTypes => ({ 19 | showStats: { 20 | control: { 21 | type: 'boolean' 22 | }, 23 | table: { category: 'renderer' } 24 | }, 25 | forceWebGL: { 26 | name: 'force webgl', 27 | control: { 28 | type: 'boolean' 29 | }, 30 | table: { category: 'renderer' } 31 | }, 32 | pixelRatio: { 33 | name: 'pixel ratio', 34 | control: { 35 | type: 'range', 36 | min: 0.5, 37 | max: 3.5, 38 | step: 0.1 39 | }, 40 | table: { category: 'renderer' } 41 | } 42 | }) 43 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/FnVar.ts: -------------------------------------------------------------------------------- 1 | import type { ProxiedTuple, ShaderNodeFn } from 'three/src/nodes/TSL.js' 2 | import { Fn } from 'three/tsl' 3 | import type { NodeBuilder } from 'three/webgpu' 4 | 5 | type NonCallable = T extends (...args: any[]) => any ? never : T 6 | 7 | export function FnVar( 8 | callback: (...args: Args) => (builder: NodeBuilder) => R 9 | ): ShaderNodeFn> 10 | 11 | export function FnVar( 12 | callback: (...args: Args) => NonCallable 13 | ): ShaderNodeFn> 14 | 15 | export function FnVar( 16 | callback: 17 | | ((...args: Args) => R) 18 | | ((...args: Args) => (builder: NodeBuilder) => R) 19 | ): ShaderNodeFn> { 20 | return Fn((args: Args, builder: NodeBuilder) => { 21 | const result = callback(...args) 22 | return typeof result === 'function' 23 | ? (result as (builder: NodeBuilder) => R)(builder) 24 | : result 25 | }) 26 | } 27 | -------------------------------------------------------------------------------- /packages/clouds/src/ShaderArrayPass.ts: -------------------------------------------------------------------------------- 1 | import { ShaderPass, type CopyMaterial } from 'postprocessing' 2 | import type { 3 | Uniform, 4 | WebGLArrayRenderTarget, 5 | WebGLRenderer, 6 | WebGLRenderTarget 7 | } from 'three' 8 | 9 | import { setArrayRenderTargetLayers } from './helpers/setArrayRenderTargetLayers' 10 | 11 | export class ShaderArrayPass extends ShaderPass { 12 | declare input: string 13 | 14 | override render( 15 | renderer: WebGLRenderer, 16 | inputBuffer: WebGLRenderTarget | null, 17 | outputBuffer: WebGLArrayRenderTarget, 18 | deltaTime?: number, 19 | stencilTest?: boolean 20 | ): void { 21 | const uniforms = ( 22 | this.fullscreenMaterial as CopyMaterial & { 23 | uniforms?: Record 24 | } 25 | ).uniforms 26 | if (inputBuffer !== null && uniforms?.[this.input] != null) { 27 | uniforms[this.input].value = inputBuffer.texture 28 | } 29 | setArrayRenderTargetLayers(renderer, outputBuffer) 30 | renderer.render(this.scene, this.camera) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /packages/core/README.md: -------------------------------------------------------------------------------- 1 | # @takram/three-geospatial 2 | 3 | [![npm version](https://img.shields.io/npm/v/@takram/three-geospatial.svg?style=flat-square)](https://www.npmjs.com/package/@takram/three-geospatial) [![Storybook](https://img.shields.io/badge/-Storybook-FF4785?style=flat-square&logo=storybook&logoColor=white)](https://takram-design-engineering.github.io/three-geospatial/?path=/story/atmosphere-atmosphere--basic) 4 | 5 | Provides fundamental functions for rendering GIS data in Three.js and R3F (React Three Fiber). 6 | 7 | This library is currently under active development, and its API may change without maintaining backward compatibility. 8 | 9 | It is part of a project to prototype the rendering aspect of a Web GIS engine. For more details on the background and current status of this project, please refer to the [main README](/README.md). 10 | 11 | ## Installation 12 | 13 | ```sh 14 | npm install @takram/three-geospatial 15 | pnpm add @takram/three-geospatial 16 | yarn add @takram/three-geospatial 17 | ``` 18 | 19 | ## License 20 | 21 | [MIT](LICENSE) 22 | -------------------------------------------------------------------------------- /packages/effects/README.md: -------------------------------------------------------------------------------- 1 | # @takram/three-geospatial-effects 2 | 3 | [![npm version](https://img.shields.io/npm/v/@takram/three-geospatial-effects.svg?style=flat-square)](https://www.npmjs.com/package/@takram/three-geospatial-effects) [![Storybook](https://img.shields.io/badge/-Storybook-FF4785?style=flat-square&logo=storybook&logoColor=white)](https://takram-design-engineering.github.io/three-geospatial/?path=/story/atmosphere-atmosphere--basic) 4 | 5 | A collection of post-processing effects. 6 | 7 | This library is currently under active development, and its API may change without maintaining backward compatibility. 8 | 9 | It is part of a project to prototype the rendering aspect of a Web GIS engine. For more details on the background and current status of this project, please refer to the [main README](/README.md). 10 | 11 | ## Installation 12 | 13 | ```sh 14 | npm install @takram/three-geospatial-effects 15 | pnpm add @takram/three-geospatial-effects 16 | yarn add @takram/three-geospatial-effects 17 | ``` 18 | 19 | ## License 20 | 21 | [MIT](LICENSE) 22 | -------------------------------------------------------------------------------- /storybook/src/atmosphere/Stars-BlackBodyChromaticity.tsx: -------------------------------------------------------------------------------- 1 | import type { StoryFn } from '@storybook/react-vite' 2 | import { useMemo } from 'react' 3 | import { Color } from 'three' 4 | 5 | import { convertTemperatureToLinearSRGBChromaticity } from '@takram/three-atmosphere' 6 | 7 | const Story: StoryFn = () => { 8 | const minTemperature = 1400 9 | const maxTemperature = 16000 10 | 11 | const gradient = useMemo(() => { 12 | const color = new Color() 13 | const colors: string[] = [] 14 | for (let T = minTemperature; T <= maxTemperature; T += 10) { 15 | convertTemperatureToLinearSRGBChromaticity(T, color) 16 | const { r, g, b } = color.convertLinearToSRGB() 17 | colors.push(`rgb(${Math.round(r * 0xff)}, ${g * 0xff}, ${b * 0xff})`) 18 | } 19 | const scale = 100 / (colors.length - 1) 20 | return `linear-gradient(90deg, ${colors.map((color, index) => `${color} ${index * scale}%`).join(', ')})` 21 | }, []) 22 | 23 | return
24 | } 25 | 26 | export default Story 27 | -------------------------------------------------------------------------------- /packages/atmosphere/src/helpers/functions.ts: -------------------------------------------------------------------------------- 1 | import type { AtmosphereParameters } from '../AtmosphereParameters' 2 | 3 | export function safeSqrt(a: number): number { 4 | return Math.sqrt(Math.max(a, 0)) 5 | } 6 | 7 | export function clampDistance(d: number): number { 8 | return Math.max(d, 0) 9 | } 10 | 11 | export function rayIntersectsGround( 12 | atmosphere: AtmosphereParameters, 13 | r: number, 14 | mu: number 15 | ): boolean { 16 | const { bottomRadius } = atmosphere 17 | return mu < 0 && r ** 2 * (mu ** 2 - 1) + bottomRadius ** 2 >= 0 18 | } 19 | 20 | export function distanceToTopAtmosphereBoundary( 21 | atmosphere: AtmosphereParameters, 22 | r: number, 23 | mu: number 24 | ): number { 25 | const { topRadius } = atmosphere 26 | const discriminant = r ** 2 * (mu ** 2 - 1) + topRadius ** 2 27 | return clampDistance(-r * mu + safeSqrt(discriminant)) 28 | } 29 | 30 | export function getTextureCoordFromUnitRange( 31 | x: number, 32 | textureSize: number 33 | ): number { 34 | return 0.5 / textureSize + x * (1 - 1 / textureSize) 35 | } 36 | -------------------------------------------------------------------------------- /storybook/src/helpers/Stats.tsx: -------------------------------------------------------------------------------- 1 | import { useFrame, useThree } from '@react-three/fiber' 2 | import { useEffect, useRef, type FC } from 'react' 3 | import StatsImpl from 'stats-gl' 4 | 5 | import { useControls } from '../helpers/useControls' 6 | 7 | export const Stats: FC = () => { 8 | const { show } = useControls('stats', { show: false }, { collapsed: true }) 9 | 10 | const statsRef = useRef(undefined) 11 | const renderer = useThree(({ gl }) => gl) 12 | useEffect(() => { 13 | if (!show) { 14 | statsRef.current = undefined 15 | return 16 | } 17 | const stats = new StatsImpl({ 18 | trackGPU: true, 19 | precision: 0 20 | }) 21 | stats.init(renderer).catch((error: unknown) => { 22 | console.error(error) 23 | }) 24 | statsRef.current = stats 25 | document.body.appendChild(stats.dom) 26 | return () => { 27 | document.body.removeChild(stats.dom) 28 | } 29 | }, [show, renderer]) 30 | 31 | useFrame(() => { 32 | statsRef.current?.update() 33 | }) 34 | 35 | return null 36 | } 37 | -------------------------------------------------------------------------------- /packages/core/src/shaders/index.ts: -------------------------------------------------------------------------------- 1 | import _cascadedShadowMaps from './cascadedShadowMaps.glsl?raw' 2 | import _depth from './depth.glsl?raw' 3 | import _generators from './generators.glsl?raw' 4 | import _interleavedGradientNoise from './interleavedGradientNoise.glsl?raw' 5 | import _math from './math.glsl?raw' 6 | import _packing from './packing.glsl?raw' 7 | import _raySphereIntersection from './raySphereIntersection.glsl?raw' 8 | import _transform from './transform.glsl?raw' 9 | import _turbo from './turbo.glsl?raw' 10 | import _vogelDisk from './vogelDisk.glsl?raw' 11 | 12 | export const cascadedShadowMaps: string = _cascadedShadowMaps 13 | export const depth: string = _depth 14 | export const generators: string = _generators 15 | export const interleavedGradientNoise = _interleavedGradientNoise 16 | export const math: string = _math 17 | export const packing: string = _packing 18 | export const raySphereIntersection: string = _raySphereIntersection 19 | export const transform: string = _transform 20 | export const turbo: string = _turbo 21 | export const vogelDisk = _vogelDisk 22 | -------------------------------------------------------------------------------- /packages/clouds/src/DensityProfile.ts: -------------------------------------------------------------------------------- 1 | export interface DensityProfileLike 2 | extends Partial< 3 | Pick 4 | > {} 5 | 6 | export class DensityProfile { 7 | constructor( 8 | public expTerm = 0, 9 | public exponent = 0, 10 | public linearTerm = 0, 11 | public constantTerm = 0 12 | ) {} 13 | 14 | set(expTerm = 0, exponent = 0, linearTerm = 0, constantTerm = 0): this { 15 | this.expTerm = expTerm 16 | this.exponent = exponent 17 | this.linearTerm = linearTerm 18 | this.constantTerm = constantTerm 19 | return this 20 | } 21 | 22 | clone(): DensityProfile { 23 | return new DensityProfile( 24 | this.expTerm, 25 | this.exponent, 26 | this.linearTerm, 27 | this.constantTerm 28 | ) 29 | } 30 | 31 | copy(other: DensityProfile): this { 32 | this.expTerm = other.expTerm 33 | this.exponent = other.exponent 34 | this.linearTerm = other.linearTerm 35 | this.constantTerm = other.constantTerm 36 | return this 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/atmosphere/src/shaders/precompute/singleScattering.frag: -------------------------------------------------------------------------------- 1 | precision highp float; 2 | precision highp sampler3D; 3 | 4 | #include "bruneton/definitions" 5 | #include "bruneton/common" 6 | #include "bruneton/precompute" 7 | 8 | uniform AtmosphereParameters ATMOSPHERE; 9 | 10 | uniform mat3 luminanceFromRadiance; 11 | uniform sampler2D transmittanceTexture; 12 | uniform int layer; 13 | 14 | layout(location = 0) out vec4 outputColor; 15 | 16 | void main() { 17 | vec4 deltaRayleigh; 18 | vec4 deltaMie; 19 | vec4 scattering; 20 | vec4 singleMieScattering; 21 | ComputeSingleScatteringTexture( 22 | ATMOSPHERE, 23 | transmittanceTexture, 24 | vec3(gl_FragCoord.xy, float(layer) + 0.5), 25 | deltaRayleigh.rgb, 26 | deltaMie.rgb 27 | ); 28 | deltaRayleigh.a = 1.0; 29 | deltaMie.a = 1.0; 30 | scattering = vec4( 31 | luminanceFromRadiance * deltaRayleigh.rgb, 32 | (luminanceFromRadiance * deltaMie.rgb).r 33 | ); 34 | singleMieScattering.rgb = luminanceFromRadiance * deltaMie.rgb; 35 | singleMieScattering.a = 1.0; 36 | outputColor = OUTPUT; 37 | } 38 | -------------------------------------------------------------------------------- /.github/workflows/storybook.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: 4 | - 'main' 5 | 6 | permissions: 7 | contents: read 8 | pages: write 9 | id-token: write 10 | 11 | jobs: 12 | deploy: 13 | environment: github-pages 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v4 17 | with: 18 | lfs: true 19 | 20 | - uses: pnpm/action-setup@v4 21 | with: 22 | version: 9 23 | 24 | - uses: actions/setup-node@v4 25 | with: 26 | node-version: '22.x' 27 | cache: 'pnpm' 28 | 29 | - run: | 30 | pnpm install --frozen-lockfile 31 | npx nx build-storybook 32 | env: 33 | STORYBOOK_ION_API_TOKEN: ${{secrets.STORYBOOK_ION_API_TOKEN}} 34 | STORYBOOK_GOOGLE_MAP_API_KEY: ${{secrets.STORYBOOK_GOOGLE_MAP_API_KEY}} 35 | 36 | - uses: actions/upload-pages-artifact@v3 37 | with: 38 | path: 'storybook/storybook-static' 39 | 40 | - uses: actions/deploy-pages@v4 41 | with: 42 | token: ${{ github.token }} 43 | -------------------------------------------------------------------------------- /packages/core/src/webgpu/internals.ts: -------------------------------------------------------------------------------- 1 | import { Vector2 } from 'three' 2 | 3 | // prettier-ignore 4 | const bayerIndices: readonly number[] = [ 5 | 0, 8, 2, 10, 6 | 12, 4, 14, 6, 7 | 3, 11, 1, 9, 8 | 15, 7, 13, 5 9 | ] 10 | 11 | export const bayerOffsets: readonly Vector2[] = 12 | /*#__PURE__*/ bayerIndices.reduce((result, _, index) => { 13 | const offset = new Vector2() 14 | for (let i = 0; i < 16; ++i) { 15 | if (bayerIndices[i] === index) { 16 | offset.set(((i % 4) + 0.5) / 4, (Math.floor(i / 4) + 0.5) / 4) 17 | break 18 | } 19 | } 20 | return [...result, offset] 21 | }, []) 22 | 23 | function halton(index: number, base: number): number { 24 | let fraction = 1 25 | let result = 0 26 | while (index > 0) { 27 | fraction /= base 28 | result += fraction * (index % base) 29 | index = Math.floor(index / base) 30 | } 31 | return result 32 | } 33 | 34 | export const haltonOffsets: readonly Vector2[] = /*#__PURE__*/ Array.from( 35 | { length: 16 }, 36 | (_, index) => new Vector2(halton(index + 1, 2), halton(index + 1, 3)) 37 | ) 38 | -------------------------------------------------------------------------------- /packages/core/src/ArrayBufferLoader.ts: -------------------------------------------------------------------------------- 1 | import { FileLoader, Loader } from 'three' 2 | import invariant from 'tiny-invariant' 3 | 4 | export class ArrayBufferLoader extends Loader { 5 | override load( 6 | url: string, 7 | onLoad: (data: ArrayBuffer) => void, 8 | onProgress?: (event: ProgressEvent) => void, 9 | onError?: (error: unknown) => void 10 | ): void { 11 | const loader = new FileLoader(this.manager) 12 | loader.setResponseType('arraybuffer') 13 | loader.setRequestHeader(this.requestHeader) 14 | loader.setPath(this.path) 15 | loader.setWithCredentials(this.withCredentials) 16 | loader.load( 17 | url, 18 | arrayBuffer => { 19 | invariant(arrayBuffer instanceof ArrayBuffer) 20 | try { 21 | onLoad(arrayBuffer) 22 | } catch (error) { 23 | if (onError != null) { 24 | onError(error) 25 | } else { 26 | console.error(error) 27 | } 28 | this.manager.itemError(url) 29 | } 30 | }, 31 | onProgress, 32 | onError 33 | ) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /storybook-webgpu/src/components/Stats.tsx: -------------------------------------------------------------------------------- 1 | import { addAfterEffect, useThree } from '@react-three/fiber' 2 | import { useEffect, type FC } from 'react' 3 | import StatsImpl from 'stats-gl' 4 | 5 | import type { RendererArgs } from '../controls/rendererControls' 6 | import { useControl } from '../hooks/useControl' 7 | 8 | export const Stats: FC = () => { 9 | const show = useControl(({ showStats }: RendererArgs) => showStats) 10 | const renderer = useThree(({ gl }) => gl) 11 | 12 | useEffect(() => { 13 | if (!show) { 14 | return 15 | } 16 | const stats = new StatsImpl({ 17 | trackGPU: true, 18 | trackCPT: true, 19 | horizontal: false 20 | }) 21 | stats 22 | .init(renderer) 23 | .then(() => { 24 | addAfterEffect(() => { 25 | stats.update() 26 | }) 27 | }) 28 | .catch((error: unknown) => { 29 | console.error(error) 30 | }) 31 | 32 | document.body.appendChild(stats.dom) 33 | return () => { 34 | document.body.removeChild(stats.dom) 35 | } 36 | }, [show, renderer]) 37 | 38 | return null 39 | } 40 | -------------------------------------------------------------------------------- /storybook/src/helpers/useLocationControls.tsx: -------------------------------------------------------------------------------- 1 | import type { FolderSettings } from 'leva/dist/declarations/src/types' 2 | 3 | import type { GeodeticLike } from '@takram/three-geospatial' 4 | 5 | import { useControls } from './useControls' 6 | 7 | export interface LocationControlValues { 8 | longitude: number 9 | latitude: number 10 | height: number 11 | maxHeight?: number 12 | } 13 | 14 | export function useLocationControls( 15 | { 16 | longitude: initialLongitude = 0, 17 | latitude: initialLatitude = 35, 18 | height: initialHeight = 2000, 19 | maxHeight = 30000 20 | }: Partial = {}, 21 | folderSettings?: FolderSettings 22 | ): GeodeticLike { 23 | const { longitude, latitude, altitude } = useControls( 24 | 'location', 25 | { 26 | longitude: { value: initialLongitude, min: -180, max: 180 }, 27 | latitude: { value: initialLatitude, min: -90, max: 90 }, 28 | altitude: { value: initialHeight, min: 0, max: maxHeight } 29 | }, 30 | folderSettings, 31 | [maxHeight] 32 | ) 33 | return { longitude, latitude, height: altitude } 34 | } 35 | -------------------------------------------------------------------------------- /apps/data/src/targets/stbn.ts: -------------------------------------------------------------------------------- 1 | import { writeFile } from 'node:fs/promises' 2 | import sharp from 'sharp' 3 | import invariant from 'tiny-invariant' 4 | 5 | const WIDTH = 128 6 | const HEIGHT = 128 7 | const DEPTH = 64 8 | 9 | export default async function (): Promise { 10 | const bytesPerLayer = WIDTH * HEIGHT 11 | const result = new Uint8Array(bytesPerLayer * DEPTH) 12 | 13 | for (let depth = 0; depth < DEPTH; ++depth) { 14 | const scalarImage = sharp( 15 | `apps/data/data/STBN/stbn_scalar_2Dx1Dx1D_128x128x64x1_${depth}.png` 16 | ) 17 | const scalar = await scalarImage 18 | .extractChannel(0) 19 | .raw({ depth: 'uchar' }) 20 | .toBuffer() 21 | const byteLength = scalar.byteLength 22 | invariant(byteLength === bytesPerLayer) 23 | 24 | for ( 25 | let layerIndex = 0, resultIndex = bytesPerLayer * depth; 26 | layerIndex < byteLength; 27 | ++layerIndex, ++resultIndex 28 | ) { 29 | result[resultIndex] = scalar[layerIndex] 30 | } 31 | } 32 | await writeFile('packages/core/assets/stbn.bin', result) 33 | 34 | console.log('Done') 35 | } 36 | -------------------------------------------------------------------------------- /apps/data/src/targets/atmosphere.ts: -------------------------------------------------------------------------------- 1 | import { readFile, writeFile } from 'node:fs/promises' 2 | 3 | import { Float16Array, parseFloat32Array } from '@takram/three-geospatial' 4 | 5 | export default async function (): Promise { 6 | const irradiance = new Float16Array([ 7 | ...parseFloat32Array( 8 | (await readFile('apps/data/data/irradiance.bin')).buffer 9 | ) 10 | ]) 11 | const scattering = new Float16Array([ 12 | ...parseFloat32Array( 13 | (await readFile('apps/data/data/scattering.bin')).buffer 14 | ) 15 | ]) 16 | const transmittance = new Float16Array([ 17 | ...parseFloat32Array( 18 | (await readFile('apps/data/data/transmittance.bin')).buffer 19 | ) 20 | ]) 21 | 22 | await writeFile( 23 | 'packages/atmosphere/assets/irradiance.bin', 24 | Buffer.from(irradiance.buffer) 25 | ) 26 | await writeFile( 27 | 'packages/atmosphere/assets/scattering.bin', 28 | Buffer.from(scattering.buffer) 29 | ) 30 | await writeFile( 31 | 'packages/atmosphere/assets/transmittance.bin', 32 | Buffer.from(transmittance.buffer) 33 | ) 34 | 35 | console.log('Done') 36 | } 37 | -------------------------------------------------------------------------------- /packages/effects/src/shaders/downsampleThreshold.vert: -------------------------------------------------------------------------------- 1 | uniform vec2 texelSize; 2 | 3 | out vec2 vCenterUv1; 4 | out vec2 vCenterUv2; 5 | out vec2 vCenterUv3; 6 | out vec2 vCenterUv4; 7 | out vec2 vRowUv1; 8 | out vec2 vRowUv2; 9 | out vec2 vRowUv3; 10 | out vec2 vRowUv4; 11 | out vec2 vRowUv5; 12 | out vec2 vRowUv6; 13 | out vec2 vRowUv7; 14 | out vec2 vRowUv8; 15 | out vec2 vRowUv9; 16 | 17 | void main() { 18 | vec2 uv = position.xy * 0.5 + 0.5; 19 | vCenterUv1 = uv + texelSize * vec2(-1.0, 1.0); 20 | vCenterUv2 = uv + texelSize * vec2(1.0, 1.0); 21 | vCenterUv3 = uv + texelSize * vec2(-1.0, -1.0); 22 | vCenterUv4 = uv + texelSize * vec2(1.0, -1.0); 23 | vRowUv1 = uv + texelSize * vec2(-2.0, 2.0); 24 | vRowUv2 = uv + texelSize * vec2(0.0, 2.0); 25 | vRowUv3 = uv + texelSize * vec2(2.0, 2.0); 26 | vRowUv4 = uv + texelSize * vec2(-2.0, 0.0); 27 | vRowUv5 = uv + texelSize; 28 | vRowUv6 = uv + texelSize * vec2(2.0, 0.0); 29 | vRowUv7 = uv + texelSize * vec2(-2.0, -2.0); 30 | vRowUv8 = uv + texelSize * vec2(0.0, -2.0); 31 | vRowUv9 = uv + texelSize * vec2(2.0, -2.0); 32 | 33 | gl_Position = vec4(position.xy, 1.0, 1.0); 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2024 Shota Matsuda 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /storybook/src/helpers/GoogleMapsAPIKeyPrompt.tsx: -------------------------------------------------------------------------------- 1 | import { css } from '@emotion/react' 2 | import { useAtomValue } from 'jotai' 3 | import type { FC } from 'react' 4 | 5 | import { needsApiKeyAtom } from './states' 6 | 7 | export const GoogleMapsAPIKeyPrompt: FC = () => { 8 | const needsApiKey = useAtomValue(needsApiKeyAtom) 9 | return ( 10 | needsApiKey && ( 11 |
22 | Our API key has seemingly exceeded its daily quota. 23 |
24 | Enter your{' '} 25 | 31 | Google Maps API key 32 | {' '} 33 | at the top right of this screen, or check back tomorrow. 34 |
35 | ) 36 | ) 37 | } 38 | --------------------------------------------------------------------------------