Class RenderTexture

Render target specialization that allows you to render into one or multiple textures. Such textures can then be used in other operations as GPU program input.

Sim thread only. Retrieve core implementation from GetCore() for core thread only functionality.

Hierarchy (view full)

Constructors

  • Creates a new 2D render texture.

    Parameters

    • options:
          | {
              createFlags?: EnumValue<RenderTextureCreateFlag, number>;
              depthStencilFormat?: EnumValue<PixelFormat, number>;
              dpiScale?: number;
              format: EnumValue<PixelFormat, number>;
              height: number;
              numSamples?: number;
              width: number;
          }
          | {
              colorSurface: Texture;
              dpiScale?: number;
              isClearingOnCreate?: boolean;
          }
          | {
              colorSurface: Texture;
              depthStencilSurface: Texture;
              dpiScale?: number;
              isClearingOnCreate?: boolean;
          }
          | {
              colorSurfaces: readonly Texture[];
              dpiScale?: number;
              isClearingOnCreate?: boolean;
          }
          | {
              colorSurfaces: readonly Texture[];
              depthStencilSurface: Texture;
              dpiScale?: number;
              isClearingOnCreate?: boolean;
          }

      Options object for the function call.

    • OptionalisInternalConstructor: boolean

    Returns RenderTexture

Accessors

  • get colorSurface(): Texture
  • Returns the primary color surface that contains rendered color data.

    Returns Texture

  • get depthStencilSurface(): Texture
  • Returns the depth/stencil surface that contains rendered depth and stencil data.

    Returns Texture

  • get gammaCorrection(): boolean
  • Returns boolean

  • get height(): number
  • Height of the render target, in pixels.

    Returns number

  • get priority(): number
  • Controls in what order is the render target rendered to compared to other render targets. Targets with higher priority will be rendered before ones with lower priority.

    Returns number

  • set priority(value): void
  • Parameters

    • value: number

    Returns void

  • get sampleCount(): number
  • Controls how many samples are used for multisampling. (0 or 1 if multisampling is not used).

    Returns number

  • get width(): number
  • Width of the render target, in pixels.

    Returns number