RendererConfiguration Class

Module: Postprocessing

Renderer configuration stores all the WebGL renderer related parameters.

Constructor

RendererConfiguration

(
  • options
)

Parameters:

  • options Object

    Options object with the values to be used in the rendere configuration, values not specified are set to default.

Methods

createRenderer

() WebGLRenderer

Create a THREE renderer object based on the renderer configuration.

Returns:

WebGLRenderer:

Renderer created from the configuration.

Properties

@stencil

Boolean

Whether the drawing buffer has a stencil buffer of at least 8 bits.

alpha

Boolean

Whether the canvas contains an alpha (transparency) buffer or not.

antialiasing

Boolean

Antialiasing flag.

Default: false

autoClear

Boolean

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

autoClearColor

Boolean

Defines whether the renderer should clear the color buffer.

autoClearDepth

Boolean

Defines whether the renderer should clear the depth buffer.

autoClearStencil

Boolean

Defines whether the renderer should clear the stencil buffer.

backend

Number

Prefered redering backend API to use if available.

If the selected backend is not available it defaults to WebGL.

Shader code might not be cross compatible between rendering backends.

backgroundColor

String

Canvas background color, optional only used if specified.

Different from the clear color used to clear the render target.

checkShaderErrors

Boolean

Defines whether material shader programs are checked for errors during compilation and linkage process.

gammaFactor

Number

Gamma factor applied to the image.

logarithmicDepthBuffer

Boolean

Whether to use a logarithmic depth buffer. It may be neccesary to use this if dealing with huge differences in scale in a single scene.

maxMorphNormals

Number

The maximum number of MorphNormals allowed in a shader.

maxMorphTargets

Number

The maximum number of MorphTargets allowed in a shader.

physicallyCorrectLights

Boolean

Whether to use physically correct lighting mode.

powerPreference

String

Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. Can be "high-performance", "low-power" or "default".

precision

String

Shader precision. Can be "highp", "mediump" or "lowp". Defaults to "highp" if supported by the device.

premultipliedAlpha

Boolean

Whether the renderer will assume that colors have premultiplied alpha.

preserveDrawingBuffer

Boolean

Whether to preserve the buffers until manually cleared or overwritten.

shadows

Boolean

If true the program is rendered with shadows.

Default: true

shadowsAutoUpdate

Boolean

Enables automatic updates to the shadows in the scene.

If you do not require dynamic lighting / shadows, you may set this to false.

Use renderer.shadowMap.needsUpdate to update the shadow map.

shadowsType

Number

Shadow map filtering type.

Default: PCFSoftShadowMap

sortObjects

Boolean

If true the renderer sorts the objects from back to front for rendering.

Important if using multiple transparent objects.

toneMapping

Number

Tonemapping can be used to remap the color of the image to a different set giving the scene a different color mood and/or dynamic color based on global luminosity.

Default: NoToneMapping

toneMappingExposure

Number

Exposure level of tone mapping.

Attributes

WEBGL

Number static

Use WebGL 1.0 to render data.

Most devices fully support WebGL 1.0 at this point, should work for any type of device.

WEBGL2

Number static

Use WebGL 2.0 to render data, should be faster for some types of data.

Additinal features of GLSL can be used in WebGL 2.0. Most mobile device still dont support WebGL 2.0.