import { Mesh, MeshBasicNodeMaterial, SphereGeometry } from 'three/webgpu'; import { DIVEComponent } from '../../engine/component/Component.ts'; /** @experimental See {@link GroundProjectionComponent}. */ export type DIVEGroundProjectionSettings = { /** * How far above the ground the camera that took the image was, in meters. * A larger value magnifies the ground part of the image. * * @default 1.5 */ height: number; /** * The radius of the dome, in meters. The viewing camera has to stay inside, * and its far plane has to reach the dome. * * @default 50 */ radius: number; }; /** @experimental See {@link GroundProjectionComponent}. */ export declare const DIVEGroundProjectionDefaultSettings: DIVEGroundProjectionSettings; /** * An equirectangular image put on a dome with a flat floor. * * A background at infinity has no ground a model could stand on: its floor * slides along under the model as the camera moves. Projecting the lower half * of the image onto a plane gives it one, so a product lit by an HDR image also * appears to stand in it. The floor lies at the owner's origin. * * The dome is unlit and writes no depth, so whatever lies on its floor -- such * as a {@link SoftShadowComponent} -- is drawn on top of it. It sits on * {@link BACKGROUND_LAYER_MASK}, which keeps it out of bounds, exports, picking * and shadow bakes. * * The image is taken by URL. A URL other users have as well, such as the * scene's image based light, is loaded once and shares one texture. * {@link dispose} gives it back. * * @experimental The projection has only been checked on a few HDR images; its * API and defaults may change without a major release. * * @module */ export declare class GroundProjectionComponent extends DIVEComponent { readonly isGroundProjectionComponent: true; private _mesh; private _height; private _radius; private _image; private _texture; constructor(); /** The dome the image is drawn on. */ get mesh(): Mesh; /** * The URL of the image asked for, `null` for none. A new one shows up here * at once, before it has loaded. */ get image(): string | null; /** How far above the ground the image was taken, in meters. */ get height(): number; /** The radius of the dome, in meters. */ get radius(): number; /** Whether the dome is drawn. */ get visible(): boolean; /** * Puts an equirectangular image on the dome. The previous one stays until * the new one has loaded. * * @param url - The URL of the image, or `null` for a white dome. * @returns Resolves once the image has loaded; it is drawn from the next * render on. */ setImage(url: string | null): Promise; /** * @param height - How far above the ground the image was taken, in meters. */ setHeight(height: number): this; /** * @param radius - The radius of the dome, in meters. */ setRadius(radius: number): this; /** * Takes on whatever the settings carry and rebuilds the dome once. * * @param settings - Height and radius. */ applySettings(settings: Partial): this; /** * @param visible - Whether the dome is drawn. */ setVisibility(visible: boolean): this; /** Frees the dome and gives back its image. */ dispose(): void; /** * Requests the source's image again, which shares its texture. To wait * for it, await `setImage(copy.image)`. * * @param source - The component to copy from. */ copy(source: this): this; /** * Puts the loaded image on the dome, right before it is drawn. * * Rebuilds the material only when the image changed: with or without a * map is a different shader. */ private _showImage; /** * A sphere whose lower half is pulled flat onto a floor. * * Every vertex keeps its direction from the centre, so the image still * reads as seen from where it was taken; only its distance changes. Below a * blend band the vertex lands on the plane `height` under the centre, and * the band smooths the crease between floor and wall. Mirrored along Z, * which also turns the faces inward, to match the sky the renderer * captures the image based light from. */ private _buildGeometry; }