API

Function loadEnvironment

  • 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.

    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?: number

        Skybox size matching BJS createDefaultEnvironment skyboxSize option (default 20).

      • OptionalskyboxUrl?: string

        URL 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 BJS createDefaultSkybox). Omit for the default flat-color background. Use skipSkybox to disable skybox entirely.

    Returns Promise<EnvironmentTextures>