@zephyr3d/scene 0.9.26 → 0.9.27
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/dist/animation/animationset.js +92 -30
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/joint_dynamics/convex_collider.js +320 -0
- package/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
- package/dist/animation/skeleton.js +21 -1
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/asset/model.js +6 -2
- package/dist/asset/model.js.map +1 -1
- package/dist/camera/camera.js +75 -23
- package/dist/camera/camera.js.map +1 -1
- package/dist/index.d.ts +4764 -3600
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/material/hairstrand.js +235 -235
- package/dist/material/hairstrand.js.map +1 -1
- package/dist/material/material.js +296 -296
- package/dist/material/material.js.map +1 -1
- package/dist/material/mixins/lit.js +33 -1
- package/dist/material/mixins/lit.js.map +1 -1
- package/dist/material/shader/helper.js +404 -3
- package/dist/material/shader/helper.js.map +1 -1
- package/dist/material/water.js +2057 -72
- package/dist/material/water.js.map +1 -1
- package/dist/posteffect/motionblur.js +663 -58
- package/dist/posteffect/motionblur.js.map +1 -1
- package/dist/posteffect/posteffect.js +12 -1
- package/dist/posteffect/posteffect.js.map +1 -1
- package/dist/posteffect/sao.js +46 -44
- package/dist/posteffect/sao.js.map +1 -1
- package/dist/posteffect/sss.js +30 -2
- package/dist/posteffect/sss.js.map +1 -1
- package/dist/render/abuffer_oit.js +37 -37
- package/dist/render/abuffer_oit.js.map +1 -1
- package/dist/render/clipmap.js +156 -5
- package/dist/render/clipmap.js.map +1 -1
- package/dist/render/cull_visitor.js +1 -0
- package/dist/render/cull_visitor.js.map +1 -1
- package/dist/render/dualdepthpeeling_oit.js +49 -49
- package/dist/render/dualdepthpeeling_oit.js.map +1 -1
- package/dist/render/fbm_wavegenerator.js +3 -3
- package/dist/render/fbm_wavegenerator.js.map +1 -1
- package/dist/render/fft_wavegenerator.js +57 -15
- package/dist/render/fft_wavegenerator.js.map +1 -1
- package/dist/render/gerstner_wavegenerator.js +127 -20
- package/dist/render/gerstner_wavegenerator.js.map +1 -1
- package/dist/render/hzb.js +80 -22
- package/dist/render/hzb.js.map +1 -1
- package/dist/render/lightpass.js +6 -3
- package/dist/render/lightpass.js.map +1 -1
- package/dist/render/oit.js +11 -11
- package/dist/render/oit.js.map +1 -1
- package/dist/render/render_queue.js +36 -0
- package/dist/render/render_queue.js.map +1 -1
- package/dist/render/renderer.js +4 -0
- package/dist/render/renderer.js.map +1 -1
- package/dist/render/rendergraph/blackboard.js +1 -0
- package/dist/render/rendergraph/blackboard.js.map +1 -1
- package/dist/render/rendergraph/forward_plus_builder.js +318 -9
- package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
- package/dist/render/rendergraph/frame_resource_requirements.js +1 -0
- package/dist/render/rendergraph/frame_resource_requirements.js.map +1 -1
- package/dist/render/rendergraph/history_resources.js +8 -1
- package/dist/render/rendergraph/history_resources.js.map +1 -1
- package/dist/render/underwater.js +624 -0
- package/dist/render/underwater.js.map +1 -0
- package/dist/render/water_caustics.js +1380 -0
- package/dist/render/water_caustics.js.map +1 -0
- package/dist/render/weightedblended_oit.js +33 -33
- package/dist/render/weightedblended_oit.js.map +1 -1
- package/dist/scene/water.js +540 -4
- package/dist/scene/water.js.map +1 -1
- package/dist/shaders/water.js +22 -19
- package/dist/shaders/water.js.map +1 -1
- package/dist/shaders/water_medium.js +56 -0
- package/dist/shaders/water_medium.js.map +1 -0
- package/dist/shadow/shadow_region.js +49 -49
- package/dist/shadow/shadow_region.js.map +1 -1
- package/dist/utility/serialization/manager.js +3 -1
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +31 -2
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/camera.js +53 -25
- package/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/utility/serialization/scene/light.js.map +1 -1
- package/dist/utility/serialization/scene/water.js +1101 -21
- package/dist/utility/serialization/scene/water.js.map +1 -1
- package/dist/utility/shprojector.js +87 -87
- package/dist/utility/shprojector.js.map +1 -1
- package/package.json +1 -1
- package/dist/render/rendergraph/frame_graph_context.js +0 -41
- package/dist/render/rendergraph/frame_graph_context.js.map +0 -1
- package/dist/shaders/ssgi.js +0 -63
- package/dist/shaders/ssgi.js.map +0 -1
- package/dist/shaders/ssgi_reprojection.js +0 -118
- package/dist/shaders/ssgi_reprojection.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"water.js","sources":["../../../../src/utility/serialization/scene/water.ts"],"sourcesContent":["import type { Nullable } from '@zephyr3d/base';\r\nimport { Vector2 } from '@zephyr3d/base';\r\nimport type { SceneNode } from '../../../scene';\r\nimport { GraphNode } from '../../../scene';\r\nimport { Water } from '../../../scene/water';\r\nimport { defineProps, type SerializableClass } from '../types';\r\nimport type { WaveGenerator } from '../../../render';\r\nimport { FBMWaveGenerator, FFTWaveGenerator } from '../../../render';\r\nimport type { Texture2D } from '@zephyr3d/device';\r\nimport type { ResourceManager } from '../manager';\r\n\r\n/** @internal */\r\nexport function getFBMWaveGeneratorClass(): SerializableClass {\r\n return {\r\n ctor: FBMWaveGenerator,\r\n name: 'FBMWaveGenerator',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'NumOctaves',\r\n description: 'Number of FBM noise octaves used to build the wave pattern',\r\n type: 'int',\r\n options: { minValue: 1, maxValue: 8 },\r\n default: 4,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.numOctaves;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.numOctaves = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wind',\r\n description: 'Wind direction and speed that drive the FBM waves',\r\n type: 'vec2',\r\n default: [0.1, 0],\r\n options: {\r\n animatable: true\r\n },\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.wind.x;\r\n value.num[1] = this.wind.y;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.wind = new Vector2(value.num[0], value.num[1]);\r\n }\r\n },\r\n {\r\n name: 'Amplitude',\r\n description: 'Wave height amplitude for the FBM wave generator',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n default: 0.3,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.amplitude;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.amplitude = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Frequency',\r\n description: 'Wave frequency for the FBM wave generator',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 16 },\r\n default: 3,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.frequency;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.frequency = value.num[0];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function getFFTWaveGeneratorClass(): SerializableClass {\r\n return {\r\n ctor: FFTWaveGenerator,\r\n name: 'FFTWaveGenerator',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Alignment',\r\n description: 'How strongly FFT waves align with the wind direction',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.alignment;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.alignment = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wind',\r\n description: 'Wind direction and speed that drive the FFT waves',\r\n type: 'vec2',\r\n options: {\r\n animatable: true\r\n },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.wind.x;\r\n value.num[1] = this.wind.y;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.wind = new Vector2(value.num[0], value.num[1]);\r\n }\r\n },\r\n {\r\n name: 'FoamWidth',\r\n description: 'Width of foam bands generated on the wave crests',\r\n type: 'float',\r\n default: 1.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.foamWidth;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.foamWidth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamContrast',\r\n description: 'Contrast of the foam pattern on FFT waves',\r\n type: 'float',\r\n default: 7.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.foamContrast;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.foamContrast = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'WaveLengthCascades',\r\n description: 'Wavelength values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [400, 100, 15],\r\n options: { animatable: true, minValue: 0, maxValue: 1000 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveLength(0);\r\n value.num[1] = this.getWaveLength(1);\r\n value.num[2] = this.getWaveLength(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveLength(0, value.num[0]);\r\n this.setWaveLength(1, value.num[1]);\r\n this.setWaveLength(2, value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'WaveStrengthCascades',\r\n description: 'Strength values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [0.4, 0.4, 0.2],\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveStrength(0);\r\n value.num[1] = this.getWaveStrength(1);\r\n value.num[2] = this.getWaveStrength(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveStrength(0, value.num[0]);\r\n this.setWaveStrength(1, value.num[1]);\r\n this.setWaveStrength(2, value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'WaveCroppinessCascades',\r\n description: 'Croppiness values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [-1.5, -1.2, -0.5],\r\n options: { animatable: true, minValue: -4, maxValue: 0 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveCroppiness(0);\r\n value.num[1] = this.getWaveCroppiness(1);\r\n value.num[2] = this.getWaveCroppiness(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveCroppiness(0, value.num[0]);\r\n this.setWaveCroppiness(1, value.num[1]);\r\n this.setWaveCroppiness(2, value.num[2]);\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function getWaterClass(manager: ResourceManager): SerializableClass {\r\n return {\r\n ctor: Water,\r\n name: 'Water',\r\n parent: GraphNode,\r\n createFunc(ctx: SceneNode) {\r\n const node = new Water(ctx.scene!);\r\n node.parent = ctx;\r\n return { obj: node };\r\n },\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'WaveGenerator',\r\n description: 'Wave generator used to drive the water surface',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n objectTypes: [FFTWaveGenerator, FBMWaveGenerator]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.object[0] = this.waveGenerator ?? null;\r\n },\r\n set(this: Water, value) {\r\n if (!value.object[0]) {\r\n this.waveGenerator = null;\r\n } else {\r\n this.waveGenerator = value.object[0] as WaveGenerator;\r\n }\r\n }\r\n },\r\n {\r\n name: 'GridScale',\r\n description: 'Scale of the water simulation grid',\r\n type: 'float',\r\n default: 1,\r\n options: { minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.gridScale;\r\n },\r\n set(this: Water, value) {\r\n this.gridScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wireframe',\r\n description: 'If true, renders the water surface as wireframe',\r\n type: 'bool',\r\n default: false,\r\n get(this: Water, value) {\r\n value.bool[0] = this.wireframe;\r\n },\r\n set(this: Water, value) {\r\n this.wireframe = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'AnimationSpeed',\r\n description: 'Playback speed of wave animation',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n get(this: Water, value) {\r\n value.num[0] = this.animationSpeed;\r\n },\r\n set(this: Water, value) {\r\n this.animationSpeed = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'DepthScale',\r\n description: 'Depth attenuation scale for the water material',\r\n type: 'float',\r\n default: 10,\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.depthMulti;\r\n },\r\n set(this: Water, value) {\r\n this.material.depthMulti = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'RefractionStrength',\r\n description: 'Strength of underwater refraction',\r\n type: 'float',\r\n default: 0,\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.refractionStrength;\r\n },\r\n set(this: Water, value) {\r\n this.material.refractionStrength = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Displace',\r\n description: 'Vertex displacement scale for water waves',\r\n type: 'float',\r\n default: 16,\r\n options: { minValue: 1, maxValue: 256 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.displace;\r\n },\r\n set(this: Water, value) {\r\n this.material.displace = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'TAAStrength',\r\n description: 'Temporal anti-aliasing strength for the water surface',\r\n type: 'float',\r\n default: 0.4,\r\n options: { minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.TAAStrength;\r\n },\r\n set(this: Water, value) {\r\n this.TAAStrength = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ScatterRampTexture',\r\n description: 'Ramp texture used for water scatter lighting',\r\n type: 'object',\r\n default: null,\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = manager.getAssetId(this.material.scatterRampTexture) ?? '';\r\n },\r\n async set(value) {\r\n if (!value) {\r\n this.material.scatterRampTexture = null;\r\n } else {\r\n if (value.str[0]) {\r\n const assetId = value.str[0];\r\n let tex: Nullable<Texture2D>;\r\n try {\r\n tex = await manager.fetchTexture<Texture2D>(assetId);\r\n } catch (err) {\r\n console.error(`Load asset failed: ${value.str[0]}: ${err}`);\r\n tex = null;\r\n }\r\n if (tex?.isTexture2D()) {\r\n this.material.scatterRampTexture = tex;\r\n } else {\r\n console.error('Invalid texture type');\r\n }\r\n }\r\n }\r\n }\r\n },\r\n {\r\n name: 'AbsorptionRampTexture',\r\n description: 'Ramp texture used for water absorption',\r\n type: 'object',\r\n default: null,\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = manager.getAssetId(this.material.absorptionRampTexture) ?? '';\r\n },\r\n async set(this: Water, value) {\r\n if (!value) {\r\n this.material.absorptionRampTexture = null;\r\n } else {\r\n if (value.str[0]) {\r\n const assetId = value.str[0];\r\n let tex: Nullable<Texture2D>;\r\n try {\r\n tex = await manager.fetchTexture<Texture2D>(assetId);\r\n } catch (err) {\r\n console.error(`Load asset failed: ${value.str[0]}: ${err}`);\r\n tex = null;\r\n }\r\n if (tex?.isTexture2D()) {\r\n this.material.absorptionRampTexture = tex;\r\n } else {\r\n console.error('Invalid texture type');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n"],"names":["getFBMWaveGeneratorClass","ctor","FBMWaveGenerator","name","getProps","defineProps","description","type","options","minValue","maxValue","default","get","value","num","numOctaves","set","animatable","wind","x","y","Vector2","amplitude","frequency","getFFTWaveGeneratorClass","FFTWaveGenerator","alignment","foamWidth","foamContrast","getWaveLength","setWaveLength","getWaveStrength","setWaveStrength","getWaveCroppiness","setWaveCroppiness","getWaterClass","manager","Water","parent","GraphNode","createFunc","ctx","node","scene","obj","objectTypes","isNullable","object","waveGenerator","gridScale","bool","wireframe","animationSpeed","material","depthMulti","refractionStrength","displace","TAAStrength","str","getAssetId","scatterRampTexture","assetId","tex","fetchTexture","err","console","error","isTexture2D","absorptionRampTexture"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,UAAAA,CAAAA,GAAAA;wBACE,OAAO,IAAA;AACT,qBAAA;AACAlC,oBAAAA,GAAAA,CAAAA,CAAiBC,KAAK,EAAA;AACpBA,wBAAAA,KAAAA,CAAM6C,GAAG,CAAC,CAAE,CAAA,GAAGtB,OAAQuB,CAAAA,UAAU,CAAC,IAAI,CAACN,QAAQ,CAACe,qBAAqB,CAAK,IAAA,EAAA;AAC5E,qBAAA;AACA,oBAAA,MAAMpD,KAAiBH,KAAK,EAAA;AAC1B,wBAAA,IAAI,CAACA,KAAO,EAAA;AACV,4BAAA,IAAI,CAACwC,QAAQ,CAACe,qBAAqB,GAAG,IAAA;yBACjC,MAAA;AACL,4BAAA,IAAIvD,KAAM6C,CAAAA,GAAG,CAAC,CAAA,CAAE,EAAE;AAChB,gCAAA,MAAMG,OAAUhD,GAAAA,KAAAA,CAAM6C,GAAG,CAAC,CAAE,CAAA;gCAC5B,IAAII,GAAAA;gCACJ,IAAI;oCACFA,GAAM,GAAA,MAAM1B,OAAQ2B,CAAAA,YAAY,CAAYF,OAAAA,CAAAA;AAC9C,iCAAA,CAAE,OAAOG,GAAK,EAAA;AACZC,oCAAAA,OAAAA,CAAQC,KAAK,CAAC,CAAC,mBAAmB,EAAErD,KAAAA,CAAM6C,GAAG,CAAC,CAAE,CAAA,CAAC,EAAE,EAAEM,GAAK,CAAA,CAAA,CAAA;oCAC1DF,GAAM,GAAA,IAAA;AACR;AACA,gCAAA,IAAIA,KAAKK,WAAe,EAAA,EAAA;AACtB,oCAAA,IAAI,CAACd,QAAQ,CAACe,qBAAqB,GAAGN,GAAAA;iCACjC,MAAA;AACLG,oCAAAA,OAAAA,CAAQC,KAAK,CAAC,sBAAA,CAAA;AAChB;AACF;AACF;AACF;AACF;AACD,aAAA,CAAA;AACH;AACF,KAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"water.js","sources":["../../../../src/utility/serialization/scene/water.ts"],"sourcesContent":["import type { Nullable } from '@zephyr3d/base';\r\nimport { Vector2, Vector3 } from '@zephyr3d/base';\r\nimport type { SceneNode } from '../../../scene';\r\nimport { GraphNode } from '../../../scene';\r\nimport { Water } from '../../../scene/water';\r\nimport { defineProps, type SerializableClass } from '../types';\r\nimport type { WaveGenerator } from '../../../render';\r\nimport { FBMWaveGenerator, FFTWaveGenerator, GerstnerWaveGenerator } from '../../../render';\r\nimport { MAX_GERSTNER_WAVE_COUNT } from '../../../values';\r\nimport type { WaterDebugOutput, WaterMediumMode, WaterRefractionMode } from '../../../material/water';\r\nimport { DEFAULT_SCATTER_ANISOTROPY, WATER_DEBUG_OUTPUTS } from '../../../material/water';\r\nimport type { Texture2D } from '@zephyr3d/device';\r\nimport type { ResourceManager } from '../manager';\r\n\r\n/** @internal */\r\nexport function getFBMWaveGeneratorClass(): SerializableClass {\r\n return {\r\n ctor: FBMWaveGenerator,\r\n name: 'FBMWaveGenerator',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'NumOctaves',\r\n description: 'Number of FBM noise octaves used to build the wave pattern',\r\n type: 'int',\r\n options: { minValue: 1, maxValue: 8 },\r\n default: 4,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.numOctaves;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.numOctaves = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wind',\r\n description: 'Wind direction and speed that drive the FBM waves',\r\n type: 'vec2',\r\n default: [0.1, 0],\r\n options: {\r\n animatable: true\r\n },\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.wind.x;\r\n value.num[1] = this.wind.y;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.wind = new Vector2(value.num[0], value.num[1]);\r\n }\r\n },\r\n {\r\n name: 'Amplitude',\r\n description: 'Wave height amplitude for the FBM wave generator',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n default: 0.3,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.amplitude;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.amplitude = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Frequency',\r\n description: 'Wave frequency for the FBM wave generator',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 16 },\r\n default: 3,\r\n get(this: FBMWaveGenerator, value) {\r\n value.num[0] = this.frequency;\r\n },\r\n set(this: FBMWaveGenerator, value) {\r\n this.frequency = value.num[0];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function getFFTWaveGeneratorClass(): SerializableClass {\r\n return {\r\n ctor: FFTWaveGenerator,\r\n name: 'FFTWaveGenerator',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Alignment',\r\n description: 'How strongly FFT waves align with the wind direction',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.alignment;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.alignment = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wind',\r\n description: 'Wind direction and speed that drive the FFT waves',\r\n type: 'vec2',\r\n options: {\r\n animatable: true\r\n },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.wind.x;\r\n value.num[1] = this.wind.y;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.wind = new Vector2(value.num[0], value.num[1]);\r\n }\r\n },\r\n {\r\n name: 'FoamWidth',\r\n description: 'Width of foam bands generated on the wave crests',\r\n type: 'float',\r\n default: 1.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.foamWidth;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.foamWidth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamContrast',\r\n description: 'Contrast of the foam pattern on FFT waves',\r\n type: 'float',\r\n default: 7.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.foamContrast;\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.foamContrast = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'WaveLengthCascades',\r\n description: 'Wavelength values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [400, 100, 15],\r\n options: { animatable: true, minValue: 0, maxValue: 1000 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveLength(0);\r\n value.num[1] = this.getWaveLength(1);\r\n value.num[2] = this.getWaveLength(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveLength(0, value.num[0]);\r\n this.setWaveLength(1, value.num[1]);\r\n this.setWaveLength(2, value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'WaveStrengthCascades',\r\n description: 'Strength values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [0.4, 0.4, 0.2],\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveStrength(0);\r\n value.num[1] = this.getWaveStrength(1);\r\n value.num[2] = this.getWaveStrength(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveStrength(0, value.num[0]);\r\n this.setWaveStrength(1, value.num[1]);\r\n this.setWaveStrength(2, value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'WaveCroppinessCascades',\r\n description: 'Croppiness values for the three FFT wave cascades',\r\n type: 'vec3',\r\n default: [-1.5, -1.2, -0.5],\r\n options: { animatable: true, minValue: -4, maxValue: 0 },\r\n get(this: FFTWaveGenerator, value) {\r\n value.num[0] = this.getWaveCroppiness(0);\r\n value.num[1] = this.getWaveCroppiness(1);\r\n value.num[2] = this.getWaveCroppiness(2);\r\n },\r\n set(this: FFTWaveGenerator, value) {\r\n this.setWaveCroppiness(0, value.num[0]);\r\n this.setWaveCroppiness(1, value.num[1]);\r\n this.setWaveCroppiness(2, value.num[2]);\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function getGerstnerWaveGeneratorClass(): SerializableClass {\r\n return {\r\n ctor: GerstnerWaveGenerator,\r\n name: 'GerstnerWaveGenerator',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'NumWaves',\r\n description: 'Number of independent Gerstner waves summed to form the surface',\r\n type: 'int',\r\n options: { minValue: 1, maxValue: MAX_GERSTNER_WAVE_COUNT },\r\n get(this: GerstnerWaveGenerator, value) {\r\n value.num[0] = this.numWaves;\r\n },\r\n set(this: GerstnerWaveGenerator, value) {\r\n this.numWaves = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Waves',\r\n description: 'Per-wave parameters, one entry per wave in NumWaves order',\r\n type: 'object_array',\r\n options: {\r\n objectTypes: [GerstnerWave]\r\n },\r\n get(this: GerstnerWaveGenerator, value) {\r\n value.object = [];\r\n for (let i = 0; i < this.numWaves; i++) {\r\n const wave = new GerstnerWave();\r\n wave.bind(this, i);\r\n value.object.push(wave);\r\n }\r\n },\r\n set(this: GerstnerWaveGenerator, value) {\r\n const waves = value.object as GerstnerWave[];\r\n // The wave count is ground truth for how many slots the shader\r\n // reads. NumWaves and Waves are applied concurrently during\r\n // deserialization, so this setter must leave the generator in the\r\n // state this array implies regardless of which one runs first.\r\n this.numWaves = waves.length;\r\n for (let i = 0; i < waves.length; i++) {\r\n waves[i].applyTo(this, i);\r\n }\r\n },\r\n add(this: GerstnerWaveGenerator, value, index) {\r\n const wave = value?.object?.[0] as Nullable<GerstnerWave>;\r\n const insertAt = index ?? this.numWaves;\r\n this.insertWave(insertAt);\r\n wave?.applyTo(this, insertAt);\r\n },\r\n delete(this: GerstnerWaveGenerator, index) {\r\n this.deleteWave(index);\r\n }\r\n },\r\n {\r\n name: 'FoamWidth',\r\n description: 'Width of foam bands generated on the wave crests',\r\n type: 'float',\r\n default: 1.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: GerstnerWaveGenerator, value) {\r\n value.num[0] = this.foamWidth;\r\n },\r\n set(this: GerstnerWaveGenerator, value) {\r\n this.foamWidth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamContrast',\r\n description: 'Contrast of the foam pattern on Gerstner waves',\r\n type: 'float',\r\n default: 7.2,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: GerstnerWaveGenerator, value) {\r\n value.num[0] = this.foamContrast;\r\n },\r\n set(this: GerstnerWaveGenerator, value) {\r\n this.foamContrast = value.num[0];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * A single Gerstner wave, as the editor sees one entry of the\r\n * `Waves` object array on a {@link GerstnerWaveGenerator}.\r\n *\r\n * It behaves as a live view while it is bound: the field setters write the new\r\n * value straight through to the generator's wave buffer, which is what makes an\r\n * edit in the property panel take effect on the water immediately. Without that\r\n * the editor would only touch this object's own fields and the surface would\r\n * keep the previous wave until something else bumped the generator's version.\r\n *\r\n * The binding is transient and scoped to one editor session: `_owner` and\r\n * `_index` are set when the `Waves` getter builds the entry, and the editor\r\n * rebuilds the whole array from that getter after every add/delete. A copy that\r\n * survives a list mutation is never reused, so the cached index cannot drift\r\n * onto a different wave - the same reason it is safe to write through with it.\r\n */\r\nclass GerstnerWave {\r\n private _owner: Nullable<GerstnerWaveGenerator>;\r\n private _index: number;\r\n _direction: number;\r\n _steepness: number;\r\n _amplitude: number;\r\n _length: number;\r\n _omni: boolean;\r\n _originX: number;\r\n _originZ: number;\r\n constructor() {\r\n this._owner = null;\r\n this._index = -1;\r\n this._direction = 0;\r\n this._steepness = 0;\r\n this._amplitude = 0;\r\n this._length = 1;\r\n this._omni = false;\r\n this._originX = 0;\r\n this._originZ = 0;\r\n }\r\n /**\r\n * Binds this entry to a slot of `owner`, so the field setters write through\r\n * to the generator. Called by the `Waves` getter and by `add`; the index is\r\n * the slot the entry currently represents.\r\n * @internal\r\n */\r\n bind(owner: GerstnerWaveGenerator, index: number) {\r\n this._owner = owner;\r\n this._index = index;\r\n this.loadFromOwner(owner, index);\r\n }\r\n /**\r\n * Copies the values in slot `index` of `owner` into this object, refreshing\r\n * the cached fields without writing back.\r\n * @internal\r\n */\r\n loadFromOwner(owner: GerstnerWaveGenerator, index: number) {\r\n this._direction = owner.getWaveDirection(index);\r\n this._steepness = owner.getWaveSteepness(index);\r\n this._amplitude = owner.getWaveAmplitude(index);\r\n this._length = owner.getWaveLength(index);\r\n this._omni = owner.isOmniWave(index);\r\n this._originX = owner.getOriginX(index);\r\n this._originZ = owner.getOriginZ(index);\r\n }\r\n /**\r\n * Writes this object's values into slot `index` of `owner`, unconditionally.\r\n *\r\n * Used by the `Waves` setter for a serialised-in array, whose entries were\r\n * constructed without an owner, and by `add` for a freshly created one. It is\r\n * distinct from the write-through in the field setters, which fire on each\r\n * individual edit.\r\n * @internal\r\n */\r\n applyTo(owner: GerstnerWaveGenerator, index: number) {\r\n owner.setWaveDirection(index, this._direction);\r\n owner.setWaveSteepness(index, this._steepness);\r\n owner.setWaveAmplitude(index, this._amplitude);\r\n owner.setWaveLength(index, this._length);\r\n owner.setOmniWave(index, this._omni);\r\n owner.setOrigin(index, this._originX, this._originZ);\r\n this._owner = owner;\r\n this._index = index;\r\n }\r\n /** @internal */\r\n private writethrough(\r\n setter: (owner: GerstnerWaveGenerator, index: number, val: number) => void,\r\n val: number\r\n ) {\r\n const owner = this._owner;\r\n if (owner) {\r\n setter(owner, this._index, val);\r\n }\r\n }\r\n /** Gets the wave direction angle in radians. */\r\n get direction() {\r\n return this._direction;\r\n }\r\n set direction(val) {\r\n this._direction = val;\r\n this.writethrough((o, i, v) => o.setWaveDirection(i, v), val);\r\n }\r\n /** Gets the wave steepness. */\r\n get steepness() {\r\n return this._steepness;\r\n }\r\n set steepness(val) {\r\n this._steepness = val;\r\n this.writethrough((o, i, v) => o.setWaveSteepness(i, v), val);\r\n }\r\n /** Gets the wave amplitude. */\r\n get amplitude() {\r\n return this._amplitude;\r\n }\r\n set amplitude(val) {\r\n this._amplitude = val;\r\n this.writethrough((o, i, v) => o.setWaveAmplitude(i, v), val);\r\n }\r\n /** Gets the wave length in meters. */\r\n get length() {\r\n return this._length;\r\n }\r\n set length(val) {\r\n this._length = val;\r\n this.writethrough((o, i, v) => o.setWaveLength(i, v), val);\r\n }\r\n /** Gets whether the wave is omni-directional. */\r\n get omni() {\r\n return this._omni;\r\n }\r\n set omni(val) {\r\n this._omni = val;\r\n if (this._owner) {\r\n this._owner.setOmniWave(this._index, val);\r\n }\r\n }\r\n /** Gets the origin X of an omni-directional wave. */\r\n get originX() {\r\n return this._originX;\r\n }\r\n set originX(val) {\r\n this._originX = val;\r\n if (this._owner) {\r\n this._owner.setOrigin(this._index, val, this._originZ);\r\n }\r\n }\r\n /** Gets the origin Z of an omni-directional wave. */\r\n get originZ() {\r\n return this._originZ;\r\n }\r\n set originZ(val) {\r\n this._originZ = val;\r\n if (this._owner) {\r\n this._owner.setOrigin(this._index, this._originX, val);\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function getGerstnerWaveClass(): SerializableClass {\r\n return {\r\n ctor: GerstnerWave,\r\n name: 'GerstnerWave',\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'Direction',\r\n description: 'Wave direction angle in radians',\r\n type: 'float',\r\n options: { animatable: true, minValue: -3.14, maxValue: 3.14 },\r\n get(this: GerstnerWave, value) {\r\n value.num[0] = this.direction;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.direction = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Steepness',\r\n description: 'Wave steepness. The sum of steepness across waves sets how sharply crests fold',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 2 },\r\n get(this: GerstnerWave, value) {\r\n value.num[0] = this.steepness;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.steepness = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Amplitude',\r\n description: 'Wave height amplitude',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n get(this: GerstnerWave, value) {\r\n value.num[0] = this.amplitude;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.amplitude = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Length',\r\n description: 'Wave length in meters',\r\n type: 'float',\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n get(this: GerstnerWave, value) {\r\n value.num[0] = this.length;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.length = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Omni',\r\n description: 'If true, radiates outward from an origin rather than travelling in one direction',\r\n type: 'bool',\r\n get(this: GerstnerWave, value) {\r\n value.bool[0] = this.omni;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.omni = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'Origin',\r\n description: 'Origin of an omni-directional wave, ignored by directional waves',\r\n type: 'vec2',\r\n options: { animatable: true, minValue: -1000, maxValue: 1000 },\r\n get(this: GerstnerWave, value) {\r\n value.num[0] = this.originX;\r\n value.num[1] = this.originZ;\r\n },\r\n set(this: GerstnerWave, value) {\r\n this.originX = value.num[0];\r\n this.originZ = value.num[1];\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n\r\n/** @internal */\r\nexport function getWaterClass(manager: ResourceManager): SerializableClass {\r\n return {\r\n ctor: Water,\r\n name: 'Water',\r\n parent: GraphNode,\r\n createFunc(ctx: SceneNode) {\r\n const node = new Water(ctx.scene!);\r\n node.parent = ctx;\r\n return { obj: node };\r\n },\r\n getProps() {\r\n return defineProps([\r\n {\r\n name: 'WaveGenerator',\r\n description: 'Wave generator used to drive the water surface',\r\n type: 'object',\r\n default: null,\r\n options: {\r\n objectTypes: [FFTWaveGenerator, FBMWaveGenerator, GerstnerWaveGenerator]\r\n },\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.object[0] = this.waveGenerator ?? null;\r\n },\r\n set(this: Water, value) {\r\n if (!value.object[0]) {\r\n this.waveGenerator = null;\r\n } else {\r\n this.waveGenerator = value.object[0] as WaveGenerator;\r\n }\r\n }\r\n },\r\n {\r\n name: 'GridScale',\r\n description: 'Scale of the water simulation grid',\r\n type: 'float',\r\n default: 1,\r\n options: { minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.gridScale;\r\n },\r\n set(this: Water, value) {\r\n this.gridScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Wireframe',\r\n description: 'If true, renders the water surface as wireframe',\r\n type: 'bool',\r\n default: false,\r\n get(this: Water, value) {\r\n value.bool[0] = this.wireframe;\r\n },\r\n set(this: Water, value) {\r\n this.wireframe = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'AnimationSpeed',\r\n description: 'Playback speed of wave animation',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n get(this: Water, value) {\r\n value.num[0] = this.animationSpeed;\r\n },\r\n set(this: Water, value) {\r\n this.animationSpeed = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Infinite',\r\n description:\r\n 'Draw the surface as an unbounded ocean reaching the horizon instead of a body of water ending at the node extent. Reaches the horizon without enlarging the camera far plane, so near-scene depth precision is unaffected. Leave off for ponds, lakes and pools, which have an edge.',\r\n type: 'bool',\r\n default: false,\r\n get(this: Water, value) {\r\n value.bool[0] = this.infinite;\r\n },\r\n set(this: Water, value) {\r\n this.infinite = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'ViewDistance',\r\n description:\r\n 'How far the surface is built out from the camera, in meters, or 0 to derive it from the true horizon distance for the camera height. Keep the sky AerialPerspectiveDistance at least this large, or the far water stops converging towards the sky colour and the hard band comes back.',\r\n type: 'float',\r\n default: 0,\r\n options: { minValue: 0, maxValue: 100000 },\r\n isHidden(this: Water) {\r\n return !this.infinite;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.viewDistance;\r\n },\r\n set(this: Water, value) {\r\n this.viewDistance = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsEnabled',\r\n description: 'Whether the water projects caustics onto the geometry below it',\r\n type: 'bool',\r\n default: true,\r\n get(this: Water, value) {\r\n value.bool[0] = this.causticsEnabled;\r\n },\r\n set(this: Water, value) {\r\n this.causticsEnabled = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsIntensity',\r\n description: 'Strength of the caustic contrast',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n isHidden(this: Water) {\r\n return !this.causticsEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.causticsIntensity;\r\n },\r\n set(this: Water, value) {\r\n this.causticsIntensity = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsDepth',\r\n description: 'Depth in meters below the surface where the caustics are in focus',\r\n type: 'float',\r\n default: 4,\r\n options: { animatable: true, minValue: 0.01, maxValue: 100 },\r\n isHidden(this: Water) {\r\n return !this.causticsEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.causticsDepth;\r\n },\r\n set(this: Water, value) {\r\n this.causticsDepth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsRange',\r\n description: 'Furthest distance in meters from the camera the caustic map reaches',\r\n type: 'float',\r\n default: 4,\r\n options: { minValue: 1, maxValue: 1000 },\r\n isHidden(this: Water) {\r\n return !this.causticsEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.causticsRange;\r\n },\r\n set(this: Water, value) {\r\n this.causticsRange = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsFadeDistance',\r\n description:\r\n 'Width in meters the caustics fade out over at the edge of the map, or 0 to derive it from the range',\r\n type: 'float',\r\n default: 0,\r\n options: { minValue: 0, maxValue: 100 },\r\n isHidden(this: Water) {\r\n return !this.causticsEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.causticsFadeDistance;\r\n },\r\n set(this: Water, value) {\r\n this.causticsFadeDistance = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsSceneDepth',\r\n description:\r\n 'Land caustics on the scene instead of on a plane at CausticsDepth. Reuses the sun shadow cascade, so it costs no extra geometry pass; WebGL2 keeps the plane, which its shadow map format cannot avoid.',\r\n type: 'bool',\r\n default: true,\r\n get(this: Water, value) {\r\n value.bool[0] = this.causticsSceneDepth;\r\n },\r\n set(this: Water, value) {\r\n this.causticsSceneDepth = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'CausticsWarp',\r\n description:\r\n 'How strongly caustic map texels are concentrated near the camera; ignored while the map already fits the water within range',\r\n type: 'float',\r\n default: 1.5,\r\n options: { minValue: 0, maxValue: 8 },\r\n isHidden(this: Water) {\r\n return !this.causticsEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.causticsWarp;\r\n },\r\n set(this: Water, value) {\r\n this.causticsWarp = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterEnabled',\r\n description:\r\n 'Whether a camera inside this water sees it from the inside: the medium over the whole scene, the sky replaced by water, and the surface read from below with its Snell window. Atmospheric fog is suppressed while submerged.',\r\n type: 'bool',\r\n default: true,\r\n get(this: Water, value) {\r\n value.bool[0] = this.underwaterEnabled;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterEnabled = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterAmbientIntensity',\r\n description:\r\n 'Scale on the downwelling sky light filling the water column. This is what the water fades to in the distance, so it sets how bright the underwater haze reads.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.underwaterAmbientIntensity;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterAmbientIntensity = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterGodRays',\r\n description:\r\n 'Whether shafts of sunlight are marched through the water column. Reads the caustic map as the surface transmittance, so the shafts carry the pattern that lands on the sea bed; needs CausticsEnabled.',\r\n type: 'bool',\r\n default: true,\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.bool[0] = this.underwaterGodRays;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterGodRays = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterGodRayIntensity',\r\n description: 'Strength of the light shafts, 1 for the value the medium implies',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 5 },\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled || !this.underwaterGodRays;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.underwaterGodRayIntensity;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterGodRayIntensity = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterGodRaySteps',\r\n description:\r\n 'Samples taken along each view ray for the light shafts. Raise it when the shafts read as grain rather than as beams.',\r\n type: 'int',\r\n default: 24,\r\n options: { minValue: 4, maxValue: 96 },\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled || !this.underwaterGodRays;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.underwaterGodRaySteps;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterGodRaySteps = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterGodRayShadow',\r\n description:\r\n 'Whether geometry standing in the water breaks the light shafts. The shafts come from the caustic map, which knows only what the surface did to the sunlight, so without this a shaft runs straight through a piling. Costs a shadow map lookup per march step.',\r\n type: 'bool',\r\n default: false,\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled || !this.underwaterGodRays;\r\n },\r\n get(this: Water, value) {\r\n value.bool[0] = this.underwaterGodRayShadow;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterGodRayShadow = value.bool[0];\r\n }\r\n },\r\n {\r\n name: 'UnderwaterHysteresis',\r\n description:\r\n 'Half-width in meters of the dead band around the surface the submerged test uses, so a camera at water level does not flip state every frame',\r\n type: 'float',\r\n default: 0.05,\r\n options: { minValue: 0, maxValue: 2 },\r\n isHidden(this: Water) {\r\n return !this.underwaterEnabled;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.underwaterHysteresis;\r\n },\r\n set(this: Water, value) {\r\n this.underwaterHysteresis = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'MediumMode',\r\n description:\r\n 'How the water medium attenuates light: physical coefficients, or the legacy ramp textures',\r\n type: 'string',\r\n default: 'physical',\r\n options: {\r\n enum: {\r\n labels: ['Physical', 'Ramp'],\r\n values: ['physical', 'ramp']\r\n }\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = this.material.mediumMode;\r\n },\r\n set(this: Water, value) {\r\n this.material.mediumMode = value.str[0] as WaterMediumMode;\r\n }\r\n },\r\n {\r\n name: 'RefractionMode',\r\n description:\r\n 'How the refracted view sample is located. March walks the refracted ray against the scene depth and samples where it lands, which keeps the sample on the object behind the water; Offset skips the search and displaces the screen UV by the wave normal, which costs no depth fetches but samples the wrong point. Use Offset on hardware that cannot afford the search.',\r\n type: 'string',\r\n default: 'march',\r\n options: {\r\n enum: {\r\n labels: ['March (accurate)', 'Offset (cheap)'],\r\n values: ['march', 'offset']\r\n }\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = this.material.refractionMode;\r\n },\r\n set(this: Water, value) {\r\n this.material.refractionMode = value.str[0] as WaterRefractionMode;\r\n }\r\n },\r\n {\r\n name: 'DebugOutput',\r\n description:\r\n 'Debugging aid: replaces the water colour with one of the shading terms it is built from, so a broken term can be identified by eye',\r\n type: 'string',\r\n default: 'none',\r\n options: {\r\n enum: {\r\n labels: WATER_DEBUG_OUTPUTS.map((e) => e.label),\r\n values: WATER_DEBUG_OUTPUTS.map((e) => e.value)\r\n }\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = this.debugOutput;\r\n },\r\n set(this: Water, value) {\r\n this.debugOutput = value.str[0] as WaterDebugOutput;\r\n }\r\n },\r\n {\r\n name: 'Absorption',\r\n description: 'Absorption coefficient sigma_a of the water medium, per meter, per channel',\r\n type: 'rgb',\r\n default: [1.0, 0.25, 0.15],\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n isHidden(this: Water) {\r\n return this.material.mediumMode !== 'physical';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.absorption.x;\r\n value.num[1] = this.material.absorption.y;\r\n value.num[2] = this.material.absorption.z;\r\n },\r\n set(this: Water, value) {\r\n this.material.absorption = new Vector3(value.num[0], value.num[1], value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'AbsorptionScale',\r\n description: 'Scale for the absorption coefficient',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n isHidden(this: Water) {\r\n return this.material.mediumMode !== 'physical';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.absorptionScale;\r\n },\r\n set(this: Water, value) {\r\n this.material.absorptionScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'Scattering',\r\n description: 'Scattering coefficient sigma_s of the water medium, per meter, per channel',\r\n type: 'rgb',\r\n default: [0.05, 0.12, 0.18],\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n isHidden(this: Water) {\r\n return this.material.mediumMode !== 'physical';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.scattering.x;\r\n value.num[1] = this.material.scattering.y;\r\n value.num[2] = this.material.scattering.z;\r\n },\r\n set(this: Water, value) {\r\n this.material.scattering = new Vector3(value.num[0], value.num[1], value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'ScatteringScale',\r\n description: 'Scale for the scattering coefficient',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n isHidden(this: Water) {\r\n return this.material.mediumMode !== 'physical';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.scatteringScale;\r\n },\r\n set(this: Water, value) {\r\n this.material.scatteringScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'DepthScale',\r\n description: 'Depth attenuation scale for the water material (ramp medium only)',\r\n type: 'float',\r\n default: 10,\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n isHidden(this: Water) {\r\n return this.material.mediumMode !== 'ramp';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.depthMulti;\r\n },\r\n set(this: Water, value) {\r\n this.material.depthMulti = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ReflectionStrength',\r\n description:\r\n 'Scale on the Fresnel reflectance, 1 for the physical value. Lower it to trade the reflection away and show more of what is beneath the surface.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.reflectionStrength;\r\n },\r\n set(this: Water, value) {\r\n this.material.reflectionStrength = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'SubsurfaceIntensity',\r\n description:\r\n 'Strength of the sunlight scattered forward through a wave crest, which is what makes a backlit crest glow. Grazing views of a low sun show it; looking down at the water does not.',\r\n type: 'float',\r\n default: 1.5,\r\n options: { animatable: true, minValue: 0, maxValue: 10 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.subsurfaceIntensity;\r\n },\r\n set(this: Water, value) {\r\n this.material.subsurfaceIntensity = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'SubsurfaceSteepness',\r\n description:\r\n 'How sharply surface tilt gates the subsurface glow. Higher makes gentle swell glow too; lower restricts it to steep wave flanks.',\r\n type: 'float',\r\n default: 60,\r\n options: { animatable: true, minValue: 0, maxValue: 100 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.subsurfaceSteepness;\r\n },\r\n set(this: Water, value) {\r\n this.material.subsurfaceSteepness = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'SunScatteringIntensity',\r\n description:\r\n 'Strength of the sunlight scattered out of the water column towards the eye, 1 for the value the medium coefficients imply. This is what makes a shadow on the water darken the water itself and a low sun tint it; 0 leaves the body lit by the environment alone.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 4 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.sunScatteringIntensity;\r\n },\r\n set(this: Water, value) {\r\n this.material.sunScatteringIntensity = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamAmount',\r\n description:\r\n 'Coverage of the foam on breaking wave crests, mapped from the folding the wave generator reports. 0 disables crest foam. Independent of ShoreFoamAmount.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 4 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.foamAmount;\r\n },\r\n set(this: Water, value) {\r\n this.material.foamAmount = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamFalloff',\r\n description:\r\n 'Falloff applied to crest foam coverage. Above 1 pushes light folding towards no foam at all, so only a genuinely broken crest shows - which is what keeps a windy sea from turning uniformly white.',\r\n type: 'float',\r\n default: 1.5,\r\n options: { animatable: true, minValue: 0.01, maxValue: 8 },\r\n isHidden(this: Water) {\r\n return this.material.foamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.foamFalloff;\r\n },\r\n set(this: Water, value) {\r\n this.material.foamFalloff = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'FoamColor',\r\n description:\r\n 'Diffuse albedo of the foam, shared by the crest foam and the shoreline foam. Slightly off-white and slightly blue - sea foam is water and air, and a pure white one reads as snow.',\r\n type: 'rgb',\r\n default: [0.92, 0.95, 0.97],\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.foamColor.x;\r\n value.num[1] = this.material.foamColor.y;\r\n value.num[2] = this.material.foamColor.z;\r\n },\r\n set(this: Water, value) {\r\n this.material.foamColor = new Vector3(value.num[0], value.num[1], value.num[2]);\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamAmount',\r\n description:\r\n 'Coverage of the foam that collects where the water meets a surface - the waterline on a shelving bed, and the collar around a piling or a hull. 0 disables it, which also removes its cost. Independent of the crest foam the wave generator produces. Requires WebGL2 or WebGPU.',\r\n type: 'float',\r\n default: 0,\r\n // Deliberately not animatable: crossing zero switches the whole\r\n // feature in and out of the shader, so an animation curve driving this\r\n // through zero rebuilds the program on the way past.\r\n options: { minValue: 0, maxValue: 4 },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamAmount;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamAmount = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamDepth',\r\n description:\r\n 'How far the foam band reaches from the surface behind it, in meters. Over a bed this is a depth of water; against something vertical it is the horizontal distance to its side, and one value serves both. How wide that is on screen depends on the geometry: a thin line on a steep drop-off, a broad stretch on a flat shelf.',\r\n type: 'float',\r\n default: 0.5,\r\n options: { animatable: true, minValue: 0.001, maxValue: 20 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamDepth;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamDepth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamFalloff',\r\n description:\r\n 'Falloff across the foam band. Above 1 pushes the coverage towards the contact line and keeps the outer edge thin and broken.',\r\n type: 'float',\r\n default: 1.5,\r\n options: { animatable: true, minValue: 0.01, maxValue: 8 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamFalloff;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamFalloff = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamScale',\r\n description:\r\n 'Size of the clumps the band breaks into, as cycles across the band rather than cycles per meter. Being relative to the band width, one value reads the same on a shoreline metres across and on a collar a handspan wide.',\r\n type: 'float',\r\n default: 2.5,\r\n options: { animatable: true, minValue: 0, maxValue: 20 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamScale;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamWashAmount',\r\n description:\r\n 'How far the waterline runs up and back, as a fraction of ShoreFoamDepth. This is what makes the band read as surf rather than as a painted rim; 0 leaves it static. Above 1 the band closes completely at the bottom of the cycle, which looks like the foam blinking out.',\r\n type: 'float',\r\n default: 0.5,\r\n options: { animatable: true, minValue: 0, maxValue: 2 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamWashAmount;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamWashAmount = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamWashSpeed',\r\n description: 'Run-up cycles per second. Swell rather than wind waves, so well under 1.',\r\n type: 'float',\r\n default: 0.12,\r\n options: { animatable: true, minValue: 0, maxValue: 2 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamWashSpeed;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamWashSpeed = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ShoreFoamWashScale',\r\n description:\r\n 'Spatial frequency of the run-up phase, in cycles per meter. At 0 the whole waterline rises and falls in lockstep, which reads as the water level itself changing; a cycle every few tens of meters breaks a long shoreline into sections that run out of step with one another.',\r\n type: 'float',\r\n default: 0.03,\r\n options: { animatable: true, minValue: 0, maxValue: 1 },\r\n isHidden(this: Water) {\r\n return this.shoreFoamAmount <= 0;\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.shoreFoamWashScale;\r\n },\r\n set(this: Water, value) {\r\n this.shoreFoamWashScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'CheapRefractionDepth',\r\n description:\r\n 'Depth in meters the cheap refraction mode assumes the water is. Sets how strong the distortion looks when RefractionMode is Offset; ignored by March. A constant rather than the measured distance to the bottom, because an offset scaled by that distance paints a second copy of any object breaking the surface.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 20 },\r\n isHidden(this: Water) {\r\n return this.material.refractionMode !== 'offset';\r\n },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.cheapRefractionDepth;\r\n },\r\n set(this: Water, value) {\r\n this.material.cheapRefractionDepth = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'RefractionBlur',\r\n description:\r\n 'Scale on how much the medium blurs what is seen through it, 1 for the width the scattering coefficient and the path length imply. Turbid or deep water smudges the bottom; 0 keeps it sharp at any depth.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 4 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.refractionBlur;\r\n },\r\n set(this: Water, value) {\r\n this.material.refractionBlur = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ScatterAnisotropy',\r\n description:\r\n 'Mean cosine of a single scattering event. 0 scatters equally in all directions; higher brightens the water when looking towards the sun through it. Sea water measures near 0.9, but a turbid column blends towards isotropic on its own.',\r\n type: 'float',\r\n default: DEFAULT_SCATTER_ANISOTROPY,\r\n options: { animatable: true, minValue: 0, maxValue: 0.95 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.scatterAnisotropy;\r\n },\r\n set(this: Water, value) {\r\n this.material.scatterAnisotropy = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'RefractionScale',\r\n description:\r\n 'Artistic scale on the refracted view offset. 1 is physical: the view ray is bent by Snell’s law and followed to whatever is behind the water, so the incidence angle, the depth and the perspective are already accounted for. 0 disables refraction.',\r\n type: 'float',\r\n default: 1,\r\n options: { animatable: true, minValue: 0, maxValue: 4 },\r\n get(this: Water, value) {\r\n value.num[0] = this.material.refractionScale;\r\n },\r\n set(this: Water, value) {\r\n this.material.refractionScale = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'TAAStrength',\r\n description: 'Temporal anti-aliasing strength for the water surface',\r\n type: 'float',\r\n default: 0.4,\r\n options: { minValue: 0, maxValue: 1 },\r\n get(this: Water, value) {\r\n value.num[0] = this.TAAStrength;\r\n },\r\n set(this: Water, value) {\r\n this.TAAStrength = value.num[0];\r\n }\r\n },\r\n {\r\n name: 'ScatterRampTexture',\r\n description: 'Ramp texture used for water scatter lighting',\r\n type: 'object',\r\n default: null,\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = manager.getAssetId(this.material.scatterRampTexture) ?? '';\r\n },\r\n async set(value) {\r\n if (!value) {\r\n this.material.scatterRampTexture = null;\r\n } else {\r\n if (value.str[0]) {\r\n const assetId = value.str[0];\r\n let tex: Nullable<Texture2D>;\r\n try {\r\n tex = await manager.fetchTexture<Texture2D>(assetId);\r\n } catch (err) {\r\n console.error(`Load asset failed: ${value.str[0]}: ${err}`);\r\n tex = null;\r\n }\r\n if (tex?.isTexture2D()) {\r\n this.material.scatterRampTexture = tex;\r\n } else {\r\n console.error('Invalid texture type');\r\n }\r\n }\r\n }\r\n }\r\n },\r\n {\r\n name: 'AbsorptionRampTexture',\r\n description: 'Ramp texture used for water absorption',\r\n type: 'object',\r\n default: null,\r\n isNullable() {\r\n return true;\r\n },\r\n get(this: Water, value) {\r\n value.str[0] = manager.getAssetId(this.material.absorptionRampTexture) ?? '';\r\n },\r\n async set(this: Water, value) {\r\n if (!value) {\r\n this.material.absorptionRampTexture = null;\r\n } else {\r\n if (value.str[0]) {\r\n const assetId = value.str[0];\r\n let tex: Nullable<Texture2D>;\r\n try {\r\n tex = await manager.fetchTexture<Texture2D>(assetId);\r\n } catch (err) {\r\n console.error(`Load asset failed: ${value.str[0]}: ${err}`);\r\n tex = null;\r\n }\r\n if (tex?.isTexture2D()) {\r\n this.material.absorptionRampTexture = tex;\r\n } else {\r\n console.error('Invalid texture type');\r\n }\r\n }\r\n }\r\n }\r\n }\r\n ]);\r\n }\r\n };\r\n}\r\n"],"names":["getFBMWaveGeneratorClass","ctor","FBMWaveGenerator","name","getProps","defineProps","description","type","options","minValue","maxValue","default","get","value","num","numOctaves","set","animatable","wind","x","y","Vector2","amplitude","frequency","getFFTWaveGeneratorClass","FFTWaveGenerator","alignment","foamWidth","foamContrast","getWaveLength","setWaveLength","getWaveStrength","setWaveStrength","getWaveCroppiness","setWaveCroppiness","getGerstnerWaveGeneratorClass","GerstnerWaveGenerator","MAX_GERSTNER_WAVE_COUNT","numWaves","objectTypes","GerstnerWave","object","i","wave","bind","push","waves","length","applyTo","add","index","insertAt","insertWave","delete","deleteWave","_owner","_index","_direction","_steepness","_amplitude","_length","_omni","_originX","_originZ","owner","loadFromOwner","getWaveDirection","getWaveSteepness","getWaveAmplitude","isOmniWave","getOriginX","getOriginZ","setWaveDirection","setWaveSteepness","setWaveAmplitude","setOmniWave","setOrigin","writethrough","setter","val","direction","o","v","steepness","omni","originX","originZ","getGerstnerWaveClass","bool","getWaterClass","manager","Water","parent","GraphNode","createFunc","ctx","node","scene","obj","isNullable","waveGenerator","gridScale","wireframe","animationSpeed","infinite","isHidden","viewDistance","causticsEnabled","causticsIntensity","causticsDepth","causticsRange","causticsFadeDistance","causticsSceneDepth","causticsWarp","underwaterEnabled","underwaterAmbientIntensity","underwaterGodRays","underwaterGodRayIntensity","underwaterGodRaySteps","underwaterGodRayShadow","underwaterHysteresis","enum","labels","values","str","material","mediumMode","refractionMode","WATER_DEBUG_OUTPUTS","map","e","label","debugOutput","absorption","z","Vector3","absorptionScale","scattering","scatteringScale","depthMulti","reflectionStrength","subsurfaceIntensity","subsurfaceSteepness","sunScatteringIntensity","foamAmount","foamFalloff","foamColor","shoreFoamAmount","shoreFoamDepth","shoreFoamFalloff","shoreFoamScale","shoreFoamWashAmount","shoreFoamWashSpeed","shoreFoamWashScale","cheapRefractionDepth","refractionBlur","DEFAULT_SCATTER_ANISOTROPY","scatterAnisotropy","refractionScale","TAAStrength","getAssetId","scatterRampTexture","assetId","tex","fetchTexture","err","console","error","isTexture2D","absorptionRampTexture"],"mappings":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4C,qBAAqB,CAAK,IAAA,EAAA;AAC5E,qBAAA;AACA,oBAAA,MAAMzJ,KAAiBH,KAAK,EAAA;AAC1B,wBAAA,IAAI,CAACA,KAAO,EAAA;AACV,4BAAA,IAAI,CAACgH,QAAQ,CAAC4C,qBAAqB,GAAG,IAAA;yBACjC,MAAA;AACL,4BAAA,IAAI5J,KAAM+G,CAAAA,GAAG,CAAC,CAAA,CAAE,EAAE;AAChB,gCAAA,MAAMsC,OAAUrJ,GAAAA,KAAAA,CAAM+G,GAAG,CAAC,CAAE,CAAA;gCAC5B,IAAIuC,GAAAA;gCACJ,IAAI;oCACFA,GAAM,GAAA,MAAMzE,OAAQ0E,CAAAA,YAAY,CAAYF,OAAAA,CAAAA;AAC9C,iCAAA,CAAE,OAAOG,GAAK,EAAA;AACZC,oCAAAA,OAAAA,CAAQC,KAAK,CAAC,CAAC,mBAAmB,EAAE1J,KAAAA,CAAM+G,GAAG,CAAC,CAAE,CAAA,CAAC,EAAE,EAAEyC,GAAK,CAAA,CAAA,CAAA;oCAC1DF,GAAM,GAAA,IAAA;AACR;AACA,gCAAA,IAAIA,KAAKK,WAAe,EAAA,EAAA;AACtB,oCAAA,IAAI,CAAC3C,QAAQ,CAAC4C,qBAAqB,GAAGN,GAAAA;iCACjC,MAAA;AACLG,oCAAAA,OAAAA,CAAQC,KAAK,CAAC,sBAAA,CAAA;AAChB;AACF;AACF;AACF;AACF;AACD,aAAA,CAAA;AACH;AACF,KAAA;AACF;;;;"}
|
|
@@ -3,23 +3,23 @@ import { Disposable, DRef, Vector4 } from '@zephyr3d/base';
|
|
|
3
3
|
import { fetchSampler } from './misc.js';
|
|
4
4
|
import { getDevice } from '../app/api.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* CubemapSHProjector is responsible for projecting a cubemap texture into spherical harmonics (SH) coefficients.
|
|
8
|
-
* This is commonly used for efficient environment lighting approximation in real-time rendering.
|
|
9
|
-
*
|
|
10
|
-
* The class uses Monte Carlo sampling to compute the first 9 spherical harmonics coefficients (up to order 2)
|
|
11
|
-
* from a cubemap texture, which can then be used for ambient lighting calculations.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```typescript
|
|
15
|
-
* const projector = new CubemapSHProjector(10000);
|
|
16
|
-
* const shBuffer = device.createBuffer(4 * 4 * 9, { usage: 'uniform' });
|
|
17
|
-
* projector.projectCubemap(environmentCubemap, shBuffer);
|
|
18
|
-
* // shBuffer now contains the 9 SH coefficients as RGB values
|
|
19
|
-
* projector.dispose();
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* @public
|
|
6
|
+
/**
|
|
7
|
+
* CubemapSHProjector is responsible for projecting a cubemap texture into spherical harmonics (SH) coefficients.
|
|
8
|
+
* This is commonly used for efficient environment lighting approximation in real-time rendering.
|
|
9
|
+
*
|
|
10
|
+
* The class uses Monte Carlo sampling to compute the first 9 spherical harmonics coefficients (up to order 2)
|
|
11
|
+
* from a cubemap texture, which can then be used for ambient lighting calculations.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const projector = new CubemapSHProjector(10000);
|
|
16
|
+
* const shBuffer = device.createBuffer(4 * 4 * 9, { usage: 'uniform' });
|
|
17
|
+
* projector.projectCubemap(environmentCubemap, shBuffer);
|
|
18
|
+
* // shBuffer now contains the 9 SH coefficients as RGB values
|
|
19
|
+
* projector.dispose();
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
23
|
*/ class CubemapSHProjector extends Disposable {
|
|
24
24
|
static _programInst = null;
|
|
25
25
|
static _bindGroupInst = null;
|
|
@@ -27,37 +27,37 @@ import { getDevice } from '../app/api.js';
|
|
|
27
27
|
_primitive;
|
|
28
28
|
_renderTarget;
|
|
29
29
|
_numSamples;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new CubemapSHProjector instance.
|
|
32
|
-
*
|
|
33
|
-
* @param numSamples - Number of Monte Carlo samples to use for SH projection.
|
|
34
|
-
* Higher values provide better accuracy but slower computation.
|
|
35
|
-
* Default is 10000.
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new CubemapSHProjector instance.
|
|
32
|
+
*
|
|
33
|
+
* @param numSamples - Number of Monte Carlo samples to use for SH projection.
|
|
34
|
+
* Higher values provide better accuracy but slower computation.
|
|
35
|
+
* Default is 10000.
|
|
36
36
|
*/ constructor(numSamples = 10000){
|
|
37
37
|
super();
|
|
38
38
|
this._numSamples = numSamples;
|
|
39
39
|
this._primitive = new DRef();
|
|
40
40
|
this._renderTarget = new DRef();
|
|
41
41
|
}
|
|
42
|
-
/**
|
|
43
|
-
* Projects a cubemap texture into spherical harmonics coefficients and stores them in a GPUBuffer.
|
|
44
|
-
*
|
|
45
|
-
* The method performs Monte Carlo integration over the sphere to compute the first 9 SH coefficients.
|
|
46
|
-
* The results are written to a 3x3 render target where each pixel contains RGB values for one SH coefficient.
|
|
47
|
-
* The layout is:
|
|
48
|
-
* - (0,0): Y₀₀ (0,1): Y₁₋₁ (0,2): Y₁₀
|
|
49
|
-
* - (1,0): Y₁₁ (1,1): Y₂₋₂ (1,2): Y₂₋₁
|
|
50
|
-
* - (2,0): Y₂₀ (2,1): Y₂₁ (2,2): Y₂₂
|
|
51
|
-
*
|
|
52
|
-
* @param cubemap - The input cubemap texture to project
|
|
53
|
-
* @param outBuffer - GPU data buffer to receive the computed SH coefficients.
|
|
54
|
-
* Must be large enough to hold 9 RGB values (36 floats for RGBA32F format).
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* const shBuffer = device.createDataBuffer(9 * 4 * 4); // 9 coefficients * 4 components * 4 bytes
|
|
59
|
-
* projector.projectCubemap(environmentMap, shBuffer);
|
|
60
|
-
* ```
|
|
42
|
+
/**
|
|
43
|
+
* Projects a cubemap texture into spherical harmonics coefficients and stores them in a GPUBuffer.
|
|
44
|
+
*
|
|
45
|
+
* The method performs Monte Carlo integration over the sphere to compute the first 9 SH coefficients.
|
|
46
|
+
* The results are written to a 3x3 render target where each pixel contains RGB values for one SH coefficient.
|
|
47
|
+
* The layout is:
|
|
48
|
+
* - (0,0): Y₀₀ (0,1): Y₁₋₁ (0,2): Y₁₀
|
|
49
|
+
* - (1,0): Y₁₁ (1,1): Y₂₋₂ (1,2): Y₂₋₁
|
|
50
|
+
* - (2,0): Y₂₀ (2,1): Y₂₁ (2,2): Y₂₂
|
|
51
|
+
*
|
|
52
|
+
* @param cubemap - The input cubemap texture to project
|
|
53
|
+
* @param outBuffer - GPU data buffer to receive the computed SH coefficients.
|
|
54
|
+
* Must be large enough to hold 9 RGB values (36 floats for RGBA32F format).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const shBuffer = device.createDataBuffer(9 * 4 * 4); // 9 coefficients * 4 components * 4 bytes
|
|
59
|
+
* projector.projectCubemap(environmentMap, shBuffer);
|
|
60
|
+
* ```
|
|
61
61
|
*/ projectCubemap(cubemap, outBuffer, radianceSource = true) {
|
|
62
62
|
const device = getDevice();
|
|
63
63
|
if (!this._renderTarget.get()) {
|
|
@@ -71,25 +71,25 @@ import { getDevice } from '../app/api.js';
|
|
|
71
71
|
this.projectCubemapToTexture(cubemap, this._renderTarget.get(), radianceSource);
|
|
72
72
|
this._renderTarget.get().getColorAttachments()[0].readPixelsToBuffer(0, 0, 3, 3, 0, 0, outBuffer);
|
|
73
73
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Projects a cubemap texture into spherical harmonics coefficients and stores them in a 3x3 texture.
|
|
76
|
-
*
|
|
77
|
-
* The method performs Monte Carlo integration over the sphere to compute the first 9 SH coefficients.
|
|
78
|
-
* The results are written to a 3x3 render target where each pixel contains RGB values for one SH coefficient.
|
|
79
|
-
* The layout is:
|
|
80
|
-
* - (0,0): Y₀₀ (0,1): Y₁₋₁ (0,2): Y₁₀
|
|
81
|
-
* - (1,0): Y₁₁ (1,1): Y₂₋₂ (1,2): Y₂₋₁
|
|
82
|
-
* - (2,0): Y₂₀ (2,1): Y₂₁ (2,2): Y₂₂
|
|
83
|
-
*
|
|
84
|
-
* @param cubemap - The input cubemap texture to project
|
|
85
|
-
* @param outFramebuffer - Framebuffer that contains the 3x3 texture to receive the computed SH coefficients in color attachment slot 0.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* const shTexture = device.createTexture2D('rgba32f', 3, 3); // 9 coefficients * 4 components * 4 bytes
|
|
90
|
-
* const shFramebuffer = device.createFrameBuffer([shTexture], null);
|
|
91
|
-
* projector.projectCubemapToTexture(environmentMap, shFramebuffer);
|
|
92
|
-
* ```
|
|
74
|
+
/**
|
|
75
|
+
* Projects a cubemap texture into spherical harmonics coefficients and stores them in a 3x3 texture.
|
|
76
|
+
*
|
|
77
|
+
* The method performs Monte Carlo integration over the sphere to compute the first 9 SH coefficients.
|
|
78
|
+
* The results are written to a 3x3 render target where each pixel contains RGB values for one SH coefficient.
|
|
79
|
+
* The layout is:
|
|
80
|
+
* - (0,0): Y₀₀ (0,1): Y₁₋₁ (0,2): Y₁₀
|
|
81
|
+
* - (1,0): Y₁₁ (1,1): Y₂₋₂ (1,2): Y₂₋₁
|
|
82
|
+
* - (2,0): Y₂₀ (2,1): Y₂₁ (2,2): Y₂₂
|
|
83
|
+
*
|
|
84
|
+
* @param cubemap - The input cubemap texture to project
|
|
85
|
+
* @param outFramebuffer - Framebuffer that contains the 3x3 texture to receive the computed SH coefficients in color attachment slot 0.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const shTexture = device.createTexture2D('rgba32f', 3, 3); // 9 coefficients * 4 components * 4 bytes
|
|
90
|
+
* const shFramebuffer = device.createFrameBuffer([shTexture], null);
|
|
91
|
+
* projector.projectCubemapToTexture(environmentMap, shFramebuffer);
|
|
92
|
+
* ```
|
|
93
93
|
*/ projectCubemapToTexture(cubemap, framebuffer, radianceSource = true) {
|
|
94
94
|
const device = getDevice();
|
|
95
95
|
const clearColor = new Vector4(0, 0, 0, 1);
|
|
@@ -106,9 +106,9 @@ import { getDevice } from '../app/api.js';
|
|
|
106
106
|
this._primitive.get().drawInstanced(9);
|
|
107
107
|
device.popDeviceStates();
|
|
108
108
|
}
|
|
109
|
-
/**
|
|
110
|
-
* Disposes of all resources allocated by this projector instance.
|
|
111
|
-
* Should be called when the projector is no longer needed to prevent memory leaks.
|
|
109
|
+
/**
|
|
110
|
+
* Disposes of all resources allocated by this projector instance.
|
|
111
|
+
* Should be called when the projector is no longer needed to prevent memory leaks.
|
|
112
112
|
*/ onDispose() {
|
|
113
113
|
super.onDispose();
|
|
114
114
|
this._primitive.dispose();
|
|
@@ -117,16 +117,16 @@ import { getDevice } from '../app/api.js';
|
|
|
117
117
|
this._renderTarget.dispose();
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
/**
|
|
121
|
-
* Initializes the GPU resources needed for SH projection.
|
|
122
|
-
* This method is called automatically by projectCubemap() and sets up:
|
|
123
|
-
* - Sample directions primitive (Monte Carlo samples on unit sphere)
|
|
124
|
-
* - Render target (3x3 RGBA32F texture)
|
|
125
|
-
* - Render states (additive blending, no depth test)
|
|
126
|
-
* - GPU program for SH evaluation
|
|
127
|
-
*
|
|
128
|
-
* @param device - The graphics device to create resources with
|
|
129
|
-
* @internal
|
|
120
|
+
/**
|
|
121
|
+
* Initializes the GPU resources needed for SH projection.
|
|
122
|
+
* This method is called automatically by projectCubemap() and sets up:
|
|
123
|
+
* - Sample directions primitive (Monte Carlo samples on unit sphere)
|
|
124
|
+
* - Render target (3x3 RGBA32F texture)
|
|
125
|
+
* - Render states (additive blending, no depth test)
|
|
126
|
+
* - GPU program for SH evaluation
|
|
127
|
+
*
|
|
128
|
+
* @param device - The graphics device to create resources with
|
|
129
|
+
* @internal
|
|
130
130
|
*/ init(device) {
|
|
131
131
|
if (!this._primitive.get()) {
|
|
132
132
|
const samples = new Float32Array(this._numSamples * 4);
|
|
@@ -174,19 +174,19 @@ import { getDevice } from '../app/api.js';
|
|
|
174
174
|
CubemapSHProjector._bindGroupInst = device.createBindGroup(CubemapSHProjector._programInst.bindGroupLayouts[0]);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
/**
|
|
178
|
-
* Creates the GPU program for spherical harmonics evaluation.
|
|
179
|
-
*
|
|
180
|
-
* The vertex shader uses instanced rendering to generate 9 instances (one per SH coefficient).
|
|
181
|
-
* Each instance renders all sample points, but the vertex shader maps them to different
|
|
182
|
-
* pixels in the 3x3 output texture based on the instance ID.
|
|
183
|
-
*
|
|
184
|
-
* The fragment shader evaluates the appropriate SH basis function based on the pixel location,
|
|
185
|
-
* samples the cubemap in the sample direction, and multiplies by the integration weight.
|
|
186
|
-
*
|
|
187
|
-
* @param device - The graphics device to create the program with
|
|
188
|
-
* @returns The compiled GPU program
|
|
189
|
-
* @internal
|
|
177
|
+
/**
|
|
178
|
+
* Creates the GPU program for spherical harmonics evaluation.
|
|
179
|
+
*
|
|
180
|
+
* The vertex shader uses instanced rendering to generate 9 instances (one per SH coefficient).
|
|
181
|
+
* Each instance renders all sample points, but the vertex shader maps them to different
|
|
182
|
+
* pixels in the 3x3 output texture based on the instance ID.
|
|
183
|
+
*
|
|
184
|
+
* The fragment shader evaluates the appropriate SH basis function based on the pixel location,
|
|
185
|
+
* samples the cubemap in the sample direction, and multiplies by the integration weight.
|
|
186
|
+
*
|
|
187
|
+
* @param device - The graphics device to create the program with
|
|
188
|
+
* @returns The compiled GPU program
|
|
189
|
+
* @internal
|
|
190
190
|
*/ static _createProgram(device) {
|
|
191
191
|
const program = device.buildRenderProgram({
|
|
192
192
|
vertex (pb) {
|