/** * The dynamic sky effect: renders the sky of the camera - a day sky of an analytic atmosphere, lit by * the sun, a night sky of stars and the moon, and optionally clouds drifting with the wind - in * place of the sky of the scene. The time of day is set by the position of the sun, see * {@link DynamicSkyEffect#azimuth} and {@link DynamicSkyEffect#elevation}, and the effect can * keep a directional light in sync with it, see {@link DynamicSkyEffect#light}. * * The sky has no clouds by default, see {@link DynamicSkyEffect#cloudType}. They are a single flat * layer of noise ({@link CLOUDTYPE_FLAT}), or volumetric clouds ray marched through a layer of 3D * noise ({@link CLOUDTYPE_VOLUMETRIC}). The volumetric clouds are the expensive part of the sky, * and render to a texture of their own, at a reduced resolution by default, see * {@link DynamicSkyEffect#cloudResolution}. Their noise is generated on the CPU when the clouds are * first used. * * The effect also generates the lighting of the scene from its sky: the environment atlas lighting * the materials, assigned to {@link Scene#envAtlas}, see {@link DynamicSkyEffect#lighting}. The * cameras without the effect, such as the cameras rendering planar reflections, render the sky of * the scene from that environment atlas - a still image of this sky. * * The effect can also haze the scene with the sky, see {@link DynamicSkyEffect#haze}: with their * distance, the lit materials fade into the color of the sky behind them, in place of the fog of * the camera. * * In XR, the sky and the flat clouds render for each view, like the rest of the scene. The * volumetric clouds render to their texture for the view of the camera alone, so they streak where * the view of an eye extends past it - use {@link CLOUDTYPE_FLAT} clouds in XR. * * The shaders of the scene's own materials can evaluate the sky too, for example to fade distant * ground into the color of the sky behind it. The effect sets the uniforms of its sky on the * graphics device every frame, and its shader chunk `dynamicSkyAtmospherePS`, in GLSL and WGSL, * evaluates the sky from them. Include the chunk in a shader, and `dynamicSkyBase(dir, ambient)` * returns the radiance of the sky in a direction, without the sun disc, the stars and the moon, and * sets `ambient` to the light of the sky around it. The direction is in the space of the sky - a * world space direction turned by the rotation of the sky of the scene, `dynSkyRotation`, which the * effect sets with the other uniforms, and with X flipped: * * ```glsl * #include "dynamicSkyAtmospherePS" * uniform mat3 dynSkyRotation; * * vec3 skyColor(vec3 worldDir) { * vec3 dir = worldDir * dynSkyRotation; * dir.x = -dir.x; * vec3 ambient; * return dynamicSkyBase(dir, ambient); * } * ``` * * The chunk `dynamicSkyHazePS` applies the haze of the sky, see {@link DynamicSkyEffect#haze}, in * the shaders that the haze does not reach on its own - `dynamicSkyHaze(color, cameraPos, worldPos)` * returns a linear color seen through it: * * ```glsl * #include "dynamicSkyHazePS" * * vec3 hazed = dynamicSkyHaze(color, view_position, vPositionW); * ``` * * With more than one dynamic sky, a material renders with the sky that was updated last. On the * CPU, {@link DynamicSkyEffect#getSkyColor} evaluates the same sky in a direction. * * The sky does not work together with the volumetric fog of the camera frame, * {@link CameraFrame#volumetricFog}: the clouds cast no shadows into the fog, and the fog is not lit * by the light of the sky. * * The effect is not part of a camera frame by default - construct it and add it to the camera * frame of a camera: * * ```javascript * const sky = new DynamicSkyEffect(app.graphicsDevice); * sky.light = sunEntity.light; * sky.cloudType = CLOUDTYPE_VOLUMETRIC; * cameraFrame.addEffect(sky); * cameraFrame.update(); * ``` * * Like all effects, its settings apply on the next {@link CameraFrame#update}, which a day and * night cycle moving the sun calls every frame. The clouds drift with the time of the application. * * @category Graphics */ export class DynamicSkyEffect extends CameraFrameEffect { /** * @param {GraphicsDevice} device - The graphics device. */ constructor(device: GraphicsDevice); /** * The azimuth of the sun, in degrees - its compass direction. Defaults to 0. * * @type {number} */ azimuth: number; /** * The elevation of the sun above the horizon, in degrees. Negative values place the sun below * the horizon, which gives the night sky. Defaults to 25. * * @type {number} */ elevation: number; /** * The rotation of the whole sky around the vertical axis, in degrees. It is added to the * azimuth of the sun, so the sky, the sun and the moon turn together, along with the light and * the shadows it casts. Defaults to 0. * * @type {number} */ rotation: number; /** * The haziness of the atmosphere, 1-20 range. Higher values give a milkier sky and a larger * glow around the sun. Defaults to 2. * * @type {number} */ turbidity: number; /** * The amount of the Rayleigh scattering, 0-4 range, setting the blueness of the sky. Defaults * to 1.5. * * @type {number} */ rayleigh: number; /** * The amount of the Mie (aerosol) scattering, 0-0.1 range, setting the brightness of the glow * around the sun. Defaults to 0.005. * * @type {number} */ mieCoefficient: number; /** * The directional anisotropy of the Mie scattering, 0-1 range, setting how tightly the glow * hugs the sun. Defaults to 0.8. * * @type {number} */ mieDirectionalG: number; /** * The brightness of the sky, relative to the light of the sun. At 1, the sky lights the scene * with about a tenth of the light of the sun, as a clear sky does, at any elevation of the * sun: the blue sky and the ground lit by the sun are then of a similar brightness, so a single * exposure suits both. Lower values give a deeper sky, higher values a brighter one, and a * brighter ambient light of the scene. Defaults to 1. * * @type {number} */ luminance: number; /** * The directional light kept in sync with the sun - its direction, color and intensity. By day * it shines from the sun, at {@link DynamicSkyEffect#sunIntensity}, dimmed by the clouds, and * at night it fades to the moonlight, see {@link DynamicSkyEffect#moonIntensity}. Defaults to * null. * * @type {LightComponent|null} */ light: LightComponent | null; /** * The intensity of the light of the sun: of the {@link DynamicSkyEffect#light} with the sun * above the horizon, and of the sunlit clouds. The sky scales with it too, see * {@link DynamicSkyEffect#luminance}, so it sets the brightness of the whole day, to match the * exposure of the camera. Defaults to 2, a sunny day at an exposure of 1. * * @type {number} */ sunIntensity: number; /** * The intensity of the {@link DynamicSkyEffect#light} at night - the moonlight, a dim cool light * from the direction of the moon. Defaults to 1. * * @type {number} */ moonIntensity: number; /** * The color of the moonlight, and of the moon disc. Defaults to a pale blue. * * @type {Color} */ moonColor: Color; /** * The direction toward the moon, in the world space, turned by the * {@link DynamicSkyEffect#rotation} of the sky. It does not need to be normalized. Defaults to * a direction high in the sky. * * @type {Vec3} */ moonDirection: Vec3; /** * The angular radius of the moon disc, in degrees. Defaults to 0.6. * * @type {number} */ moonSize: number; /** * The brightness of the moon disc in the night sky. Defaults to 3. * * @type {number} */ moonGlow: number; /** * The color of the night sky. Defaults to a deep blue. * * @type {Color} */ nightColor: Color; /** * The brightness of the night sky. Defaults to 0.052. * * @type {number} */ nightBrightness: number; /** * The brightness of the stars. A value of 0 disables them. Defaults to 0.05. * * @type {number} */ starBrightness: number; /** * The density of the stars, 0-1 range - the fraction of the cells of the sky holding a star. * Defaults to 0.8. * * @type {number} */ starDensity: number; /** * The scale of the size of the stars. Defaults to 0.5. * * @type {number} */ starSize: number; /** * The strength of the warm glow at the horizon while the sun is just below it. Defaults to * 0.52. * * @type {number} */ twilightGlow: number; /** * The type of the clouds of the sky, {@link CLOUDTYPE_NONE}, {@link CLOUDTYPE_FLAT} or * {@link CLOUDTYPE_VOLUMETRIC}. Defaults to {@link CLOUDTYPE_NONE}. * * @type {string} */ cloudType: string; /** * The quality of the volumetric clouds, 0-1 range - the number of their steps through the * cloud layer, from 24 to 64, and toward the light, from 1 to 4, and the fineness of the steps * through a cloud. The cost grows about linearly, doubling from 0.5 to 1. Lower values give * less defined edges of the clouds and a flatter shading. Defaults to 0.5. * * @type {number} */ cloudQuality: number; /** * The resolution the volumetric clouds render at, relative to the resolution of the scene, * 0.25-1 range. The clouds are soft, so a reduced resolution saves most of their cost with * little loss of detail. The sky blurs them over 3x3 of their texels as it reads them, smoothing * the grain of their steps, so lower values also soften the clouds. Defaults to 0.5. * * @type {number} */ cloudResolution: number; /** * The fraction of the sky covered by clouds, 0-1 range, from a clear sky to overcast. Defaults * to 0.45. * * @type {number} */ cloudCoverage: number; /** * The softness of the clouds, 0.01-1 range. Lower values give dense clouds with crisp edges * and deep shadows, higher values thin them into translucent, wispy clouds with softer shading. * Defaults to 0.7. * * @type {number} */ cloudSoftness: number; /** * The opacity of the clouds, 0-1 range. Defaults to 1. * * @type {number} */ cloudOpacity: number; /** * The brightness of the sunlight falling on the clouds. Defaults to 0.6. * * @type {number} */ cloudBrightness: number; /** * The brightness of the moonlight on the clouds at night. The moonlight of the * {@link DynamicSkyEffect#light} is usually much brighter than the moon, to keep the night scene * readable - lit by it, the clouds would glow against the dark night sky. Defaults to 0.05. * * @type {number} */ cloudNightBrightness: number; /** * The distance in meters over which the cloud pattern repeats. Larger values give larger * clouds. Defaults to 8000. * * @type {number} */ cloudSize: number; /** * The altitude of the cloud layer, in meters. Defaults to 2000. * * @type {number} */ cloudHeight: number; /** * The thickness of the layer of the volumetric clouds, in meters, above their * {@link DynamicSkyEffect#cloudHeight}. Defaults to 2500. * * @type {number} */ cloudThickness: number; /** * The fraction of the sunlight the clouds block at the full coverage, dimming the * {@link DynamicSkyEffect#light}. Defaults to 0.6. * * @type {number} */ cloudSunDimming: number; /** * The speed the clouds drift with, in meters per second. Defaults to 10. * * @type {number} */ windSpeed: number; /** * The direction the clouds drift toward, in degrees around the vertical axis. Defaults to 45. * * @type {number} */ windDirection: number; /** * Whether the sky hazes the scene the camera renders - the aerial perspective. With their * distance, surfaces fade into the color of the sky behind them: warm toward a low sun, blue * away from it, and the gradient of the night sky after the sunset. The haze is densest at * {@link DynamicSkyEffect#hazeBaseHeight} and thins out with the height above it, see * {@link DynamicSkyEffect#hazeHeight}, so the valleys stay hazy while the view from high up is * clear. * * The haze takes the place of the fog of the camera, {@link Scene#fog} or * {@link CameraComponent#fog}: while the haze is enabled, the effect gives its camera a fog of * its own, and gives the camera its fog back once the haze is disabled. The lit materials the * camera renders, such as {@link StandardMaterial}, fade into the sky, while the other shaders, * such as those of the particles and the gaussian splats, render without fog - custom shaders * can apply the haze with the chunk `dynamicSkyHazePS`, see the description of the class. A * material opts out of the haze, rendering without fog, with {@link StandardMaterial#useFog}, * or by setting the define `DYNAMIC_SKY_NO_HAZE`: * * ```javascript * material.setDefine('DYNAMIC_SKY_NO_HAZE', true); * material.update(); * ``` * * A material replacing the chunk `fogPS` with its own is not hazed, and finds the define `FOG` * of its shaders set to `DYNAMICSKYHAZE` on the camera. Enabling or disabling the haze compiles * the shaders of the lit materials the camera renders again. Defaults to false. * * @type {boolean} */ haze: boolean; /** * The density of the haze at its {@link DynamicSkyEffect#hazeBaseHeight}, per world unit - the * fraction of the light it scatters over a unit of distance. A level view at that height is * hidden by 95% of the haze at about 3 / density. Defaults to 0.0005. * * @type {number} */ hazeDensity: number; /** * The height over which the density of the haze falls to about a third, in world units. Lower * values keep the haze closer to the ground. Defaults to 1000. * * @type {number} */ hazeHeight: number; /** * The height the haze is densest at, in world units - usually the lowest ground of the scene, * such as the level of the sea. Below it, the haze grows denser still. Defaults to 0. * * @type {number} */ hazeBaseHeight: number; /** * Whether the effect generates the lighting of the scene from its sky - the environment atlas * lighting the materials, assigned to {@link Scene#envAtlas}. Only one effect should do so, the * one of the main camera. The lighting is generated when the effect is first used, and again * when the sun moves by {@link DynamicSkyEffect#lightingThreshold}, when a setting of the sky * changes by more than a percent, when the clouds drift by {@link DynamicSkyEffect#lightingCloudThreshold}, and when * {@link DynamicSkyEffect#bakeLighting} is called. The clouds are a still image in the * lighting, and the sun disc is left out of it, as the {@link DynamicSkyEffect#light} carries * the light of the sun. Defaults to true. * * @type {boolean} */ lighting: boolean; /** * The resolution of the sky the lighting is generated from, the size of the faces of a * cubemap, in texels. The sky is filtered down from it to the environment atlas, so it should * be well above the resolution of the atlas: at lower values, the detail of the clouds * aliases, and their reflections flicker on each update of the lighting as the clouds drift. * Defaults to 256. * * @type {number} */ lightingResolution: number; /** * The size of the environment atlas the lighting is generated to. Higher values give sharper * reflections on glossy surfaces, and a sharper sky of the scene for the cameras without the * effect, such as the cameras rendering planar reflections. Defaults to 512. * * @type {number} */ atlasSize: number; /** * The angle the sun moves by, in degrees, before the lighting is generated again - keeping the * cost of a day and night cycle down. Defaults to 0.5. * * @type {number} */ lightingThreshold: number; /** * The distance the clouds drift by, as a fraction of the {@link DynamicSkyEffect#cloudSize}, * before the lighting is generated again, so the clouds in it follow the clouds of the sky. A * value of 0 disables it, and the drift of the clouds does not generate the lighting again. * Defaults to 0. * * @type {number} */ lightingCloudThreshold: number; /** * Whether the lighting blends from its previous update to its latest one, instead of changing * at once. While the sky changes gradually, such as with an animated time of day, each update * blends in over the time since the previous one, up to a second, so the lighting follows the * sky smoothly, about one update behind it. Without it, the lighting steps at each update, * which shows as flicker in the reflections of a quickly changing sky on glossy surfaces, such * as water. Sudden changes, such as a jump of the time of day, and * {@link DynamicSkyEffect#bakeLighting}, still apply at once. It costs two more environment * atlases of memory, and a small pass each frame while the lighting blends, so enable it only * when the sky changes continuously. Defaults to false. * * @type {boolean} */ lightingInterpolation: boolean; /** * The values of the uniforms the shaders of the sky read, shared by its material and its * passes. * * @type {Map} * @private */ private _skyUniforms; /** * The scope ids of the uniforms, resolved once, for the passes. * * @type {Map} * @private */ private _scopeIds; /** @private */ private _sunDir; /** @private */ private _skyDir; /** @private */ private _sunColor; /** @private */ private _warmColor; /** @private */ private _zenithColor; /** @private */ private _sunDirValue; /** @private */ private _betaR; /** @private */ private _betaM; /** @private */ private _nightColor; /** @private */ private _nightParams; /** @private */ private _moonDir; /** @private */ private _moonParams; /** @private */ private _cloudParams; /** * The drift of the cloud shapes (xy) and of their detail (zw), in pattern repeats. * * @private */ private _cloudOffset; /** @private */ private _cloudShading; /** @private */ private _cloudVolume; /** @private */ private _cloudLight; /** @private */ private _cloudLightDir; /** * The density of the haze, one over its height, and its base height. * * @private */ private _hazeParams; /** @private */ private _invView; /** @private */ private _projScale; /** @private */ private _bufferMatrix; /** @private */ private _bufferProj; /** * The rotation of the sky of the scene, the identity until the first frame sets it. * * @private */ private _rotation; /** @private */ private _frameIndex; /** * The scene of the camera frame, once the passes were created. * * @type {import('../../../scene/scene.js').Scene|null} * @private */ private _scene; /** * The material, the mesh instance and the node of the sky, created when the passes of the * effect are first created. * * @type {ShaderMaterial|null} * @private */ private _material; /** * @type {MeshInstance|null} * @private */ private _meshInstance; /** * @type {GraphNode|null} * @private */ private _node; /** * The layer the mesh instance of the sky is added to, while the passes exist. * * @type {Layer|null} * @private */ private _layer; /** * The camera rendering the sky, while the passes exist. * * @type {Camera|null} * @private */ private _camera; /** * The camera frame the passes were created for. The passes keep rendering for a frame after the * effect is removed from it, until it next updates, so they refer to it rather than to * {@link CameraFrameEffect#cameraFrame}. * * @type {import('../../render-passes/camera-frame.js').CameraFrame|null} * @private */ private _passesCameraFrame; /** * The fog the effect gives its camera while the haze is enabled, of the type the fog chunk of * the effect hazes the lit materials for. * * @type {FogParams} * @private */ private _hazeFog; /** * The camera given the fog of the haze, while it has it. * * @type {CameraComponent|null} * @private */ private _hazeCamera; /** * The fog the camera had before it was given the fog of the haze, to give back to it. * * @type {FogParams|null} * @private */ private _hazeCameraFog; /** * @type {FramePassDynamicSkyLighting|null} * @private */ private _lightingPass; /** * @type {RenderPassDynamicSkyClouds|null} * @private */ private _cloudPass; /** * @type {RenderTarget|null} * @private */ private _cloudTarget; /** @private */ private _cloudEncoded; /** * The cubemap the sky is rendered to for the lighting, its render targets, and the * environment atlas generated from it. * * @type {Texture|null} * @private */ private _lightingSource; /** * @type {RenderTarget[]} * @private */ private _faceTargets; /** * @type {Texture|null} * @private */ private _envAtlas; /** * With the lighting interpolated, the environment atlas the lighting is generated to, the one * it blends from, and the render target of the environment atlas of the scene, which shows the * blend. * * @type {Texture|null} * @private */ private _atlasLatest; /** * @type {Texture|null} * @private */ private _atlasPrevious; /** * @type {RenderTarget|null} * @private */ private _envAtlasTarget; /** * The pass rendering the sky to the faces of the lighting cubemap, created when first needed. * * @type {RenderPassShaderQuad|null} * @private */ private _bakePass; /** * The pass blending the lighting into the environment atlas, every frame of a blend, created * when first needed. * * @type {RenderPassShaderQuad|null} * @private */ private _blendPass; /** * The progress of the blend of the lighting, 0-1, where 1 has it done, and its duration in * seconds. * * @private */ private _blendWeight; /** @private */ private _blendDuration; /** * The time since the lighting was generated, and the time of this frame, in seconds. * * @private */ private _timeSinceBake; /** @private */ private _frameDt; /** * The shaders rendering the sky for the lighting, by their variant. * * @type {Map} * @private */ private _bakeShaders; /** * The shader blending the lighting. * * @type {Shader|null} * @private */ private _blendShader; /** * Whether the lighting is due to be generated, for a reason other than the thresholds. * * @private */ private _bakeRequested; /** * Whether the sun moved, or the settings of the sky changed, since the lighting was generated. * * @private */ private _bakeDue; /** * Whether the sky changed by a jump since the lighting was generated, see * LIGHTING_JUMP_THRESHOLDS. * * @private */ private _bakeJump; /** * Whether the lighting is generated this frame. * * @private */ private _bakePending; /** * The sky direction of the sun the lighting was last generated for. * * @private */ private _bakedSkyDir; /** * The direction of the moon, which lights the clouds at night, and the one the lighting was * last generated for. * * @private */ private _moonWorldDir; /** @private */ private _bakedMoonDir; /** * The settings of the sky the lighting was last generated for. * * @private */ private _bakedSettings; /** @private */ private _settings; /** * The distance the clouds drifted by since the lighting was generated, in pattern repeats. * * @private */ private _driftSinceBake; /** * Whether the sky has clouds. * * @type {boolean} * @private */ private get _hasClouds(); /** * Whether the volumetric clouds render to a texture of their own, which they do for the cameras * with a perspective projection. * * @type {boolean} * @private */ private get _cloudsBuffered(); /** * Requests the lighting of the scene to be generated from the sky again, before the next frame * renders. Use it when the lighting should follow a change it does not regenerate for on its * own, such as the drift of the clouds with {@link DynamicSkyEffect#lightingCloudThreshold} * disabled. */ bakeLighting(): void; /** * Gets the color of the sky in a direction - its linear radiance, without the sun disc, the * stars and the moon, as `dynamicSkyBase` of the shader chunk `dynamicSkyAtmospherePS` * evaluates it. Use it for lighting worked out on the CPU, such as the light the sky gives to * particles. It evaluates the sky as of the last {@link CameraFrame#update}. * * @param {Vec3} direction - The direction, in the world space. It does not need to be * normalized. * @param {Color} [color] - The color to receive the result. A new one is created if not given. * @returns {Color} The color of the sky. * @example * // the light of the sky from straight above * const zenith = sky.getSkyColor(Vec3.UP); */ getSkyColor(direction: Vec3, color?: Color): Color; /** @private */ private _onDeviceRestored; /** * Gives the camera the fog of the haze while the haze is enabled, in place of the fog it has, * which the fog chunk of the effect hazes the lit materials for. * * @private */ private _updateHazeFog; /** * Gives the camera given the fog of the haze its fog back - unless the camera was given another * fog since. * * @private */ private _restoreCameraFog; /** * Creates the material, the mesh instance and the node of the sky, on the first use. * * @private */ private _createSky; /** * Sets the value of a uniform the shaders of the sky read. * * @param {string} name - The name of the uniform. * @param {number|Float32Array|Texture} value - The value. * @private */ private _setSkyUniform; /** * Binds the values of the uniforms of the sky to the device scope, for the passes. * * @ignore */ _bindSkyUniforms(): void; /** * Applies the values of the uniforms of the sky to its material. * * @private */ private _applyToMaterial; /** * Computes the world space direction toward the sun. * * @param {Vec3} out - The vector to receive the result. * @returns {Vec3} The direction. * @private */ private _computeSunDir; /** * Computes the world space direction toward the moon, turned by the rotation of the sky. * * @param {Vec3} out - The vector to receive the result. * @returns {Vec3} The direction. * @private */ private _computeMoonDir; /** * Computes the scattering terms of the atmosphere which are the same for the whole sky. * * @private */ private _updateAtmosphere; /** * Computes the light of the sun and the moon - the light falling on the clouds, and the light * of the scene when there is one. * * @private */ private _updateLight; /** * Computes the values of the night sky and the moon. * * @private */ private _updateNight; /** * Computes the values of the clouds, and creates their noise on their first use. * * @private */ private _updateClouds; /** * Sets the defines of the material, selecting the clouds it renders. * * @private */ private _updateDefines; /** * Fills the settings the lighting depends on, to tell when they change. * * @param {Float32Array} out - The array to fill. * @private */ private _fillSettings; /** * Whether a setting the lighting depends on changed by more than a fraction since the lighting * was generated. * * @param {number} tolerance - The fraction. * @returns {boolean} True when a setting changed by more. * @private */ private _settingsChanged; /** * Creates the cubemap the sky is rendered to for the lighting, and the environment atlas, * when they do not exist or their size changed. * * @private */ private _createLightingTargets; /** * Creates an environment atlas, in the format and the layout the engine generates it in. * * @param {string} name - The name of the texture. * @param {number} size - The size of the atlas. * @returns {Texture} The atlas. * @private */ private _createAtlas; /** @private */ private _destroyInterpolationTargets; /** @private */ private _destroyLightingSource; /** * Returns the shader rendering the sky for the lighting, for the clouds and the encoding of * the lighting source. * * @returns {Shader} The shader. * @private */ private _getBakeShader; /** * Returns the shader blending the lighting, created on its first use. * * @returns {Shader} The shader. * @private */ private _getBlendShader; /** * Generates the lighting on the frames it is due, and blends it while it is interpolated. * Called by the pass generating the lighting. * * @ignore */ _updateLighting(): void; /** * Writes the blend of the lighting from its previous update to its latest one to the * environment atlas of the scene. * * @private */ private _blendLighting; /** * Generates the lighting of the scene from the sky: renders the sky to the faces of a cubemap, * and prefilters it to the environment atlas. Called by the pass generating the lighting. * * @ignore */ _bakeLighting(): void; } import { CameraFrameEffect } from '../../render-passes/camera-frame-effect.js'; import type { LightComponent } from '../../../framework/components/light/component.js'; import { Color } from '../../../core/math/color.js'; import { Vec3 } from '../../../core/math/vec3.js'; import type { GraphicsDevice } from '../../../platform/graphics/graphics-device.js';