API

Class RenderTargetWrapper

Wrapper around a render target (either single or multi textures)

Hierarchy (View Summary)

Index
depthReadOnly: boolean = false

Indicates if the depth texture is in read-only mode (may allow some optimizations in WebGPU)

disableAutomaticMSAAResolve: boolean = false

Sets this property to true to disable the automatic MSAA resolve that happens when the render target wrapper is unbound (default is false)

label?: string

Gets or sets the label of the render target wrapper (optional, for debugging purpose)

resolveMSAAColors: boolean = true

Indicates if MSAA color texture(s) should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is true) Note that you can trigger a MSAA resolve at any time by calling resolveMSAATextures()

resolveMSAADepth: boolean = false

Indicates if MSAA depth texture should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is false)

resolveMSAAStencil: boolean = false

Indicates if MSAA stencil texture should be resolved when a resolve occur (either automatically by the engine or manually by the user) (default is false)

stencilReadOnly: boolean = false

Indicates if the stencil texture is in read-only mode (may allow some optimizations in WebGPU)

  • Creates the depth/stencil texture

    Parameters

    • comparisonFunction: number = 0

      Comparison function to use for the texture

    • bilinearFiltering: boolean = true

      true if bilinear filtering should be used when sampling the texture

    • generateStencil: boolean = false

      Not used anymore. "format" will be used to determine if stencil should be created

    • samples: number = 1

      sample count to use when creating the texture (default: 1)

    • format: number = Constants.TEXTUREFORMAT_DEPTH32_FLOAT

      format of the depth texture (default: Constants.TEXTUREFORMAT_DEPTH32_FLOAT)

    • Optionallabel: string

      defines the label to use for the texture (for debugging purpose only)

    Returns InternalTexture

    the depth/stencil created texture

  • Disposes the whole render target wrapper

    Parameters

    • disposeOnlyFramebuffers: boolean = false

      true if only the frame buffers should be released (used for the WebGL engine). If false, all the textures will also be released

    Returns void

  • Gets the base array layer of a texture in the textures array This is an number that is calculated based on the layer and face indices set for this texture at that index

    Parameters

    • index: number

      The index of the texture in the textures array to get the base array layer for

    Returns number

    the base array layer of the texture at the given index

  • Sets the layer and face indices of a texture in the textures array that should be bound to each color attachment

    Parameters

    • index: number = 0

      The index of the texture in the textures array to modify

    • Optionallayer: number

      The layer of the texture to be set

    • Optionalface: number

      The face of the texture to be set

    Returns void

  • Sets the layer and face indices of every render target texture bound to each color attachment

    Parameters

    • layers: number[]

      The layers of each texture to be set

    • faces: number[]

      The faces of each texture to be set

    Returns void

  • Sets the sample count of the render target

    Parameters

    • value: number

      sample count

    • initializeBuffers: boolean = true

      If set to true, the engine will make an initializing call to drawBuffers (only used when isMulti=true).

    • force: boolean = false

      true to force calling the update sample count engine function even if the current sample count is equal to value

    Returns number

    the sample count that has been set