Function loadEnvironment
-
loadEnvironment(
scene: SceneContext,
url: string,
options: {
brdfUrl: string;
groundTextureUrl?: string;
skipGround?: boolean;
skipSkybox?: boolean;
skyboxSize?: number;
skyboxUrl?: string;
},
): Promise<EnvironmentTextures>Parameters
- scene: SceneContext
- url: string
- options: {
brdfUrl: string;
groundTextureUrl?: string;
skipGround?: boolean;
skipSkybox?: boolean;
skyboxSize?: number;
skyboxUrl?: string;
}-
brdfUrl: string
-
OptionalgroundTextureUrl?: string -
OptionalskipGround?: boolean -
OptionalskipSkybox?: boolean -
OptionalskyboxSize?: numberSkybox size matching BJS createDefaultEnvironment skyboxSize option (default 20).
-
OptionalskyboxUrl?: stringURL for the skybox texture. Extension determines loading strategy:
.dds: loads a DDS cube skybox (e.g. BJS CDN backgroundSkybox.dds). Tree-shaken when unused..env: reuses the already-loaded specular cubemap as an HDR skybox (like BJScreateDefaultSkybox). Omit for the default flat-color background. UseskipSkyboxto disable skybox entirely.
-
Returns Promise<EnvironmentTextures>
Load a Babylon.js .env environment file and upload cubemap + BRDF LUT to GPU. BRDF LUT is decoded from a pre-baked RGBD PNG (matching BJS's embedded environmentBRDFTexture) for pixel-perfect parity.