Class DynamicEnvironmentMap

Used for rendering a dynamic environment map, to create realtime reflections For performance reasons, there is only one dynamic envmap per scene context

Constructors

Accessors

Methods

Constructors

  • Create a new dynamic environment map

    Parameters

    • gl: WebGL2RenderingContext

      GL context

    • size: number

      Size of each face of the cube map

    • position: XYZ

      Position of the center of the cube map, reflections will be rendered from here

    • far: number

    Returns DynamicEnvironmentMap

Accessors

  • set position(pos: XYZ): void
  • This is used to position the camera for creating the reflection map

    Parameters

    Returns void

  • get texture(): WebGLTexture
  • Get the texture of the environment cubemap

    Returns WebGLTexture

Methods

  • Update the environment map, by rendering the scene from the given position into the cubemap texture

    Parameters

    • gl: WebGL2RenderingContext
    • ctx: Context

      GSOTS Context

    Returns void