@@ -41,17 +41,27 @@ export type ScriptMap = Record<
4141 * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene
4242 * especially on mobiles where memory is limited.
4343 */
44- export type SceneLoaderQualitySelector = "low" | "medium" | "high" ;
44+ export type SceneLoaderQualitySelector = "very-low" | " low" | "medium" | "high" ;
4545
4646export type SceneLoaderOptions = {
4747 /**
4848 * Defines the quality of the scene.
4949 * This will affect the quality of textures that will be loaded in terms of dimensions.
5050 * The editor computes automatic "high (untouched)", "medium (half)", and "low (quarter)" quality levels for textures.
5151 * Using "medium" or "low" quality levels will reduce the memory usage and improve the performance of the scene
52- * especially on mobiles where memory is limited.
52+ * especially on mobiles where memory is limited. The "very-low" quality level is even more aggressive with shadows quality.
5353 */
5454 quality ?: SceneLoaderQualitySelector ;
55+
56+ /**
57+ * Same as "quality" but only applied to textures. If set, this has priority over "quality".
58+ */
59+ texturesQuality ?: SceneLoaderQualitySelector ;
60+ /**
61+ * Same as "quality" but only applied to shadows. If set, this has priority over "quality".
62+ */
63+ shadowsQuality ?: SceneLoaderQualitySelector ;
64+
5565 /**
5666 * Defines the function called to notify the loading progress in interval [0, 1]
5767 */
@@ -62,12 +72,17 @@ declare module "@babylonjs/core/scene" {
6272 // eslint-disable-next-line @typescript-eslint/naming-convention
6373 interface Scene {
6474 loadingQuality : SceneLoaderQualitySelector ;
75+ loadingTexturesQuality : SceneLoaderQualitySelector ;
76+ loadingShadowsQuality : SceneLoaderQualitySelector ;
6577 }
6678}
6779
6880export async function loadScene ( rootUrl : any , sceneFilename : string , scene : Scene , scriptsMap : ScriptMap , options ?: SceneLoaderOptions ) {
6981 scene . loadingQuality = options ?. quality ?? "high" ;
7082
83+ scene . loadingTexturesQuality = options ?. texturesQuality ?? scene . loadingQuality ;
84+ scene . loadingShadowsQuality = options ?. shadowsQuality ?? scene . loadingQuality ;
85+
7186 await AppendSceneAsync ( `${ rootUrl } ${ sceneFilename } ` , scene , {
7287 pluginExtension : ".babylon" ,
7388 onProgress : ( event ) => {
0 commit comments