|
@@ -32,41 +32,41 @@
|
|
|
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].
|
|
|
Default is null.<br />
|
|
|
|
|
|
- [page:String precision] - Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*.
|
|
|
- Defaults to *"highp"* if supported by the device. See the note in "Things to Avoid"
|
|
|
+ [page:String precision] - Shader precision. Can be `"highp"`, `"mediump"` or `"lowp"`.
|
|
|
+ Defaults to `"highp"` if supported by the device. See the note in "Things to Avoid"
|
|
|
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices here].<br />
|
|
|
|
|
|
- [page:Boolean alpha] - controls the default clear alpha value. When set to *true*, the value is *0*. Otherwise it's *1*. Default is *false*.<br />
|
|
|
+ [page:Boolean alpha] - controls the default clear alpha value. When set to `true`, the value is `0`. Otherwise it's `1`. Default is `false`.<br />
|
|
|
|
|
|
[page:Boolean premultipliedAlpha] - whether the renderer will assume that colors have
|
|
|
[link:https://en.wikipedia.org/wiki/Glossary_of_computer_graphics#Premultiplied_alpha premultiplied alpha].
|
|
|
- Default is *true*.<br />
|
|
|
+ Default is `true`.<br />
|
|
|
|
|
|
- [page:Boolean antialias] - whether to perform antialiasing. Default is *false*.<br />
|
|
|
+ [page:Boolean antialias] - whether to perform antialiasing. Default is `false`.<br />
|
|
|
|
|
|
[page:Boolean stencil] - whether the drawing buffer has a
|
|
|
[link:https://en.wikipedia.org/wiki/Stencil_buffer stencil buffer] of at least 8 bits.
|
|
|
- Default is *true*.<br />
|
|
|
+ Default is `true`.<br />
|
|
|
|
|
|
[page:Boolean preserveDrawingBuffer] - whether to preserve the buffers until manually cleared
|
|
|
- or overwritten. Default is *false*.<br />
|
|
|
+ or overwritten. Default is `false`.<br />
|
|
|
|
|
|
[page:String powerPreference] - 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"*. Default is *"default"*.
|
|
|
+ of GPU is suitable for this WebGL context. Can be `"high-performance"`, `"low-power"` or `"default"`. Default is `"default"`.
|
|
|
See [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2 WebGL spec] for details.<br />
|
|
|
|
|
|
- [page:Boolean failIfMajorPerformanceCaveat] - whether the renderer creation will fail upon low performance is detected. Default is *false*.
|
|
|
+ [page:Boolean failIfMajorPerformanceCaveat] - whether the renderer creation will fail upon low performance is detected. Default is `false`.
|
|
|
See [link:https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.2 WebGL spec] for details.<br />
|
|
|
|
|
|
[page:Boolean depth] - whether the drawing buffer has a
|
|
|
[link:https://en.wikipedia.org/wiki/Z-buffering depth buffer] of at least 16 bits.
|
|
|
- Default is *true*.<br />
|
|
|
+ Default is `true`.<br />
|
|
|
|
|
|
[page:Boolean logarithmicDepthBuffer] - whether to use a logarithmic depth buffer. It may
|
|
|
be necessary to use this if dealing with huge differences in scale in a single scene. Note that this setting
|
|
|
uses gl_FragDepth if available which disables the [link:https://www.khronos.org/opengl/wiki/Early_Fragment_Test Early Fragment Test]
|
|
|
optimization and can cause a decrease in performance.
|
|
|
- Default is *false*. See the [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] example.
|
|
|
+ Default is `false`. See the [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] example.
|
|
|
</p>
|
|
|
|
|
|
<h2>Properties</h2>
|
|
@@ -78,21 +78,21 @@
|
|
|
<h3>[property:Boolean autoClearColor]</h3>
|
|
|
<p>
|
|
|
If [page:.autoClear autoClear] is true, defines whether the renderer should clear the color buffer.
|
|
|
- Default is *true*.
|
|
|
+ Default is `true`.
|
|
|
</p>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean autoClearDepth]</h3>
|
|
|
<p>
|
|
|
If [page:.autoClear autoClear] is true, defines whether the renderer should clear the depth buffer.
|
|
|
- Default is *true*.
|
|
|
+ Default is `true`.
|
|
|
</p>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean autoClearStencil]</h3>
|
|
|
<p>
|
|
|
If [page:.autoClear autoClear] is true, defines whether the renderer should clear the stencil buffer.
|
|
|
- Default is *true*.
|
|
|
+ Default is `true`.
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Object debug]</h3>
|
|
@@ -102,7 +102,7 @@
|
|
|
for errors during compilation and linkage process. It may be useful to disable this check in production for performance gain.
|
|
|
It is strongly recommended to keep these checks enabled during development.
|
|
|
If the shader does not compile and link - it will not work and associated material will not render.
|
|
|
- Default is *true*.
|
|
|
+ Default is `true`.
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Object capabilities]</h3>
|
|
@@ -110,31 +110,31 @@
|
|
|
An object containing details about the capabilities of the current [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].<br />
|
|
|
|
|
|
- [page:Boolean floatFragmentTextures]: whether the context supports the [link:https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float OES_texture_float] extension.<br />
|
|
|
- - [page:Boolean floatVertexTextures]: *true* if [page:Boolean floatFragmentTextures] and [page:Boolean vertexTextures] are both true.<br />
|
|
|
+ - [page:Boolean floatVertexTextures]: `true` if [page:Boolean floatFragmentTextures] and [page:Boolean vertexTextures] are both true.<br />
|
|
|
- [page:Method getMaxAnisotropy](): Returns the maximum available anisotropy.<br />
|
|
|
- [page:Method getMaxPrecision](): Returns the maximum available precision for vertex and fragment shaders. <br />
|
|
|
- - [page:Boolean isWebGL2]: *true* if the context in use is a WebGL2RenderingContext object.<br />
|
|
|
- - [page:Boolean logarithmicDepthBuffer]: *true* if the [page:parameter logarithmicDepthBuffer] was set to true in the constructor and
|
|
|
+ - [page:Boolean isWebGL2]: `true` if the context in use is a WebGL2RenderingContext object.<br />
|
|
|
+ - [page:Boolean logarithmicDepthBuffer]: `true` if the [page:parameter logarithmicDepthBuffer] was set to true in the constructor and
|
|
|
the context supports the [link:https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth EXT_frag_depth] extension.<br />
|
|
|
- - [page:Integer maxAttributes]: The value of *gl.MAX_VERTEX_ATTRIBS*.<br />
|
|
|
- - [page:Integer maxCubemapSize]: The value of *gl.MAX_CUBE_MAP_TEXTURE_SIZE*.
|
|
|
+ - [page:Integer maxAttributes]: The value of `gl.MAX_VERTEX_ATTRIBS`.<br />
|
|
|
+ - [page:Integer maxCubemapSize]: The value of `gl.MAX_CUBE_MAP_TEXTURE_SIZE`.
|
|
|
Maximum height * width of cube map textures that a shader can use.<br />
|
|
|
- - [page:Integer maxFragmentUniforms]: The value of *gl.MAX_FRAGMENT_UNIFORM_VECTORS*.
|
|
|
+ - [page:Integer maxFragmentUniforms]: The value of `gl.MAX_FRAGMENT_UNIFORM_VECTORS`.
|
|
|
The number of uniforms that can be used by a fragment shader.<br />
|
|
|
- - [page:Integer maxSamples]: The value of *gl.MAX_SAMPLES*.
|
|
|
+ - [page:Integer maxSamples]: The value of `gl.MAX_SAMPLES`.
|
|
|
Maximum number of samples in context of Multisample anti-aliasing (MSAA).<br />
|
|
|
- - [page:Integer maxTextureSize]: The value of *gl.MAX_TEXTURE_SIZE*.
|
|
|
+ - [page:Integer maxTextureSize]: The value of `gl.MAX_TEXTURE_SIZE`.
|
|
|
Maximum height * width of a texture that a shader use.<br />
|
|
|
- - [page:Integer maxTextures]: The value of *gl.MAX_TEXTURE_IMAGE_UNITS*.
|
|
|
+ - [page:Integer maxTextures]: The value of `gl.MAX_TEXTURE_IMAGE_UNITS`.
|
|
|
The maximum number of textures that can be used by a shader.<br />
|
|
|
- - [page:Integer maxVaryings]: The value of *gl.MAX_VARYING_VECTORS*.
|
|
|
+ - [page:Integer maxVaryings]: The value of `gl.MAX_VARYING_VECTORS`.
|
|
|
The number of varying vectors that can used by shaders.<br />
|
|
|
- - [page:Integer maxVertexTextures]: The value of *gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS*.
|
|
|
+ - [page:Integer maxVertexTextures]: The value of `gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS`.
|
|
|
The number of textures that can be used in a vertex shader.<br />
|
|
|
- - [page:Integer maxVertexUniforms]: The value of *gl.MAX_VERTEX_UNIFORM_VECTORS*.
|
|
|
+ - [page:Integer maxVertexUniforms]: The value of `gl.MAX_VERTEX_UNIFORM_VECTORS`.
|
|
|
The maximum number of uniforms that can be used in a vertex shader.<br />
|
|
|
- [page:String precision]: The shader precision currently being used by the renderer.<br />
|
|
|
- - [page:Boolean vertexTextures]: *true* if [property:Integer maxVertexTextures] is greater than 0 (i.e. vertex textures can be used).<br />
|
|
|
+ - [page:Boolean vertexTextures]: `true` if [property:Integer maxVertexTextures] is greater than 0 (i.e. vertex textures can be used).<br />
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Array clippingPlanes]</h3>
|
|
@@ -161,11 +161,11 @@
|
|
|
This method can check for the following extensions:<br />
|
|
|
|
|
|
<ul>
|
|
|
- <li>*WEBGL_depth_texture*</li>
|
|
|
- <li>*EXT_texture_filter_anisotropic*</li>
|
|
|
- <li>*WEBGL_compressed_texture_s3tc*</li>
|
|
|
- <li>*WEBGL_compressed_texture_pvrtc*</li>
|
|
|
- <li>*WEBGL_compressed_texture_etc1*</li>
|
|
|
+ <li>`WEBGL_depth_texture`</li>
|
|
|
+ <li>`EXT_texture_filter_anisotropic`</li>
|
|
|
+ <li>`WEBGL_compressed_texture_s3tc`</li>
|
|
|
+ <li>`WEBGL_compressed_texture_pvrtc`</li>
|
|
|
+ <li>`WEBGL_compressed_texture_etc1`</li>
|
|
|
</ul>
|
|
|
</p>
|
|
|
|
|
@@ -198,22 +198,22 @@
|
|
|
</ul>
|
|
|
</p>
|
|
|
<p>By default these data are reset at each render call but when having multiple render passes per frame (e.g. when using post processing) it can be preferred to reset with a custom pattern.
|
|
|
- First, set *autoReset* to *false*.
|
|
|
+ First, set `autoReset` to `false`.
|
|
|
<code>
|
|
|
renderer.info.autoReset = false;
|
|
|
</code>
|
|
|
- Call *reset()* whenever you have finished to render a single frame.
|
|
|
+ Call `reset()` whenever you have finished to render a single frame.
|
|
|
<code>
|
|
|
renderer.info.reset();
|
|
|
</code>
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:Boolean localClippingEnabled]</h3>
|
|
|
- <p>Defines whether the renderer respects object-level clipping planes. Default is *false*.</p>
|
|
|
+ <p>Defines whether the renderer respects object-level clipping planes. Default is `false`.</p>
|
|
|
|
|
|
<h3>[property:Boolean physicallyCorrectLights]</h3>
|
|
|
<p>
|
|
|
- Whether to use physically correct lighting mode. Default is *false*.
|
|
|
+ Whether to use physically correct lighting mode. Default is `false`.
|
|
|
See the [example:webgl_lights_physical lights / physical] example.
|
|
|
</p>
|
|
|
|
|
@@ -231,13 +231,13 @@
|
|
|
<p>
|
|
|
This contains the reference to the shadow map, if used.<br />
|
|
|
- [page:Boolean enabled]:
|
|
|
- If set, use shadow maps in the scene. Default is *false*.<br />
|
|
|
+ If set, use shadow maps in the scene. Default is `false`.<br />
|
|
|
- [page:Boolean autoUpdate]:
|
|
|
- Enables automatic updates to the shadows in the scene. Default is *true*.<br />
|
|
|
- If you do not require dynamic lighting / shadows, you may set this to *false* when the renderer is instantiated.<br />
|
|
|
+ Enables automatic updates to the shadows in the scene. Default is `true`.<br />
|
|
|
+ If you do not require dynamic lighting / shadows, you may set this to `false` when the renderer is instantiated.<br />
|
|
|
- [page:Boolean needsUpdate]:
|
|
|
- When set to *true*, shadow maps in the scene will be updated in the next *render* call. Default is *false*.<br />
|
|
|
- If you have disabled automatic updates to shadow maps (*shadowMap.autoUpdate = false*), you will need to set this to *true* and then make a render call to update the shadows in your scene.<br />
|
|
|
+ When set to `true`, shadow maps in the scene will be updated in the next `render` call. Default is `false`.<br />
|
|
|
+ If you have disabled automatic updates to shadow maps (`shadowMap.autoUpdate = false`), you will need to set this to `true` and then make a render call to update the shadows in your scene.<br />
|
|
|
- [page:Integer type]:
|
|
|
Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader).
|
|
|
Options are:
|
|
@@ -252,7 +252,7 @@
|
|
|
|
|
|
<h3>[property:Boolean sortObjects]</h3>
|
|
|
<p>
|
|
|
- Defines whether the renderer should sort objects. Default is *true*.<br /><br />
|
|
|
+ Defines whether the renderer should sort objects. Default is `true`.<br /><br />
|
|
|
|
|
|
Note: Sorting is used to attempt to properly render objects that have some degree of transparency.
|
|
|
By definition, sorting objects may not work in all cases. Depending on the needs of application,
|
|
@@ -272,7 +272,7 @@
|
|
|
|
|
|
<h3>[property:Number toneMappingExposure]</h3>
|
|
|
<p>
|
|
|
- Exposure level of tone mapping. Default is *1*.
|
|
|
+ Exposure level of tone mapping. Default is `1`.
|
|
|
</p>
|
|
|
|
|
|
<h3>[property:WebXRManager xr]</h3>
|
|
@@ -286,7 +286,7 @@
|
|
|
<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*.
|
|
|
+ Arguments default to `true`.
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:undefined clearColor]( )</h3>
|
|
@@ -344,7 +344,7 @@
|
|
|
<p>Returns the current active mipmap level.</p>
|
|
|
|
|
|
<h3>[method:RenderTarget getRenderTarget]()</h3>
|
|
|
- <p>Returns the current [page:RenderTarget RenderTarget] if there are; returns *null* otherwise.</p>
|
|
|
+ <p>Returns the current [page:RenderTarget RenderTarget] if there are; returns `null` otherwise.</p>
|
|
|
|
|
|
<h3>[method:Vector4 getCurrentViewport]( [param:Vector4 target] )</h3>
|
|
|
<p>
|
|
@@ -371,7 +371,7 @@
|
|
|
</p>
|
|
|
|
|
|
<h3>[method:Boolean getScissorTest]()</h3>
|
|
|
- <p>Returns *true* if scissor test is enabled; returns *false* otherwise.</p>
|
|
|
+ <p>Returns `true` if scissor test is enabled; returns `false` otherwise.</p>
|
|
|
|
|
|
<h3>[method:Vector2 getSize]( [param:Vector2 target] )</h3>
|
|
|
<p>
|
|
@@ -419,7 +419,7 @@
|
|
|
<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:undefined setClearAlpha]( [param:Float alpha] )</h3>
|
|
|
- <p>Sets the clear alpha. Valid input is a float between *0.0* and *1.0*.</p>
|
|
|
+ <p>Sets the clear alpha. Valid input is a float between `0.0` and `1.0`.</p>
|
|
|
|
|
|
<h3>[method:undefined setClearColor]( [param:Color color], [param:Float alpha] )</h3>
|
|
|
<p>Sets the clear color and opacity.</p>
|
|
@@ -429,7 +429,7 @@
|
|
|
|
|
|
<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 />
|
|
|
+ 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]. When passing a [page:WebGLArrayRenderTarget] or [page:WebGL3DRenderTarget] this indicates the z layer to render in to (optional).<br />
|
|
|
activeMipmapLevel -- Specifies the active mipmap level (optional).<br /><br />
|
|
|
This method sets the active rendertarget.
|