threejs-awesome-graphics-agent-skills 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/package.json +8 -1
- package/skills/threejs-atmosphere-aerial-perspective/SKILL.md +5 -3
- package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/irradiance.exr +0 -0
- package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/scattering.exr +0 -0
- package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/transmittance.exr +0 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/atmosphere-effect.js +11 -639
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/AerialPerspectiveEffect.ts +645 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/AtmosphereMaterialBase.ts +282 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/AtmosphereParameters.ts +75 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/IrradianceMaskPass.ts +171 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/PrecomputedTexturesLoader.ts +137 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/SkyLightProbe.ts +131 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/SkyMaterial.ts +200 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/StarsGeometry.ts +30 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/StarsMaterial.ts +144 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/SunDirectionalLight.ts +91 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/blackBodyChromaticity.ts +59 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/celestialDirections.ts +92 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/constants.ts +18 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/getAltitudeCorrectionOffset.ts +29 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/getSunLightColor.ts +106 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/helpers/functions.ts +35 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/helpers/sampleTexture.ts +56 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/index.ts +16 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/aerialPerspectiveEffect.frag +357 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/aerialPerspectiveEffect.vert +63 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/functions.glsl +580 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/index.ts +5 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/irradianceMask.frag +74 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/parameters.glsl +14 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/sky.frag +102 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/sky.glsl +81 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/sky.vert +58 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/stars.frag +50 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/shaders/stars.vert +50 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/atmosphere/types.ts +30 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/DepthEffect.ts +77 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/DitheringEffect.ts +24 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/DownsampleThresholdMaterial.ts +82 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/GeometryEffect.ts +83 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/GeometryPass.ts +53 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/LensFlareEffect.ts +194 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/LensFlareFeaturesMaterial.ts +94 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/NormalEffect.ts +119 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/createHaldLookupTexture.ts +20 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/index.ts +7 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/setupMaterialsForGeometryPass.ts +129 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/depthEffect.frag +19 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/ditheringEffect.frag +7 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/downsampleThreshold.frag +78 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/downsampleThreshold.vert +34 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/geometryEffect.frag +19 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/lensFlareEffect.frag +9 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/lensFlareFeatures.frag +73 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/lensFlareFeatures.vert +10 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/effects/shaders/normalEffect.frag +41 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/ArrayBufferLoader.ts +35 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/DataLoader.ts +164 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/EXR3DLoader.ts +48 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/Ellipsoid.ts +147 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/EllipsoidGeometry.ts +107 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/Geodetic.ts +160 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/PointOfView.ts +169 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/Rectangle.ts +97 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/STBNLoader.ts +21 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/Texture3DLoader.ts +81 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/TileCoordinate.ts +112 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/TilingScheme.ts +80 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/TypedArrayLoader.ts +53 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/assertions.ts +1 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/bufferGeometry.ts +87 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/constants.ts +6 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/decorators.ts +207 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/defineShorthand.ts +68 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/helpers/projectOnEllipsoidSurface.ts +72 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/index.ts +23 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/math.ts +77 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/resolveIncludes.ts +22 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/cascadedShadowMaps.glsl +79 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/depth.glsl +17 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/generators.glsl +9 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/index.ts +21 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/interleavedGradientNoise.glsl +6 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/math.glsl +92 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/packing.glsl +20 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/raySphereIntersection.glsl +134 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/transform.glsl +12 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/turbo.glsl +9 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/shaders/vogelDisk.glsl +8 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/typedArray.ts +45 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/typedArrayParsers.ts +103 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/types.ts +8 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/geospatial/unrollLoops.ts +23 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/vendor/tiny-invariant.ts +5 -0
- package/skills/threejs-atmosphere-aerial-perspective/examples/lut-aerial-perspective/source/vendor/url-join.ts +23 -0
- package/skills/threejs-procedural-architecture/SKILL.md +5 -3
- package/skills/threejs-procedural-architecture/examples/procedural-financial-tower/building-system.js +3073 -0
- package/skills/threejs-procedural-architecture/examples/procedural-financial-tower/shadow-clipmaps.js +299 -0
- package/skills/threejs-procedural-architecture/references/grammar-and-mesh-compiler.md +1 -1
- package/skills/threejs-procedural-geometry/SKILL.md +1 -1
- package/skills/threejs-raymarched-space-effects/SKILL.md +6 -0
- package/skills/threejs-raymarched-space-effects/examples/schwarzschild-geodesic-black-hole/geodesic-black-hole-effect.js +634 -0
- package/skills/threejs-shadow-systems/SKILL.md +1 -1
- package/skills/threejs-volumetric-clouds/SKILL.md +4 -5
- package/skills/threejs-volumetric-clouds/assets/weather-volume-clouds/atmosphere/irradiance.exr +0 -0
- package/skills/threejs-volumetric-clouds/assets/weather-volume-clouds/atmosphere/scattering.exr +0 -0
- package/skills/threejs-volumetric-clouds/assets/weather-volume-clouds/atmosphere/transmittance.exr +0 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/cloud-effect.js +13 -164
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/AerialPerspectiveEffect.ts +645 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/AtmosphereMaterialBase.ts +282 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/AtmosphereParameters.ts +75 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/IrradianceMaskPass.ts +171 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/PrecomputedTexturesLoader.ts +137 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/SkyLightProbe.ts +131 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/SkyMaterial.ts +200 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/StarsGeometry.ts +30 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/StarsMaterial.ts +144 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/SunDirectionalLight.ts +91 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/blackBodyChromaticity.ts +59 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/celestialDirections.ts +92 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/constants.ts +18 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/getAltitudeCorrectionOffset.ts +29 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/getSunLightColor.ts +106 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/helpers/functions.ts +35 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/helpers/sampleTexture.ts +56 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/index.ts +16 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/aerialPerspectiveEffect.frag +357 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/aerialPerspectiveEffect.vert +63 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/functions.glsl +580 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/index.ts +5 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/irradianceMask.frag +74 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/parameters.glsl +14 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/sky.frag +102 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/sky.glsl +81 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/sky.vert +58 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/stars.frag +50 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/shaders/stars.vert +50 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/atmosphere/types.ts +30 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CascadedShadowMaps.ts +288 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudLayer.ts +85 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudLayers.ts +181 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudShape.ts +22 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudShapeDetail.ts +22 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudsEffect.ts +806 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudsMaterial.ts +473 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudsPass.ts +285 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/CloudsResolveMaterial.ts +108 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/DensityProfile.ts +38 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/LocalWeather.ts +21 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/PassBase.ts +28 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/Procedural3DTexture.ts +94 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/ProceduralTexture.ts +94 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/ShaderArrayPass.ts +32 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/ShadowMaterial.ts +141 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/ShadowPass.ts +185 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/ShadowResolveMaterial.ts +72 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/Turbulence.ts +21 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/bayer.ts +23 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/constants.ts +8 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/helpers/FrustumCorners.ts +138 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/helpers/setArrayRenderTargetLayers.ts +32 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/helpers/splitFrustum.ts +59 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/index.ts +14 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/qualityPresets.ts +121 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/catmullRomSampling.glsl +113 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/cloudShape.frag +78 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/cloudShapeDetail.frag +56 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/clouds.frag +1008 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/clouds.glsl +190 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/clouds.vert +69 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/cloudsEffect.frag +11 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/cloudsResolve.frag +202 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/cloudsResolve.vert +10 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/localWeather.frag +83 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/parameters.glsl +65 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/perlin.glsl +211 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/shadow.frag +197 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/shadow.vert +16 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/shadowResolve.frag +76 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/shadowResolve.vert +10 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/structuredSampling.glsl +101 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/tileableNoise.glsl +88 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/turbulence.frag +51 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/types.glsl +18 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/shaders/varianceClipping.glsl +114 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/clouds/uniforms.ts +218 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/DepthEffect.ts +77 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/DitheringEffect.ts +24 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/DownsampleThresholdMaterial.ts +82 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/GeometryEffect.ts +83 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/GeometryPass.ts +53 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/LensFlareEffect.ts +194 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/LensFlareFeaturesMaterial.ts +94 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/NormalEffect.ts +119 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/createHaldLookupTexture.ts +20 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/index.ts +7 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/setupMaterialsForGeometryPass.ts +129 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/depthEffect.frag +19 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/ditheringEffect.frag +7 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/downsampleThreshold.frag +78 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/downsampleThreshold.vert +34 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/geometryEffect.frag +19 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/lensFlareEffect.frag +9 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/lensFlareFeatures.frag +73 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/lensFlareFeatures.vert +10 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/effects/shaders/normalEffect.frag +41 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/ArrayBufferLoader.ts +35 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/DataLoader.ts +164 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/EXR3DLoader.ts +48 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/Ellipsoid.ts +147 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/EllipsoidGeometry.ts +107 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/Geodetic.ts +160 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/PointOfView.ts +169 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/Rectangle.ts +97 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/STBNLoader.ts +21 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/Texture3DLoader.ts +81 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/TileCoordinate.ts +112 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/TilingScheme.ts +80 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/TypedArrayLoader.ts +53 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/assertions.ts +1 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/bufferGeometry.ts +87 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/constants.ts +6 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/decorators.ts +207 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/defineShorthand.ts +68 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/helpers/projectOnEllipsoidSurface.ts +72 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/index.ts +23 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/math.ts +77 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/resolveIncludes.ts +22 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/cascadedShadowMaps.glsl +79 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/depth.glsl +17 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/generators.glsl +9 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/index.ts +21 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/interleavedGradientNoise.glsl +6 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/math.glsl +92 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/packing.glsl +20 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/raySphereIntersection.glsl +134 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/transform.glsl +12 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/turbo.glsl +9 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/shaders/vogelDisk.glsl +8 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/typedArray.ts +45 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/typedArrayParsers.ts +103 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/types.ts +8 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/geospatial/unrollLoops.ts +23 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/vendor/tiny-invariant.ts +5 -0
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/source/vendor/url-join.ts +23 -0
- package/source_materials/THIRD_PARTY_NOTICES.md +25 -0
- package/source_materials/trace-manifest.json +145 -4
- package/skills/threejs-procedural-architecture/examples/authored-financial-tower/building-system.js +0 -416
- package/skills/threejs-procedural-architecture/examples/authored-financial-tower/shadow-clipmaps.js +0 -336
- package/skills/threejs-volumetric-clouds/examples/weather-volume-clouds/cloud-system.js +0 -680
- /package/skills/threejs-procedural-architecture/assets/{authored-financial-tower → procedural-financial-tower}/THIRD_PARTY_LICENSES.md +0 -0
- /package/skills/threejs-procedural-architecture/assets/{authored-financial-tower → procedural-financial-tower}/limestone-albedo.png +0 -0
- /package/skills/threejs-procedural-architecture/assets/{authored-financial-tower → procedural-financial-tower}/limestone-normal.png +0 -0
- /package/skills/threejs-procedural-architecture/assets/{authored-financial-tower → procedural-financial-tower}/ornaments-albedo.png +0 -0
- /package/skills/threejs-procedural-architecture/assets/{authored-financial-tower → procedural-financial-tower}/ornaments-normal.png +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "threejs-awesome-graphics-agent-skills",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Expert agent skills for creating exceptional Three.js graphics.",
|
|
5
5
|
"license": "MIT AND GPL-3.0-only",
|
|
6
6
|
"author": "Scott",
|
|
@@ -60,8 +60,15 @@
|
|
|
60
60
|
"prepublishOnly": "npm run check:freshness"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
+
"@petamoriken/float16": "^3.9.2",
|
|
64
|
+
"astronomy-engine": "^2.1.19",
|
|
65
|
+
"esbuild": "^0.25.3",
|
|
63
66
|
"playwright": "^1.60.0",
|
|
67
|
+
"postprocessing": "^6.37.4",
|
|
64
68
|
"three": "^0.184.0",
|
|
69
|
+
"three-stdlib": "^2.36.0",
|
|
70
|
+
"tiny-invariant": "^1.3.3",
|
|
71
|
+
"url-join": "^5.0.0",
|
|
65
72
|
"yaml": "^2.9.0"
|
|
66
73
|
}
|
|
67
74
|
}
|
|
@@ -17,9 +17,11 @@ Read [references/atmosphere-system-contract.md](references/atmosphere-system-con
|
|
|
17
17
|
before implementation. It separates the LUT/ellipsoid architecture from
|
|
18
18
|
dynamic integration and the shell/post handoff.
|
|
19
19
|
|
|
20
|
-
Read the [LUT sky and aerial-perspective
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
Read the [LUT sky and aerial-perspective entry](examples/lut-aerial-perspective/atmosphere-effect.js)
|
|
21
|
+
and its `source/` modules for the SkyMaterial, SkyLightProbe,
|
|
22
|
+
SunDirectionalLight, AerialPerspectiveEffect, precomputed-texture loader,
|
|
23
|
+
sun/moon direction, lens flare, tone mapping, and dithering path used by the
|
|
24
|
+
LUT example.
|
|
23
25
|
|
|
24
26
|
## Required outputs
|
|
25
27
|
|
package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/irradiance.exr
ADDED
|
Binary file
|
package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/scattering.exr
ADDED
|
Binary file
|
package/skills/threejs-atmosphere-aerial-perspective/assets/lut-aerial-perspective/transmittance.exr
ADDED
|
Binary file
|
|
@@ -1,639 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
solarIrradiance: [1.474, 1.8504, 1.91198],
|
|
13
|
-
rayleighScattering: [0.005802, 0.013558, 0.0331],
|
|
14
|
-
mieScattering: [0.003996, 0.003996, 0.003996],
|
|
15
|
-
miePhaseG: 0.8,
|
|
16
|
-
sunAngularRadius: 0.004675,
|
|
17
|
-
minimumSunCosine: Math.cos(THREE.MathUtils.degToRad(120)),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const fullscreenVertexShader = `
|
|
21
|
-
precision highp float;
|
|
22
|
-
in vec3 position;
|
|
23
|
-
out vec2 vUv;
|
|
24
|
-
|
|
25
|
-
void main() {
|
|
26
|
-
vUv = position.xy * 0.5 + 0.5;
|
|
27
|
-
gl_Position = vec4(position.xy, 0.0, 1.0);
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
const atmosphereFunctions = `
|
|
32
|
-
const float PI = 3.141592653589793;
|
|
33
|
-
const int TRANSMITTANCE_TEXTURE_WIDTH = 256;
|
|
34
|
-
const int TRANSMITTANCE_TEXTURE_HEIGHT = 64;
|
|
35
|
-
const int SCATTERING_TEXTURE_R_SIZE = 32;
|
|
36
|
-
const int SCATTERING_TEXTURE_MU_SIZE = 128;
|
|
37
|
-
const int SCATTERING_TEXTURE_MU_S_SIZE = 32;
|
|
38
|
-
const int SCATTERING_TEXTURE_NU_SIZE = 8;
|
|
39
|
-
const int IRRADIANCE_TEXTURE_WIDTH = 64;
|
|
40
|
-
const int IRRADIANCE_TEXTURE_HEIGHT = 16;
|
|
41
|
-
|
|
42
|
-
float clampCosine(float value) {
|
|
43
|
-
return clamp(value, -1.0, 1.0);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
float safeSqrt(float value) {
|
|
47
|
-
return sqrt(max(value, 0.0));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
float distanceToTop(float radius, float cosine) {
|
|
51
|
-
float discriminant =
|
|
52
|
-
radius * radius * (cosine * cosine - 1.0) +
|
|
53
|
-
uTopRadius * uTopRadius;
|
|
54
|
-
return max(-radius * cosine + safeSqrt(discriminant), 0.0);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
bool rayIntersectsGround(float radius, float cosine) {
|
|
58
|
-
return cosine < 0.0 &&
|
|
59
|
-
radius * radius * (cosine * cosine - 1.0) +
|
|
60
|
-
uBottomRadius * uBottomRadius >= 0.0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
float textureCoord(float value, int size) {
|
|
64
|
-
float scale = float(size);
|
|
65
|
-
return 0.5 / scale + value * (1.0 - 1.0 / scale);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
vec2 transmittanceUv(float radius, float cosine) {
|
|
69
|
-
float H = sqrt(
|
|
70
|
-
uTopRadius * uTopRadius - uBottomRadius * uBottomRadius
|
|
71
|
-
);
|
|
72
|
-
float rho = safeSqrt(
|
|
73
|
-
radius * radius - uBottomRadius * uBottomRadius
|
|
74
|
-
);
|
|
75
|
-
float distance = distanceToTop(radius, cosine);
|
|
76
|
-
float minimumDistance = uTopRadius - radius;
|
|
77
|
-
float maximumDistance = rho + H;
|
|
78
|
-
float xMu = (distance - minimumDistance) /
|
|
79
|
-
max(maximumDistance - minimumDistance, 1e-5);
|
|
80
|
-
float xRadius = rho / H;
|
|
81
|
-
return vec2(
|
|
82
|
-
textureCoord(xMu, TRANSMITTANCE_TEXTURE_WIDTH),
|
|
83
|
-
textureCoord(xRadius, TRANSMITTANCE_TEXTURE_HEIGHT)
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
vec3 transmittanceToTop(float radius, float cosine) {
|
|
88
|
-
return texture(
|
|
89
|
-
uTransmittanceTexture,
|
|
90
|
-
transmittanceUv(radius, cosine)
|
|
91
|
-
).rgb;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
vec3 segmentTransmittance(
|
|
95
|
-
float radius,
|
|
96
|
-
float cosine,
|
|
97
|
-
float distance,
|
|
98
|
-
bool intersectsGround
|
|
99
|
-
) {
|
|
100
|
-
float destinationRadius = clamp(
|
|
101
|
-
sqrt(
|
|
102
|
-
distance * distance +
|
|
103
|
-
2.0 * radius * cosine * distance +
|
|
104
|
-
radius * radius
|
|
105
|
-
),
|
|
106
|
-
uBottomRadius,
|
|
107
|
-
uTopRadius
|
|
108
|
-
);
|
|
109
|
-
float destinationCosine = clampCosine(
|
|
110
|
-
(radius * cosine + distance) / destinationRadius
|
|
111
|
-
);
|
|
112
|
-
if (intersectsGround) {
|
|
113
|
-
return min(
|
|
114
|
-
transmittanceToTop(destinationRadius, -destinationCosine) /
|
|
115
|
-
max(transmittanceToTop(radius, -cosine), vec3(1e-6)),
|
|
116
|
-
vec3(1.0)
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
return min(
|
|
120
|
-
transmittanceToTop(radius, cosine) /
|
|
121
|
-
max(
|
|
122
|
-
transmittanceToTop(destinationRadius, destinationCosine),
|
|
123
|
-
vec3(1e-6)
|
|
124
|
-
),
|
|
125
|
-
vec3(1.0)
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
vec3 transmittanceToSun(float radius, float sunCosine) {
|
|
130
|
-
float sinHorizon = uBottomRadius / radius;
|
|
131
|
-
float cosHorizon = -safeSqrt(1.0 - sinHorizon * sinHorizon);
|
|
132
|
-
return transmittanceToTop(radius, sunCosine) * smoothstep(
|
|
133
|
-
-sinHorizon * uSunAngularRadius,
|
|
134
|
-
sinHorizon * uSunAngularRadius,
|
|
135
|
-
sunCosine - cosHorizon
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
float rayleighPhase(float cosine) {
|
|
140
|
-
return 3.0 / (16.0 * PI) * (1.0 + cosine * cosine);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
float miePhase(float cosine) {
|
|
144
|
-
float g2 = uMiePhaseG * uMiePhaseG;
|
|
145
|
-
float scale =
|
|
146
|
-
3.0 / (8.0 * PI) *
|
|
147
|
-
(1.0 - g2) / (2.0 + g2);
|
|
148
|
-
return scale * (1.0 + cosine * cosine) /
|
|
149
|
-
pow(
|
|
150
|
-
max(1.0 + g2 - 2.0 * uMiePhaseG * cosine, 1e-4),
|
|
151
|
-
1.5
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
vec4 scatteringUvwz(
|
|
156
|
-
float radius,
|
|
157
|
-
float viewCosine,
|
|
158
|
-
float sunCosine,
|
|
159
|
-
float viewSunCosine,
|
|
160
|
-
bool intersectsGround
|
|
161
|
-
) {
|
|
162
|
-
float H = sqrt(
|
|
163
|
-
uTopRadius * uTopRadius - uBottomRadius * uBottomRadius
|
|
164
|
-
);
|
|
165
|
-
float rho = safeSqrt(
|
|
166
|
-
radius * radius - uBottomRadius * uBottomRadius
|
|
167
|
-
);
|
|
168
|
-
float uRadius = textureCoord(
|
|
169
|
-
rho / H,
|
|
170
|
-
SCATTERING_TEXTURE_R_SIZE
|
|
171
|
-
);
|
|
172
|
-
float radiusCosine = radius * viewCosine;
|
|
173
|
-
float discriminant =
|
|
174
|
-
radiusCosine * radiusCosine -
|
|
175
|
-
radius * radius +
|
|
176
|
-
uBottomRadius * uBottomRadius;
|
|
177
|
-
float uView;
|
|
178
|
-
if (intersectsGround) {
|
|
179
|
-
float distance =
|
|
180
|
-
-radiusCosine - safeSqrt(discriminant);
|
|
181
|
-
float minimumDistance = radius - uBottomRadius;
|
|
182
|
-
float maximumDistance = rho;
|
|
183
|
-
float normalizedDistance =
|
|
184
|
-
maximumDistance == minimumDistance
|
|
185
|
-
? 0.0
|
|
186
|
-
: (distance - minimumDistance) /
|
|
187
|
-
(maximumDistance - minimumDistance);
|
|
188
|
-
uView = 0.5 - 0.5 * textureCoord(
|
|
189
|
-
normalizedDistance,
|
|
190
|
-
SCATTERING_TEXTURE_MU_SIZE / 2
|
|
191
|
-
);
|
|
192
|
-
} else {
|
|
193
|
-
float distance =
|
|
194
|
-
-radiusCosine + safeSqrt(discriminant + H * H);
|
|
195
|
-
float minimumDistance = uTopRadius - radius;
|
|
196
|
-
float maximumDistance = rho + H;
|
|
197
|
-
uView = 0.5 + 0.5 * textureCoord(
|
|
198
|
-
(distance - minimumDistance) /
|
|
199
|
-
max(maximumDistance - minimumDistance, 1e-5),
|
|
200
|
-
SCATTERING_TEXTURE_MU_SIZE / 2
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
float distance = distanceToTop(uBottomRadius, sunCosine);
|
|
205
|
-
float minimumDistance = uTopRadius - uBottomRadius;
|
|
206
|
-
float maximumDistance = H;
|
|
207
|
-
float a = (distance - minimumDistance) /
|
|
208
|
-
(maximumDistance - minimumDistance);
|
|
209
|
-
float referenceDistance =
|
|
210
|
-
distanceToTop(uBottomRadius, uMinimumSunCosine);
|
|
211
|
-
float referenceA = (referenceDistance - minimumDistance) /
|
|
212
|
-
(maximumDistance - minimumDistance);
|
|
213
|
-
float uSun = textureCoord(
|
|
214
|
-
max(1.0 - a / referenceA, 0.0) / (1.0 + a),
|
|
215
|
-
SCATTERING_TEXTURE_MU_S_SIZE
|
|
216
|
-
);
|
|
217
|
-
float uNu = (viewSunCosine + 1.0) * 0.5;
|
|
218
|
-
return vec4(uNu, uSun, uView, uRadius);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
vec3 extrapolatedMie(vec4 combined) {
|
|
222
|
-
if (combined.r < 1e-5) {
|
|
223
|
-
return vec3(0.0);
|
|
224
|
-
}
|
|
225
|
-
return combined.rgb *
|
|
226
|
-
combined.a / combined.r *
|
|
227
|
-
(uRayleighScattering.r / uMieScattering.r) *
|
|
228
|
-
(uMieScattering / uRayleighScattering);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
vec3 combinedScattering(
|
|
232
|
-
float radius,
|
|
233
|
-
float viewCosine,
|
|
234
|
-
float sunCosine,
|
|
235
|
-
float viewSunCosine,
|
|
236
|
-
bool intersectsGround,
|
|
237
|
-
out vec3 singleMie
|
|
238
|
-
) {
|
|
239
|
-
vec4 uvwz = scatteringUvwz(
|
|
240
|
-
radius,
|
|
241
|
-
viewCosine,
|
|
242
|
-
sunCosine,
|
|
243
|
-
viewSunCosine,
|
|
244
|
-
intersectsGround
|
|
245
|
-
);
|
|
246
|
-
float textureX =
|
|
247
|
-
uvwz.x * float(SCATTERING_TEXTURE_NU_SIZE - 1);
|
|
248
|
-
float slice = floor(textureX);
|
|
249
|
-
float fraction = textureX - slice;
|
|
250
|
-
vec3 uvw0 = vec3(
|
|
251
|
-
(slice + uvwz.y) / float(SCATTERING_TEXTURE_NU_SIZE),
|
|
252
|
-
uvwz.z,
|
|
253
|
-
uvwz.w
|
|
254
|
-
);
|
|
255
|
-
vec3 uvw1 = vec3(
|
|
256
|
-
(slice + 1.0 + uvwz.y) /
|
|
257
|
-
float(SCATTERING_TEXTURE_NU_SIZE),
|
|
258
|
-
uvwz.z,
|
|
259
|
-
uvwz.w
|
|
260
|
-
);
|
|
261
|
-
vec4 combined = mix(
|
|
262
|
-
texture(uScatteringTexture, uvw0),
|
|
263
|
-
texture(uScatteringTexture, uvw1),
|
|
264
|
-
fraction
|
|
265
|
-
);
|
|
266
|
-
singleMie = extrapolatedMie(combined);
|
|
267
|
-
return combined.rgb;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
vec3 skyRadiance(
|
|
271
|
-
vec3 camera,
|
|
272
|
-
vec3 viewRay,
|
|
273
|
-
out vec3 transmittance
|
|
274
|
-
) {
|
|
275
|
-
float radius = length(camera);
|
|
276
|
-
float radiusCosine = dot(camera, viewRay);
|
|
277
|
-
float entryDistance =
|
|
278
|
-
-radiusCosine -
|
|
279
|
-
safeSqrt(
|
|
280
|
-
radiusCosine * radiusCosine -
|
|
281
|
-
radius * radius +
|
|
282
|
-
uTopRadius * uTopRadius
|
|
283
|
-
);
|
|
284
|
-
if (entryDistance > 0.0) {
|
|
285
|
-
camera += viewRay * entryDistance;
|
|
286
|
-
radius = uTopRadius;
|
|
287
|
-
radiusCosine += entryDistance;
|
|
288
|
-
} else if (radius > uTopRadius) {
|
|
289
|
-
transmittance = vec3(1.0);
|
|
290
|
-
return vec3(0.0);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
float viewCosine = radiusCosine / radius;
|
|
294
|
-
float sunCosine = dot(camera, uSunDirection) / radius;
|
|
295
|
-
float viewSunCosine = dot(viewRay, uSunDirection);
|
|
296
|
-
bool intersectsGround =
|
|
297
|
-
rayIntersectsGround(radius, viewCosine);
|
|
298
|
-
transmittance = intersectsGround
|
|
299
|
-
? vec3(0.0)
|
|
300
|
-
: transmittanceToTop(radius, viewCosine);
|
|
301
|
-
|
|
302
|
-
vec3 singleMie;
|
|
303
|
-
vec3 scattering = combinedScattering(
|
|
304
|
-
radius,
|
|
305
|
-
viewCosine,
|
|
306
|
-
sunCosine,
|
|
307
|
-
viewSunCosine,
|
|
308
|
-
intersectsGround,
|
|
309
|
-
singleMie
|
|
310
|
-
);
|
|
311
|
-
return (
|
|
312
|
-
scattering * rayleighPhase(viewSunCosine) +
|
|
313
|
-
singleMie * miePhase(viewSunCosine)
|
|
314
|
-
) * uSkyRadianceToLuminance;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
bool segmentOutsideAtmosphere(
|
|
318
|
-
vec3 camera,
|
|
319
|
-
vec3 point,
|
|
320
|
-
float radius
|
|
321
|
-
) {
|
|
322
|
-
if (
|
|
323
|
-
radius < uTopRadius ||
|
|
324
|
-
length(point) < uTopRadius
|
|
325
|
-
) {
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
vec3 ray = point - camera;
|
|
329
|
-
float t = -clamp(
|
|
330
|
-
dot(camera, ray) / dot(ray, ray),
|
|
331
|
-
0.0,
|
|
332
|
-
1.0
|
|
333
|
-
);
|
|
334
|
-
return length(camera + t * ray) > uTopRadius;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
vec3 radianceToPoint(
|
|
338
|
-
vec3 camera,
|
|
339
|
-
vec3 point,
|
|
340
|
-
out vec3 transmittance
|
|
341
|
-
) {
|
|
342
|
-
float radius = length(camera);
|
|
343
|
-
if (segmentOutsideAtmosphere(camera, point, radius)) {
|
|
344
|
-
transmittance = vec3(1.0);
|
|
345
|
-
return vec3(0.0);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
vec3 viewRay = normalize(point - camera);
|
|
349
|
-
float radiusCosine = dot(camera, viewRay);
|
|
350
|
-
float entryDistance =
|
|
351
|
-
-radiusCosine -
|
|
352
|
-
safeSqrt(
|
|
353
|
-
radiusCosine * radiusCosine -
|
|
354
|
-
radius * radius +
|
|
355
|
-
uTopRadius * uTopRadius
|
|
356
|
-
);
|
|
357
|
-
if (entryDistance > 0.0) {
|
|
358
|
-
camera += viewRay * entryDistance;
|
|
359
|
-
radius = uTopRadius;
|
|
360
|
-
radiusCosine += entryDistance;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
float viewCosine = radiusCosine / radius;
|
|
364
|
-
float sunCosine = dot(camera, uSunDirection) / radius;
|
|
365
|
-
float viewSunCosine = dot(viewRay, uSunDirection);
|
|
366
|
-
float distance = length(point - camera);
|
|
367
|
-
bool intersectsGround =
|
|
368
|
-
rayIntersectsGround(radius, viewCosine);
|
|
369
|
-
if (!intersectsGround) {
|
|
370
|
-
float horizonCosine = -safeSqrt(
|
|
371
|
-
1.0 -
|
|
372
|
-
uBottomRadius / radius *
|
|
373
|
-
(uBottomRadius / radius)
|
|
374
|
-
);
|
|
375
|
-
viewCosine = max(viewCosine, horizonCosine + 0.004);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
transmittance = segmentTransmittance(
|
|
379
|
-
radius,
|
|
380
|
-
viewCosine,
|
|
381
|
-
distance,
|
|
382
|
-
intersectsGround
|
|
383
|
-
);
|
|
384
|
-
|
|
385
|
-
vec3 singleMie;
|
|
386
|
-
vec3 scattering = combinedScattering(
|
|
387
|
-
radius,
|
|
388
|
-
viewCosine,
|
|
389
|
-
sunCosine,
|
|
390
|
-
viewSunCosine,
|
|
391
|
-
intersectsGround,
|
|
392
|
-
singleMie
|
|
393
|
-
);
|
|
394
|
-
|
|
395
|
-
float destinationRadius = clamp(
|
|
396
|
-
sqrt(
|
|
397
|
-
distance * distance +
|
|
398
|
-
2.0 * radius * viewCosine * distance +
|
|
399
|
-
radius * radius
|
|
400
|
-
),
|
|
401
|
-
uBottomRadius,
|
|
402
|
-
uTopRadius
|
|
403
|
-
);
|
|
404
|
-
float destinationViewCosine =
|
|
405
|
-
(radius * viewCosine + distance) /
|
|
406
|
-
destinationRadius;
|
|
407
|
-
float destinationSunCosine =
|
|
408
|
-
(radius * sunCosine +
|
|
409
|
-
distance * viewSunCosine) /
|
|
410
|
-
destinationRadius;
|
|
411
|
-
vec3 destinationMie;
|
|
412
|
-
vec3 destinationScattering = combinedScattering(
|
|
413
|
-
destinationRadius,
|
|
414
|
-
destinationViewCosine,
|
|
415
|
-
destinationSunCosine,
|
|
416
|
-
viewSunCosine,
|
|
417
|
-
intersectsGround,
|
|
418
|
-
destinationMie
|
|
419
|
-
);
|
|
420
|
-
scattering -= transmittance * destinationScattering;
|
|
421
|
-
singleMie -= transmittance * destinationMie;
|
|
422
|
-
singleMie = extrapolatedMie(
|
|
423
|
-
vec4(scattering, singleMie.r)
|
|
424
|
-
);
|
|
425
|
-
singleMie *= smoothstep(0.0, 0.01, sunCosine);
|
|
426
|
-
|
|
427
|
-
return (
|
|
428
|
-
scattering * rayleighPhase(viewSunCosine) +
|
|
429
|
-
singleMie * miePhase(viewSunCosine)
|
|
430
|
-
) * uSkyRadianceToLuminance;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
vec3 solarRadiance() {
|
|
434
|
-
return (
|
|
435
|
-
uSolarIrradiance /
|
|
436
|
-
(PI * uSunAngularRadius * uSunAngularRadius)
|
|
437
|
-
) * uSunRadianceToLuminance;
|
|
438
|
-
}
|
|
439
|
-
`;
|
|
440
|
-
|
|
441
|
-
function createUniforms({
|
|
442
|
-
transmittanceTexture,
|
|
443
|
-
scatteringTexture,
|
|
444
|
-
irradianceTexture,
|
|
445
|
-
sunDirection = new THREE.Vector3(0.2, 0.08, -0.98).normalize(),
|
|
446
|
-
planetCenter = new THREE.Vector3(0, -6360, 0),
|
|
447
|
-
parameters = EARTH_ATMOSPHERE_KM,
|
|
448
|
-
}) {
|
|
449
|
-
return {
|
|
450
|
-
uSceneColor: { value: null },
|
|
451
|
-
uSceneDepth: { value: null },
|
|
452
|
-
uInverseProjection: { value: new THREE.Matrix4() },
|
|
453
|
-
uCameraWorld: { value: new THREE.Matrix4() },
|
|
454
|
-
uCameraPosition: { value: new THREE.Vector3() },
|
|
455
|
-
uPlanetCenter: { value: planetCenter.clone() },
|
|
456
|
-
uSunDirection: { value: sunDirection.clone().normalize() },
|
|
457
|
-
uTransmittanceTexture: { value: transmittanceTexture },
|
|
458
|
-
uScatteringTexture: { value: scatteringTexture },
|
|
459
|
-
uIrradianceTexture: { value: irradianceTexture },
|
|
460
|
-
uBottomRadius: { value: parameters.bottomRadius },
|
|
461
|
-
uTopRadius: { value: parameters.topRadius },
|
|
462
|
-
uSolarIrradiance: {
|
|
463
|
-
value: new THREE.Vector3(...parameters.solarIrradiance),
|
|
464
|
-
},
|
|
465
|
-
uRayleighScattering: {
|
|
466
|
-
value: new THREE.Vector3(...parameters.rayleighScattering),
|
|
467
|
-
},
|
|
468
|
-
uMieScattering: {
|
|
469
|
-
value: new THREE.Vector3(...parameters.mieScattering),
|
|
470
|
-
},
|
|
471
|
-
uMiePhaseG: { value: parameters.miePhaseG },
|
|
472
|
-
uSunAngularRadius: { value: parameters.sunAngularRadius },
|
|
473
|
-
uMinimumSunCosine: { value: parameters.minimumSunCosine },
|
|
474
|
-
uSkyRadianceToLuminance: {
|
|
475
|
-
value: new THREE.Vector3(
|
|
476
|
-
1.434022,
|
|
477
|
-
0.889942,
|
|
478
|
-
0.815059,
|
|
479
|
-
),
|
|
480
|
-
},
|
|
481
|
-
uSunRadianceToLuminance: {
|
|
482
|
-
value: new THREE.Vector3(
|
|
483
|
-
1.225784,
|
|
484
|
-
0.872938,
|
|
485
|
-
0.829539,
|
|
486
|
-
),
|
|
487
|
-
},
|
|
488
|
-
uExposure: { value: 2.2 },
|
|
489
|
-
uOutputTransform: { value: 1 },
|
|
490
|
-
uDebugMode: { value: 0 },
|
|
491
|
-
};
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
export function createAtmosphereAerialPerspectiveMaterial(options) {
|
|
495
|
-
const uniforms = createUniforms(options);
|
|
496
|
-
return new THREE.RawShaderMaterial({
|
|
497
|
-
name: "AtmosphereAerialPerspectiveMaterial",
|
|
498
|
-
glslVersion: THREE.GLSL3,
|
|
499
|
-
depthTest: false,
|
|
500
|
-
depthWrite: false,
|
|
501
|
-
toneMapped: false,
|
|
502
|
-
uniforms,
|
|
503
|
-
vertexShader: fullscreenVertexShader,
|
|
504
|
-
fragmentShader: `
|
|
505
|
-
precision highp float;
|
|
506
|
-
precision highp sampler3D;
|
|
507
|
-
|
|
508
|
-
uniform sampler2D uSceneColor;
|
|
509
|
-
uniform sampler2D uSceneDepth;
|
|
510
|
-
uniform mat4 uInverseProjection;
|
|
511
|
-
uniform mat4 uCameraWorld;
|
|
512
|
-
uniform vec3 uCameraPosition;
|
|
513
|
-
uniform vec3 uPlanetCenter;
|
|
514
|
-
uniform vec3 uSunDirection;
|
|
515
|
-
uniform sampler2D uTransmittanceTexture;
|
|
516
|
-
uniform sampler3D uScatteringTexture;
|
|
517
|
-
uniform sampler2D uIrradianceTexture;
|
|
518
|
-
uniform float uBottomRadius;
|
|
519
|
-
uniform float uTopRadius;
|
|
520
|
-
uniform vec3 uSolarIrradiance;
|
|
521
|
-
uniform vec3 uRayleighScattering;
|
|
522
|
-
uniform vec3 uMieScattering;
|
|
523
|
-
uniform float uMiePhaseG;
|
|
524
|
-
uniform float uSunAngularRadius;
|
|
525
|
-
uniform float uMinimumSunCosine;
|
|
526
|
-
uniform vec3 uSkyRadianceToLuminance;
|
|
527
|
-
uniform vec3 uSunRadianceToLuminance;
|
|
528
|
-
uniform float uExposure;
|
|
529
|
-
uniform int uOutputTransform;
|
|
530
|
-
uniform int uDebugMode;
|
|
531
|
-
|
|
532
|
-
in vec2 vUv;
|
|
533
|
-
out vec4 outputColor;
|
|
534
|
-
|
|
535
|
-
${atmosphereFunctions}
|
|
536
|
-
|
|
537
|
-
vec3 worldRay(vec2 uv) {
|
|
538
|
-
vec4 view = uInverseProjection *
|
|
539
|
-
vec4(uv * 2.0 - 1.0, 1.0, 1.0);
|
|
540
|
-
return normalize(
|
|
541
|
-
(uCameraWorld * vec4(view.xyz / view.w, 0.0)).xyz
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
vec3 reconstructWorld(vec2 uv, float depth) {
|
|
546
|
-
vec4 view = uInverseProjection *
|
|
547
|
-
vec4(uv * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0);
|
|
548
|
-
view /= view.w;
|
|
549
|
-
return (uCameraWorld * view).xyz;
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
vec3 agxApprox(vec3 color) {
|
|
553
|
-
color = max(color, vec3(0.0));
|
|
554
|
-
color = color / (color + vec3(0.155));
|
|
555
|
-
return pow(color, vec3(1.0 / 2.2));
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
void main() {
|
|
559
|
-
float depth = texture(uSceneDepth, vUv).r;
|
|
560
|
-
vec3 camera = uCameraPosition - uPlanetCenter;
|
|
561
|
-
vec3 ray = worldRay(vUv);
|
|
562
|
-
vec3 transmittance;
|
|
563
|
-
vec3 radiance;
|
|
564
|
-
|
|
565
|
-
if (depth >= 0.999999) {
|
|
566
|
-
radiance = skyRadiance(camera, ray, transmittance);
|
|
567
|
-
float sunCosine = dot(ray, uSunDirection);
|
|
568
|
-
float sunDisc = smoothstep(
|
|
569
|
-
cos(uSunAngularRadius * 1.35),
|
|
570
|
-
cos(uSunAngularRadius * 0.70),
|
|
571
|
-
sunCosine
|
|
572
|
-
);
|
|
573
|
-
radiance +=
|
|
574
|
-
transmittance * solarRadiance() * sunDisc;
|
|
575
|
-
} else {
|
|
576
|
-
vec3 worldPosition = reconstructWorld(vUv, depth);
|
|
577
|
-
vec3 point = worldPosition - uPlanetCenter;
|
|
578
|
-
vec3 sceneRadiance = texture(uSceneColor, vUv).rgb;
|
|
579
|
-
vec3 inscatter =
|
|
580
|
-
radianceToPoint(camera, point, transmittance);
|
|
581
|
-
radiance = sceneRadiance * transmittance + inscatter;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
if (uDebugMode == 1) {
|
|
585
|
-
outputColor = vec4(transmittance, 1.0);
|
|
586
|
-
return;
|
|
587
|
-
}
|
|
588
|
-
if (uDebugMode == 2) {
|
|
589
|
-
outputColor = vec4(
|
|
590
|
-
agxApprox(max(radiance, vec3(0.0)) * 2.0),
|
|
591
|
-
1.0
|
|
592
|
-
);
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
if (uDebugMode == 3) {
|
|
596
|
-
outputColor = vec4(
|
|
597
|
-
depth >= 0.999999
|
|
598
|
-
? vec3(0.12, 0.32, 0.92)
|
|
599
|
-
: vec3(1.0, 0.34, 0.05),
|
|
600
|
-
1.0
|
|
601
|
-
);
|
|
602
|
-
return;
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
outputColor = uOutputTransform == 1
|
|
606
|
-
? vec4(agxApprox(radiance * uExposure), 1.0)
|
|
607
|
-
: vec4(radiance, 1.0);
|
|
608
|
-
}
|
|
609
|
-
`,
|
|
610
|
-
});
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
export function updateAtmosphereCamera(
|
|
614
|
-
material,
|
|
615
|
-
camera,
|
|
616
|
-
{ sceneColor, sceneDepth } = {},
|
|
617
|
-
) {
|
|
618
|
-
const uniforms = material.uniforms;
|
|
619
|
-
camera.updateMatrixWorld(true);
|
|
620
|
-
uniforms.uInverseProjection.value.copy(
|
|
621
|
-
camera.projectionMatrixInverse,
|
|
622
|
-
);
|
|
623
|
-
uniforms.uCameraWorld.value.copy(camera.matrixWorld);
|
|
624
|
-
uniforms.uCameraPosition.value.setFromMatrixPosition(
|
|
625
|
-
camera.matrixWorld,
|
|
626
|
-
);
|
|
627
|
-
if (sceneColor) uniforms.uSceneColor.value = sceneColor;
|
|
628
|
-
if (sceneDepth) uniforms.uSceneDepth.value = sceneDepth;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
export function setAtmosphereDebugMode(material, mode) {
|
|
632
|
-
const modes = new Map([
|
|
633
|
-
["final", 0],
|
|
634
|
-
["transmittance", 1],
|
|
635
|
-
["inscatter", 2],
|
|
636
|
-
["depth-classification", 3],
|
|
637
|
-
]);
|
|
638
|
-
material.uniforms.uDebugMode.value = modes.get(mode) ?? 0;
|
|
639
|
-
}
|
|
1
|
+
export * from "./source/atmosphere/index.ts";
|
|
2
|
+
export * from "./source/geospatial/index.ts";
|
|
3
|
+
export { DitheringEffect } from "./source/effects/DitheringEffect.ts";
|
|
4
|
+
export { LensFlareEffect } from "./source/effects/LensFlareEffect.ts";
|
|
5
|
+
export {
|
|
6
|
+
EffectComposer,
|
|
7
|
+
EffectPass,
|
|
8
|
+
RenderPass,
|
|
9
|
+
ToneMappingEffect,
|
|
10
|
+
ToneMappingMode,
|
|
11
|
+
} from "postprocessing";
|