<divclass="desc">The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.</div>
<divclass="desc">This renderer has way better performance than [page:CanvasRenderer].</div>
<h2>Constructor</h2>
<h3>[name]()</h3>
<h3>[name]( [page:Object parameters] )</h3>
<div>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.</div>
<div>
canvas — A [page:Canvas] where the renderer draws its output.<br/>
precision — shader precision. Can be 'highp' or ???<br/>
alpha — [page:Boolean], default is true.<br/>
premultipliedAlpha — [page:Boolean], default is true.<br/>
antialias — [page:Boolean], default is false.<br/>
stencil — [page:Boolean], default is true.<br/>
preserveDrawingBuffer — [page:Boolean], default is false.<br/>
clearColor — [page:Integer], default is black.<br/>
clearAlpha — [page:Float], default is 0.<br/>
maxLights — [page:Integer], default is 4.<br/>
</div>
<h2>Properties</h2>
<h3>.[page:Vector3 todo]</h3>
<h3>.[page:DOMElement domElement]</h3>
<div>A [page:Canvas] where the renderer draws its output.<br/>
This is automatically created by the renderer in the constructor (if not provided already); you just need to add it to your page.</div>
<h3>.context</h3>
<div>The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.</div>
<h3>.[page:Boolean autoClear]</h3>
<div>Defines whether the renderer should automatically clear its output before rendering.</div>
<h3>.[page:Boolean autoClearColor]</h3>
<div>If autoClear is true, defines whether the renderer should clear the color buffer. Default is true.</div>
<h3>.[page:Boolean autoClearDepth]</h3>
<div>If autoClear is true, defines whether the renderer should clear the depth buffer. Default is true.</div>
<h3>.[page:Boolean autoClearStencil]</h3>
<div>If autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.</div>
<h3>.[page:Boolean sortObjects]</h3>
<div>Defines whether the renderer should sort objects. Default is true.</div>
<div>TODO</div>
<h3>.[page:Boolean autoUpdateObjects]</h3>
<div>Defines whether the renderer should auto update objects. Default is true.</div>
<div>TODO</div>
<h3>.[page:Boolean autoUpdateScene]</h3>
<div>Defines whether the renderer should auto update the scene. Default is true.</div>
<div>TODO</div>
<!-- Physically based shading -->
<h3>.[page:Boolean gammaInput]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Boolean gammaOutput]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Boolean physicallyBasedShading]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Boolean shadowMapEnabled]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Boolean shadowMapAutoUpdate]</h3>
<div>Default is true. TODO</div>
<h3>.[page:Boolean shadowMapSoft]</h3>
<div>Default is true. TODO</div>
<h3>.[page:Boolean shadowMapCullFrontFaces]</h3>
<div>Default is true. TODO</div>
<h3>.[page:Boolean shadowMapDebug]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Boolean shadowMapCascade]</h3>
<div>Default is false. TODO</div>
<h3>.[page:Integer maxMorphTargets]</h3>
<div>Default is 8. TODO</div>
<h3>.[page:Integer maxMorphNormals]</h3>
<div>Default is 4. TODO</div>
<h3>.[page:Boolean autoScaleCubemaps]</h3>
<div>Default is true. TODO</div>
<h3>.[page:Boolean renderPluginsPre]</h3>
<div>An array with render plugins to be applied before rendering.</div>
<div>Default is an empty array, or [].</div>
<h3>.[page:Boolean renderPluginsPost]</h3>
<div>An array with render plugins to be applied after rendering.</div>
<div>Default is an empty array, or [].</div>
<h3>.[page:Object info]</h3>
<div>An object with a series of statistical information about the graphics board memory and the rendering process. Useful for debugging or just for the sake of curiosity. The object contains the following fields:</div>
<div>
<ul>
<li>memory:
<ul>
<li>programs</li>
<li>geometries</li>
<li>textures</li>
</ul>
</li>
<li>render:
<ul>
<li>calls</li>
<li>vertices</li>
<li>faces</li>
<li>points</li>
</ul>
</li>
</ul>
</div>
<h2>Methods</h2>
<h3>.todo( [page:Vector3 todo] )</h3>
<h3>.getContext()</h3>
<div>
todo — todo<br/>
Return the WebGL context.
</div>
<h3>.supportsVertexTextures()</h3>
<div>
Return a [page:Boolean] true if the context supports vertex textures.
<div>Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.</div>
<div>object — an instance of [page:Object3D]</div>
<div>Removes an object from the GL context and releases all the data (geometry, matrices...) that the GL context keeps about the object, but it doesn't release textures or affect any JavaScript data.</div>
<h3>.deallocateTexture( [page:??? texture] )</h3>
<div>texture — an instance of [page:???] TODO</div>
<div>Releases a texture from the GL context.</div>