import { Color, Vector3 } from "@galacean/engine-math"; import { Background } from "./Background"; import { Engine } from "./Engine"; import { Entity } from "./Entity"; import { EngineObject } from "./base"; import { FogMode } from "./enums/FogMode"; import { AmbientOcclusion, DirectLight } from "./lighting"; import { AmbientLight } from "./lighting/AmbientLight"; import { PhysicsScene } from "./physics/PhysicsScene"; import { PostProcessManager } from "./postProcess"; import { ShaderData } from "./shader/ShaderData"; import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode"; import { ShadowResolution } from "./shadow/enum/ShadowResolution"; /** * Scene. */ export declare class Scene extends EngineObject { private static _fogColorProperty; private static _fogParamsProperty; private static _prefilterdDFGProperty; /** Scene name. */ name: string; /** Physics. */ readonly physics: PhysicsScene; /** If cast shadows. */ castShadows: boolean; /** The resolution of the shadow maps. */ shadowResolution: ShadowResolution; /** The splits of two cascade distribution. */ shadowTwoCascadeSplits: number; /** The splits of four cascade distribution. */ shadowFourCascadeSplits: Vector3; /** Max Shadow distance. */ shadowDistance: number; /** * Last shadow fade distance in percentage, range [0,1]. * @remarks Value 0 is used for no shadow fade. */ shadowFadeBorder: number; /** Post process manager. */ readonly postProcessManager: PostProcessManager; /** * Ambient Occlusion settings. * @remarks * Darkens areas where objects are close together to simulate natural light blocking, * such as corners, crevices, and contact points between surfaces. */ readonly ambientOcclusion: AmbientOcclusion; private _background; private _shaderData; private _shadowCascades; private _ambientLight; private _fogMode; private _fogColor; private _fogStart; private _fogEnd; private _fogDensity; private _fogParams; private _isActive; private _sun; private _enableTransparentShadow; /** * Whether the scene is active. */ get isActive(): boolean; set isActive(value: boolean); /** * Scene-related shader data. */ get shaderData(): ShaderData; /** * The background of the scene. */ get background(): Background; /** * Number of cascades to use for directional light shadows. */ get shadowCascades(): ShadowCascadesMode; set shadowCascades(value: ShadowCascadesMode); /** * Ambient light. */ get ambientLight(): AmbientLight; set ambientLight(value: AmbientLight); /** * Fog mode. * @remarks * If set to `FogMode.None`, the fog will be disabled. * If set to `FogMode.Linear`, the fog will be linear and controlled by `fogStart` and `fogEnd`. * If set to `FogMode.Exponential`, the fog will be exponential and controlled by `fogDensity`. * If set to `FogMode.ExponentialSquared`, the fog will be exponential squared and controlled by `fogDensity`. */ get fogMode(): FogMode; set fogMode(value: FogMode); /** * Fog color. */ get fogColor(): Color; set fogColor(value: Color); /** * Fog start. */ get fogStart(): number; set fogStart(value: number); /** * Fog end. */ get fogEnd(): number; set fogEnd(value: number); /** * Fog density. */ get fogDensity(): number; set fogDensity(value: number); /** * Count of root entities. */ get rootEntitiesCount(): number; /** * Root entity collection. */ get rootEntities(): Readonly; /** * Sun light source. * @remarks If set this to null, scene will use the brightest directional light. */ get sun(): DirectLight | null; set sun(light: DirectLight | null); /** * Whether to enable transparent shadow. */ get enableTransparentShadow(): boolean; set enableTransparentShadow(value: boolean); /** * Create scene. * @param engine - Engine * @param name - Name */ constructor(engine: Engine, name?: string); /** * Create root entity. * @param name - Entity name * @returns Entity */ createRootEntity(name?: string): Entity; /** * Append an entity. * @param entity - The root entity to add */ addRootEntity(entity: Entity): void; /** * Append an entity. * @param index - specified index * @param entity - The root entity to add */ addRootEntity(index: number, entity: Entity): void; /** * Remove an entity. * @param entity - The root entity to remove */ removeRootEntity(entity: Entity): void; /** * Get root entity from index. * @param index - Index * @returns Entity */ getRootEntity(index?: number): Entity | null; /** * Find entity globally by name. * @param name - Entity name * @returns Entity */ findEntityByName(name: string): Entity | null; /** * Find entity globally by name,use ‘/’ symbol as a path separator. * @param path - Entity's path * @returns Entity */ findEntityByPath(path: string): Entity | null; private _computeLinearFogParams; private _computeExponentialFogParams; private _getSunlight; }