|
@@ -10,58 +10,83 @@
|
|
|
<body>
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.</div>
|
|
|
+ <div class="desc">
|
|
|
+ The WebGL renderer displays your beautifully crafted scenes using
|
|
|
+ [link:https://en.wikipedia.org/wiki/WebGL WebGL].
|
|
|
+ </div>
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
<h3>[name]( [page:Object parameters] )</h3>
|
|
|
-
|
|
|
<div>
|
|
|
- parameters is an optional object with properties defining the renderer's behaviour.
|
|
|
+ [page:Object parameters] - (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.
|
|
|
- </div>
|
|
|
+ when parameters are missing. The following are valid parameters:<br /><br />
|
|
|
+
|
|
|
+ [page:DOMElement canvas] - A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas]
|
|
|
+ where the renderer draws its output.
|
|
|
+ This corresponds to the [page:WebGLRenderer.domElement domElement] property below.
|
|
|
+ If not passed in here, a new canvas element will be created.<br />
|
|
|
|
|
|
- <div>
|
|
|
- canvas — A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas] where the renderer draws its output.
|
|
|
- This corresponds to the [page:WebGLRenderer.domElement .domElement] property below.<br />
|
|
|
|
|
|
- context — This can be used to attach the renderer to an existing [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].<br />
|
|
|
+ [page:WebGLRenderingContext context] - This can be used to attach the renderer to an existing
|
|
|
+ [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext].
|
|
|
+ Default is null.<br />
|
|
|
|
|
|
- precision — Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*. Defaults to *"highp"* if supported by the device.<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"
|
|
|
+ [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices here].<br />
|
|
|
|
|
|
- alpha — whether the canvas contains an alpha (transparency) buffer or not. Default is *false*.<br />
|
|
|
+ [page:Boolean alpha] - whether the canvas contains an alpha (transparency) buffer or not.
|
|
|
+ Default is *false*.<br />
|
|
|
|
|
|
- premultipliedAlpha — whether the renderer will assume that colors have premultiplied alpha. Default is *true*.<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 />
|
|
|
|
|
|
- antialias — whether to perform antialiasing. Default is *false*.<br />
|
|
|
+ [page:Boolean antialias] - whether to perform antialiasing. Default is *false*.<br />
|
|
|
|
|
|
- stencil — whether the drawing buffer has a stencil buffer of at least 8 bits. Default is *true*.<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 />
|
|
|
|
|
|
- preserveDrawingBuffer — whether to preserve the buffers until manually cleared or overwritten. Default is *false*.<br />
|
|
|
+ [page:Boolean preserveDrawingBuffer] - whether to preserve the buffers until manually cleared
|
|
|
+ or overwritten. Default is *false*.<br />
|
|
|
|
|
|
- depth — whether the drawing buffer has a depth buffer of at least 16 bits. Default is *true*.<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 />
|
|
|
|
|
|
- logarithmicDepthBuffer — whether to use a lograthimic depth buffer. Default is *false*.
|
|
|
- See the [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] example.
|
|
|
+ [page:Boolean logarithmicDepthBuffer] - 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.
|
|
|
+ Default is *false*. See the [example:webgl_camera_logarithmicdepthbuffer camera / logarithmicdepthbuffer] example.
|
|
|
</div>
|
|
|
|
|
|
<h2>Properties</h2>
|
|
|
|
|
|
<h3>[property:Boolean autoClear]</h3>
|
|
|
- <div>Defines whether the renderer should automatically clear its output before rendering.</div>
|
|
|
+ <div>Defines whether the renderer should automatically clear its output before rendering a frame.</div>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean autoClearColor]</h3>
|
|
|
- <div>If autoClear is true, defines whether the renderer should clear the color buffer. Default is *true*.</div>
|
|
|
+ <div>
|
|
|
+ If [page:.autoClear autoClear] is true, defines whether the renderer should clear the color buffer.
|
|
|
+ Default is *true*.
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean autoClearDepth]</h3>
|
|
|
- <div>If autoClear is true, defines whether the renderer should clear the depth buffer. Default is *true*.</div>
|
|
|
+ <div>
|
|
|
+ If [page:.autoClear autoClear] is true, defines whether the renderer should clear the depth buffer.
|
|
|
+ Default is *true*.
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
<h3>[property:Boolean autoClearStencil]</h3>
|
|
|
- <div>If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is *true*.</div>
|
|
|
+ <div>
|
|
|
+ If [page:.autoClear autoClear] is true, defines whether the renderer should clear the stencil buffer.
|
|
|
+ Default is *true*.
|
|
|
+ </div>
|
|
|
|
|
|
<h3>[property:Object capabilities]</h3>
|
|
|
<div>
|
|
@@ -357,9 +382,9 @@
|
|
|
<div>Render a buffer geometry group using the camera and with the specified material.</div>
|
|
|
|
|
|
<h3>[method:null renderBufferImmediate]( [page:Object3D object], [page:shaderprogram program], [page:Material shading] )</h3>
|
|
|
- <div>object — an instance of [page:Object3D]<br />
|
|
|
- program — an instance of shaderProgram<br />
|
|
|
- shading — an instance of Material<br /><br />
|
|
|
+ <div>object - an instance of [page:Object3D]<br />
|
|
|
+ program - an instance of shaderProgram<br />
|
|
|
+ shading - an instance of Material<br /><br />
|
|
|
|
|
|
Render an immediate buffer. Gets called by renderImmediateObject.
|
|
|
</div>
|