Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WebGLRenderer

The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it. This renderer has way better performance than CanvasRenderer.

See the ngx3js docs page for details. See the ngx renderer page for a live demo.

see src/renderers/WebGLRenderer.js

Hierarchy

Index

Constructors

constructor

Properties

autoClear

autoClear: boolean

Defines whether the renderer should automatically clear its output before rendering.

default

true

autoClearColor

autoClearColor: boolean

If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.

default

true

autoClearDepth

autoClearDepth: boolean

If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.

default

true

autoClearStencil

autoClearStencil: boolean

If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.

default

true

capabilities

capabilities: WebGLCapabilities

clippingPlanes

clippingPlanes: any[]
default

[]

context

The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.

debug

debug: WebGLDebug

Debug configurations.

default

{ checkShaderErrors: true }

domElement

domElement: HTMLCanvasElement

A Canvas where the renderer draws its output. This is automatically created by the renderer in the constructor (if not provided already) : this; you just need to add it to your page.

default

document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' )

extensions

extensions: WebGLExtensions

info

info: WebGLInfo

localClippingEnabled

localClippingEnabled: boolean
default

false

outputEncoding

outputEncoding: TextureEncoding

Default is LinearEncoding.

default

THREE.LinearEncoding

physicallyCorrectLights

physicallyCorrectLights: boolean
default

false

pixelRatio

pixelRatio: number

properties

properties: WebGLProperties

renderLists

renderLists: WebGLRenderLists

shadowMap

shadowMap: WebGLShadowMap

sortObjects

sortObjects: boolean

Defines whether the renderer should sort objects. Default is true.

default

true

state

state: WebGLState

toneMapping

toneMapping: ToneMapping
default

THREE.NoToneMapping

toneMappingExposure

toneMappingExposure: number
default

1

xr

Methods

clear

  • clear(color?: boolean, depth?: boolean, stencil?: boolean): void
  • Tells the renderer to clear its color, depth or stencil drawing buffer(s). Arguments default to true

    Parameters

    • Optional color: boolean
    • Optional depth: boolean
    • Optional stencil: boolean

    Returns void

clearColor

  • clearColor(): void

clearDepth

  • clearDepth(): void

clearStencil

  • clearStencil(): void

clearTarget

  • clearTarget(renderTarget: I3JS.WebGLRenderTarget, color: boolean, depth: boolean, stencil: boolean): void

compile

copyFramebufferToTexture

  • Copies a region of the currently bound framebuffer into the selected mipmap level of the selected texture. This region is defined by the size of the destination texture's mip level, offset by the input position.

    Parameters

    • position: I3JS.Vector2

      Specifies the pixel offset from which to copy out of the framebuffer.

    • texture: I3JS.Texture

      Specifies the destination texture.

    • Optional level: number

      Specifies the destination mipmap level of the texture.

    Returns void

copyTextureToTexture

  • Copies srcTexture to the specified level of dstTexture, offset by the input position.

    Parameters

    • position: I3JS.Vector2

      Specifies the pixel offset into the dstTexture where the copy will occur.

    • srcTexture: I3JS.Texture

      Specifies the source texture.

    • dstTexture: I3JS.Texture

      Specifies the destination texture.

    • Optional level: number

      Specifies the destination mipmap level of the texture.

    Returns void

copyTextureToTexture3D

dispose

  • dispose(): void

forceContextLoss

  • forceContextLoss(): void

forceContextRestore

  • forceContextRestore(): void

getActiveCubeFace

  • getActiveCubeFace(): number

getActiveMipmapLevel

  • getActiveMipmapLevel(): number

getClearAlpha

  • getClearAlpha(): number

getClearColor

getContext

getContextAttributes

  • getContextAttributes(): any

getCurrentViewport

getDrawingBufferSize

getPixelRatio

  • getPixelRatio(): number

getRenderTarget

getScissor

getScissorTest

  • getScissorTest(): boolean

getSize

getViewport

initTexture

  • Initializes the given texture. Can be used to preload a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead).

    Parameters

    Returns void

readRenderTargetPixels

render

renderBufferDirect

resetState

  • resetState(): void

setAnimationLoop

setClearAlpha

  • setClearAlpha(alpha: number): void

setClearColor

setDrawingBufferSize

  • setDrawingBufferSize(width: number, height: number, pixelRatio: number): void

setOpaqueSort

  • setOpaqueSort(method: (a: any, b: any) => number): void
  • Sets the custom opaque sort for the WebGLRenderLists. Pass null to use the default painterSortStable function.

    Parameters

    • method: (a: any, b: any) => number
        • (a: any, b: any): number
        • Parameters

          • a: any
          • b: any

          Returns number

    Returns void

setPixelRatio

  • setPixelRatio(value: number): void

setRenderTarget

setScissor

  • setScissor(x: number | I3JS.Vector4, y?: number, width?: number, height?: number): void

setScissorTest

  • setScissorTest(enable: boolean): void

setSize

  • setSize(width: number, height: number, updateStyle?: boolean): void

setTransparentSort

  • setTransparentSort(method: (a: any, b: any) => number): void
  • Sets the custom transparent sort for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.

    Parameters

    • method: (a: any, b: any) => number
        • (a: any, b: any): number
        • Parameters

          • a: any
          • b: any

          Returns number

    Returns void

setViewport

  • setViewport(x: number | I3JS.Vector4, y?: number, width?: number, height?: number): void

Generated using TypeDoc