This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture.

Remarks

This allows different levels of blur to be quickly accessed based on material roughness Unlike a traditional mipmap chain, it only goes down to the LOD_MIN level (above), and then creates extra even more filtered 'mips' at the same LOD_MIN resolution, associated with higher roughness levels In this way we maintain resolution to smoothly interpolate diffuse lighting while limiting sampling computation.

See

Constructors

  • This constructor creates a new PMREMGenerator.

    Parameters

    Returns PMREMGenerator

Methods

  • Pre-compiles the cubemap shader

    Returns void

    Remarks

    You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.

  • Pre-compiles the equirectangular shader

    Returns void

    Remarks

    You can get faster start-up by invoking this method during your texture's network fetch for increased concurrency.

  • Frees the GPU-related resources allocated by this instance

    Returns void

    Remarks

    Call this method whenever this instance is no longer used in your app.

  • Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low

    Parameters

    • scene: Scene

      The given scene.

    • Optional sigma: number

      Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default 0.

    • Optional near: number

      The near plane value. Default 0.1.

    • Optional far: number

      The far plane value. Default 100.

    Returns WebGLRenderTarget<Texture>

    Remarks

    Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin).