|
@@ -271,35 +271,35 @@
|
|
|
|
|
|
<h2>Methods</h2>
|
|
|
|
|
|
- <h3>[method:null clear]( [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] )</h3>
|
|
|
+ <h3>[method:undefined clear]( [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] )</h3>
|
|
|
<p>
|
|
|
Tells the renderer to clear its color, depth or stencil drawing buffer(s).
|
|
|
This method initializes the color buffer to the current clear color value.<br />
|
|
|
Arguments default to *true*.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null clearColor]( )</h3>
|
|
|
+ <h3>[method:undefined clearColor]( )</h3>
|
|
|
<p>Clear the color buffer. Equivalent to calling [page:WebGLRenderer.clear .clear]( true, false, false ).</p>
|
|
|
|
|
|
- <h3>[method:null clearDepth]( )</h3>
|
|
|
+ <h3>[method:undefined clearDepth]( )</h3>
|
|
|
<p>Clear the depth buffer. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, true, false ).</p>
|
|
|
|
|
|
- <h3>[method:null clearStencil]( )</h3>
|
|
|
+ <h3>[method:undefined clearStencil]( )</h3>
|
|
|
<p>Clear the stencil buffers. Equivalent to calling [page:WebGLRenderer.clear .clear]( false, false, true ).</p>
|
|
|
|
|
|
- <h3>[method:null compile]( [param:Object3D scene], [param:Camera camera] )</h3>
|
|
|
+ <h3>[method:undefined compile]( [param:Object3D scene], [param:Camera camera] )</h3>
|
|
|
<p>Compiles all materials in the scene with the camera. This is useful to precompile shaders before the first rendering.</p>
|
|
|
|
|
|
- <h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
|
|
|
+ <h3>[method:undefined copyFramebufferToTexture]( [param:Vector2 position], [param:Texture texture], [param:Number level] )</h3>
|
|
|
<p>Copies pixels from the current WebGLFramebuffer into a 2D texture. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/copyTexImage2D WebGLRenderingContext.copyTexImage2D].</p>
|
|
|
|
|
|
- <h3>[method:null copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
|
|
|
+ <h3>[method:undefined copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
|
|
|
<p>Copies all pixels of a texture to an existing texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D WebGLRenderingContext.texSubImage2D].</p>
|
|
|
|
|
|
- <h3>[method:null copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
|
|
|
+ <h3>[method:undefined copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
|
|
|
<p>Copies the pixels of a texture in the bounds '[page:Box3 sourceBox]' in the destination texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D WebGL2RenderingContext.texSubImage3D].</p>
|
|
|
|
|
|
- <h3>[method:null dispose]( )</h3>
|
|
|
+ <h3>[method:undefined dispose]( )</h3>
|
|
|
<p>Dispose of the current rendering context.</p>
|
|
|
|
|
|
<h3>[method:Object extensions.get]( [param:String extensionName] )</h3>
|
|
@@ -388,20 +388,20 @@
|
|
|
Returns the viewport.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null initTexture]( [param:Texture texture] )</h3>
|
|
|
+ <h3>[method:undefined initTexture]( [param:Texture texture] )</h3>
|
|
|
<p> Initializes the given texture. Useful for preloading a texture rather than waiting until first render (which can cause noticeable lags due to decode and GPU upload overhead).</p>
|
|
|
|
|
|
- <h3>[method:null resetGLState]( )</h3>
|
|
|
+ <h3>[method:undefined resetGLState]( )</h3>
|
|
|
<p>Reset the GL state to default. Called internally if the WebGL context is lost.</p>
|
|
|
|
|
|
- <h3>[method:null readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget], [param:Float x], [param:Float y], [param:Float width], [param:Float height], [param:TypedArray buffer], [param:Integer activeCubeFaceIndex] )</h3>
|
|
|
+ <h3>[method:undefined readRenderTargetPixels]( [param:WebGLRenderTarget renderTarget], [param:Float x], [param:Float y], [param:Float width], [param:Float height], [param:TypedArray buffer], [param:Integer activeCubeFaceIndex] )</h3>
|
|
|
<p>buffer - Uint8Array is the only destination type supported in all cases, other types are renderTarget and platform dependent. See [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12 WebGL spec] for details.</p>
|
|
|
<p>Reads the pixel data from the renderTarget into the buffer you pass in. This is a wrapper around [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels WebGLRenderingContext.readPixels]().</p>
|
|
|
<p>See the [example:webgl_interactive_cubes_gpu interactive / cubes / gpu] example.</p>
|
|
|
<p>For reading out a [page:WebGLCubeRenderTarget WebGLCubeRenderTarget] use the optional parameter activeCubeFaceIndex to determine which face should be read.</p>
|
|
|
|
|
|
|
|
|
- <h3>[method:null render]( [param:Object3D scene], [param:Camera camera] )</h3>
|
|
|
+ <h3>[method:undefined render]( [param:Object3D scene], [param:Camera camera] )</h3>
|
|
|
<p>
|
|
|
Render a [page:Scene scene] or another type of [page:Object3D object] using a [page:Camera camera].<br />
|
|
|
|
|
@@ -412,23 +412,23 @@
|
|
|
[page:WebGLRenderer.autoClearDepth autoClearDepth] properties to false. To forcibly clear one ore more buffers call [page:WebGLRenderer.clear .clear].
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null resetState]()</h3>
|
|
|
+ <h3>[method:undefined resetState]()</h3>
|
|
|
<p>Can be used to reset the internal WebGL state. This method is mostly relevant for applications which share a single WebGL context across multiple WebGL libraries.</p>
|
|
|
|
|
|
- <h3>[method:null setAnimationLoop]( [param:Function callback] )</h3>
|
|
|
+ <h3>[method:undefined setAnimationLoop]( [param:Function callback] )</h3>
|
|
|
<p>[page:Function callback] — The function will be called every available frame. If `null` is passed it will stop any already ongoing animation.</p>
|
|
|
<p>A built in function that can be used instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. For WebXR projects this function must be used.</p>
|
|
|
|
|
|
- <h3>[method:null setClearAlpha]( [param:Float alpha] )</h3>
|
|
|
+ <h3>[method:undefined setClearAlpha]( [param:Float alpha] )</h3>
|
|
|
<p>Sets the clear alpha. Valid input is a float between *0.0* and *1.0*.</p>
|
|
|
|
|
|
- <h3>[method:null setClearColor]( [param:Color color], [param:Float alpha] )</h3>
|
|
|
+ <h3>[method:undefined setClearColor]( [param:Color color], [param:Float alpha] )</h3>
|
|
|
<p>Sets the clear color and opacity.</p>
|
|
|
|
|
|
- <h3>[method:null setPixelRatio]( [param:number value] )</h3>
|
|
|
+ <h3>[method:undefined setPixelRatio]( [param:number value] )</h3>
|
|
|
<p>Sets device pixel ratio. This is usually used for HiDPI device to prevent bluring output canvas.</p>
|
|
|
|
|
|
- <h3>[method:null setRenderTarget]( [param:WebGLRenderTarget renderTarget], [param:Integer activeCubeFace], [param:Integer activeMipmapLevel] )</h3>
|
|
|
+ <h3>[method:undefined setRenderTarget]( [param:WebGLRenderTarget renderTarget], [param:Integer activeCubeFace], [param:Integer activeMipmapLevel] )</h3>
|
|
|
<p>
|
|
|
renderTarget -- The [page:WebGLRenderTarget renderTarget] that needs to be activated. When *null* is given, the canvas is set as the active render target instead.<br />
|
|
|
activeCubeFace -- Specifies the active cube side (PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5) of [page:WebGLCubeRenderTarget] (optional).<br />
|
|
@@ -436,8 +436,8 @@
|
|
|
This method sets the active rendertarget.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setScissor]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )<br />
|
|
|
- [method:null setScissor]( [param:Vector4 vector] )</h3>
|
|
|
+ <h3>[method:undefined setScissor]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )<br />
|
|
|
+ [method:undefined setScissor]( [param:Vector4 vector] )</h3>
|
|
|
|
|
|
<p>
|
|
|
The x, y, width, and height parameters of the scissor region.<br />
|
|
@@ -447,31 +447,31 @@
|
|
|
(x, y) is the lower-left corner of the scissor region.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setScissorTest]( [param:Boolean boolean] )</h3>
|
|
|
+ <h3>[method:undefined setScissorTest]( [param:Boolean boolean] )</h3>
|
|
|
<p>
|
|
|
Enable or disable the scissor test. When this is enabled, only the pixels within the defined
|
|
|
scissor area will be affected by further renderer actions.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setOpaqueSort]( [param:Function method] )</h3>
|
|
|
+ <h3>[method:undefined setOpaqueSort]( [param:Function method] )</h3>
|
|
|
<p>
|
|
|
Sets the custom opaque sort function for the WebGLRenderLists. Pass null to use the default painterSortStable function.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setTransparentSort]( [param:Function method] )</h3>
|
|
|
+ <h3>[method:undefined setTransparentSort]( [param:Function method] )</h3>
|
|
|
<p>
|
|
|
Sets the custom transparent sort function for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setSize]( [param:Integer width], [param:Integer height], [param:Boolean updateStyle] )</h3>
|
|
|
+ <h3>[method:undefined setSize]( [param:Integer width], [param:Integer height], [param:Boolean updateStyle] )</h3>
|
|
|
<p>
|
|
|
Resizes the output canvas to (width, height) with device pixel ratio taken into account,
|
|
|
and also sets the viewport to fit that size, starting in (0, 0).
|
|
|
Setting [page:Boolean updateStyle] to false prevents any style changes to the output canvas.
|
|
|
</p>
|
|
|
|
|
|
- <h3>[method:null setViewport]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )<br />
|
|
|
- [method:null setViewport]( [param:Vector4 vector] )</h3>
|
|
|
+ <h3>[method:undefined setViewport]( [param:Integer x], [param:Integer y], [param:Integer width], [param:Integer height] )<br />
|
|
|
+ [method:undefined setViewport]( [param:Vector4 vector] )</h3>
|
|
|
|
|
|
<p>
|
|
|
The x, y, width, and height parameters of the viewport.<br />
|