import { Scene } from "@babylonjs/core/scene"; import { IScript } from "../script"; import { IApplyRenderingConfigurationOptions } from "../rendering/tools"; /** * Defines the possible output type of a script. * `default` is a class that will be instantiated with the object as parameter. * `onStart` is a function that will be called once before the first render passing the reference to the object the script is attached to. * `onUpdate` is a function that will be called every frame passing the reference to the object the script is attached to */ export type ScriptMap = Record IScript; } & IScript>; /** * Defines the overall desired quality of the scene. * In other words, defines the quality of textures that will be loaded in terms of dimensions. * The editor computes automatic "high (untouched)", "medium (half)", and "low (quarter)" quality levels for textures. * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene * especially on mobiles where memory is limited. */ export type SceneLoaderQualitySelector = "very-low" | "low" | "medium" | "high"; export type SceneLoaderOptions = { /** * Defines the quality of the scene. * This will affect the quality of textures that will be loaded in terms of dimensions. * The editor computes automatic "high (untouched)", "medium (half)", and "low (quarter)" quality levels for textures. * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene * especially on mobiles where memory is limited. The "very-low" quality level is even more aggressive with shadows quality. */ quality?: SceneLoaderQualitySelector; /** * Same as "quality" but only applied to textures. If set, this has priority over "quality". */ texturesQuality?: SceneLoaderQualitySelector; /** * Same as "quality" but only applied to shadows. If set, this has priority over "quality". */ shadowsQuality?: SceneLoaderQualitySelector; /** * Sames as "quality" but only applied to LODs. If set, this has priority over "quality". * This will affect the screen coverage or distance used to switch between LODs. The "very-low" quality level is even more aggressive with LODs. */ lodsQuality?: SceneLoaderQualitySelector; /** * Defines the optional configuration to apply when applying the rendering configuration for a camera. * This allows to selectively disable some post-processes when applying the rendering configuration for a camera. * This is particularly useful for when your game provides options to enable/disable post-processes. */ postProcessConfiguration?: IApplyRenderingConfigurationOptions; /** * Defines the function called to notify the loading progress in interval [0, 1] */ onProgress?: (value: number) => void; /** * Defines whether to skip the preloading of assets linked to scripts. * To ensure all resources are loaded before resolving loadScene promise, all resources linked to scripts are preloaded after the scene is loaded. * To bypass this behavior, you can set this flag to true. * @default false */ skipAssetsPreload?: boolean; }; declare module "@babylonjs/core/scene" { interface Scene { loadingQuality: SceneLoaderQualitySelector; loadingTexturesQuality: SceneLoaderQualitySelector; loadingShadowsQuality: SceneLoaderQualitySelector; loadingLodsQuality: SceneLoaderQualitySelector; } } export declare function loadScene(rootUrl: any, sceneFilename: string, scene: Scene, scriptsMap: ScriptMap, options?: SceneLoaderOptions): Promise;