parameters is an optional object with properties defining the renderer's behaviour. The constructor also accepts no parameters at all. In all cases, it will assume sane defaults when parameters are missing.
Optional
parameters: WebGLRendererParametersDefines whether the renderer should automatically clear its output before rendering.
true
If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.
true
If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.
true
If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.
true
[]
Debug configurations.
A Canvas where the renderer draws its output. This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page.
document.createElementNS( 'http://www.w3.org/1999/xhtml', 'canvas' )
false
Default is LinearEncoding.
THREE.LinearEncoding
false
Use .shadowMap.cullFace instead.
Use .shadowMap.enabled instead.
Use .shadowMap.type instead.
Defines whether the renderer should sort objects. Default is true.
true
THREE.NoToneMapping
1
Use .xr instead.
Use .setAnimationLoop() instead.
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.
Copies the pixels of a texture in the bounds sourceBox in the desination texture starting from the given position.
Specifies the bounds
Specifies the pixel offset into the dstTexture where the copy will occur.
Specifies the source texture.
Specifies the destination texture.
Optional
level: numberSpecifies the destination mipmap level of the texture.
Use .setScissorTest() instead.
Use .getRenderTarget() instead.
Use .capabilities.getMaxAnisotropy() instead.
Use .capabilities.precision instead.
Returns the current render target. If no render target is set, null is returned.
Optional
activeCubeFaceIndex: numberRender a scene or an object using a camera. The render is done to a previously specified WebGLRenderTarget#renderTarget .renderTarget set by calling .setRenderTarget or to the canvas as usual.
By default render buffers are cleared before rendering but you can prevent this by setting the property autoClear to false. If you want to prevent only certain buffers being cleared you can set either the autoClearColor, autoClearStencil or autoClearDepth properties to false. To forcibly clear one ore more buffers call .clear.
Use .state.reset() instead.
A build in function that can be used instead of requestAnimationFrame. For WebXR projects this function must be used.
The function will be called every available frame. If null
is passed it will stop any already ongoing animation.
Sets the clear color, using color for the color and alpha for the opacity.
Optional
alpha: numberSets the custom opaque sort function for the WebGLRenderLists. Pass null to use the default painterSortStable function.
Sets the active render target.
The renderTarget that needs to be activated. When null
is given, the canvas is set as the active render target instead.
Optional
activeCubeFace: numberSpecifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of WebGLCubeRenderTarget.
Optional
activeMipmapLevel: numberSpecifies the active mipmap level.
Sets the custom transparent sort function for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
Use .extensions.get( 'EXT_blend_minmax' ) instead.
Use .extensions.get( 'WEBGL_compressed_texture_pvrtc' ) instead.
Use .extensions.get( 'WEBGL_compressed_texture_s3tc' ) instead.
Use .extensions.get( 'OES_texture_float' ) instead.
Use .extensions.get( 'OES_texture_half_float' ) instead.
Use .extensions.get( 'ANGLE_instanced_arrays' ) instead.
Use .extensions.get( 'OES_standard_derivatives' ) instead.
Use .capabilities.vertexTextures instead.
Generated using TypeDoc
The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it. This renderer has way better performance than CanvasRenderer.
see https://github.com/mrdoob/three.js/blob/master/src/renderers/WebGLRenderer.js|src/renderers/WebGLRenderer.js