rememberHdrEnvironment
Builds an Environment from an equirectangular HDR image instead of pre-baked KTX — no cmgen step, just ship the .hdr. The reflection cubemap and skybox are prefiltered on the GPU at load via IBLPrefilterContext's EquirectangularToCubemap and SpecularFilter.
rememberFilamentScene {
Environment(rememberHdrEnvironment { Res.readBytes("env/lobby.hdr") })
GltfInstance(asset = duck)
}Tradeoff vs. rememberKtxEnvironment: there's no baked diffuse irradiance (cmgen's spherical harmonics). Filament approximates diffuse from the reflection's lowest mip — visibly lower quality. Prefer KTX when you can bake offline; use this for raw .hdr workflows. The prefilter runs on the GPU at load, so the first frames render before it lands.
Parameters
Internal format for the decoded HDR equirect texture.
Reloads when this changes. Defaults to Unit for static assets.
Invoked once if hdr throws or the bytes can't be decoded as HDR.
Engine the textures are allocated on. Defaults to the engine in the current composition scope, which only exists inside rememberFilamentScene { }.
Loader for the equirectangular HDR bytes (2:1 aspect).