Creates a new WebGL1Renderer
The 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.
Defines whether the renderer should automatically clear its output before rendering.
If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.
If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.
If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.
The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.
Debug configurations.
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 is LinearEncoding.
Defines whether the renderer should sort objects. Default is true.
Tells the renderer to clear its color, depth or stencil drawing buffer(s). Arguments default to true
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.
Specifies the pixel offset from which to copy out of the framebuffer.
Specifies the destination texture.
Specifies the destination mipmap level of the texture.
Copies srcTexture to the specified level of dstTexture, offset by the input position.
Specifies the pixel offset into the dstTexture where the copy will occur.
Specifies the source texture.
Specifies the destination texture.
Specifies the destination mipmap level of the texture.
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.
Specifies the destination mipmap level of the texture.
Returns the current active cube face.
Returns the current active mipmap level.
Returns a float with the current clear alpha. Ranges from 0 to 1.
Return the WebGL context.
Returns the current render target. If no render target is set, null is returned.
Returns true if scissor test is enabled; returns false otherwise.
Render a scene or an object using a camera. The render is done to a previously specified .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..
Can be used to reset the internal WebGL state.
A build in that can be used instead of requestAnimationFrame. For WebXR projects this must be used.
The 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.
Sets the custom opaque sort 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.
Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of WebGLCubeRenderTarget.
Specifies the active mipmap level.
Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
Resizes the output canvas to (width, height), and also sets the viewport to fit that size, starting in (0, 0).
Sets the custom transparent sort for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
Generated using TypeDoc
Since r118 WebGLRenderer automatically uses a WebGL 2 rendering context. When upgrading an existing project to => r118, applications might break because of two reasons: Custom shader code needs to be GLSL 3.0 conform. WebGL 1 extension checks have to be changed.
See the ngx3js docs page for details. See the ngx renderer page for a live demo.