Skip to content

Commit

Permalink
Renamed docs /constants / WebGLRenderer to Renderer (#10028)
Browse files Browse the repository at this point in the history
  • Loading branch information
looeee authored and mrdoob committed Nov 5, 2016
1 parent a44dbd9 commit e3635ed
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 72 deletions.
File renamed without changes.
244 changes: 173 additions & 71 deletions docs/api/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,144 +11,246 @@
<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">This renderer has way better performance than [page:CanvasRenderer].</div>


<h2>Constructor</h2>


<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>
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 />
context — The [page:RenderingContext] context to use.<br />
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 <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext">RenderingContext</a>.<br />

precision — Shader precision. Can be *"highp"*, *"mediump"* or *"lowp"*. Defaults to *"highp"* if supported by the device.<br />
alpha — [page:Boolean], default is *false*.<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 />
depth — [page:Boolean], default is *true*.<br />
logarithmicDepthBuffer — [page:Boolean], default is *false*.<br />
</div>

<h2>Properties</h2>
alpha — whether the canvas contains an alpha (transparency) buffer or not. Default is *false*.<br />

<h3>[property:DOMElement domElement]</h3>
premultipliedAlpha — whether the renderer will assume that colors have premultiplied alpha. Default is *true*.<br />

<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>
antialias — whether to perform antialiasing. Default is *false*.<br />

<h3>[property:WebGLRenderingContext context]</h3>
stencil — whether the drawing buffer has a stencil buffer of at least 8 bits. Default is *true*.<br />

<div>The HTML5 Canvas's 'webgl' context obtained from the canvas where the renderer will draw.</div>
preserveDrawingBuffer — whether to preserve the buffers until manually cleared or overwritten. Default is *false*.<br />

<h3>[property:Boolean autoClear]</h3>
depth — whether the drawing buffer has a 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.
</div>

<h2>Properties</h2>

<h3>[property:Boolean autoClear]</h3>
<div>Defines whether the renderer should automatically clear its output before rendering.</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 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 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 autoClear is true, defines whether the renderer should clear the stencil buffer. Default is true.</div>
<h3>[property:Object capabilities]</h3>
<div>
An object containing details about the capabilities of the current <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext">RenderingContext</a>.<br />

- [property:Boolean floatFragmentTextures]: whether the context supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float">OES_texture_float</a> extension.
According to <a href="https://webglstats.com/">WebGLStats</a>, as of February 2016 over 95% of WebGL enabled devices support this.<br />
- [property:Boolean floatVertexTextures]: *true* if [property:Boolean floatFragmentTextures] and [property:Boolean vertexTextures] are both true.<br />
- [property:Method getMaxAnisotropy](): see [page:WebGLRenderer.getMaxAnisotropy getMaxAnisotropy] below. <br />
- [property:Method getMaxPrecision](): see [page:WebGLRenderer.getMaxPrecision getMaxPrecision] below. <br />
- [property:Boolean logarithmicDepthBuffer]: *true* if the [property:parameter logarithmicDepthBuffer] was set to true in the constructor,
the context supports the <a href="https://developer.mozilla.org/en-US/docs/Web/API/EXT_frag_depth">EXT_frag_depth</a> extension.
According to <a href="https://webglstats.com/">WebGLStats</a>, as of February 2016 around 66% of WebGL enabled devices support this.<br />
- [property:Integer maxAttributes]: The value of *gl.MAX_VERTEX_ATTRIBS*.<br />
- [property:Integer maxCubemapSize]: The value of *gl.MAX_CUBE_MAP_TEXTURE_SIZE*.
Maximum height * width of cube map textures that a shader can use.<br />
- [property:Integer maxFragmentUniforms]: The value of *gl.MAX_FRAGMENT_UNIFORM_VECTORS*.
The number of uniforms that can be used by a fragment shader.<br />
- [property:Integer maxTextureSize]: The value of *gl.MAX_TEXTURE_SIZE*.
Maximum height * width of a texture that a shader use.<br />
- [property:Integer maxTextures]: The value of *gl.MAX_TEXTURE_IMAGE_UNITS*.
The maximum number of textures that can be used by a shader.<br />
- [property:Integer maxVaryings]: The value of *gl.MAX_VARYING_VECTORS*.
The number of varying vectors that can used by shaders.<br />
- [property:Integer maxVertexTextures]: The value of *gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS*.
The number of textures that can be used in a vertex shader.<br />
- [property:Integer maxVertexUniforms]: The value of *gl.MAX_VERTEX_UNIFORM_VECTORS*.
The maximum number of uniforms that can be used in a vertex shader.<br />
- [property:String precision]: The shader precision currently being used by the renderer.<br />
- [property:Boolean vertexTextures]: *true* if [property:Integer maxVertexTextures] is greater than 0 (i.e. vertext textures can be used).<br />
</div>

<h3>[property:Array clippingPlanes]</h3>
<div>
User-defined clipping planes specified as THREE.Plane objects in world space.
These planes apply globally. Points in space whose dot product with the plane is negative are cut away.
Default is [].
</div>

<h3>[property:Boolean sortObjects]</h3>
<h3>[property:WebGLRenderingContext context]</h3>
<div>
The renderer obtains a <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext">RenderingContext</a> context
from its [page:WebGLRenderer.domElement domElement][page:WebGLRenderer.domElement domElement] by default, using
<a href="https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext">HTMLCanvasElement.getContext()</a>.<br /><br />

<div>Defines whether the renderer should sort objects. Default is true.</div>
You can create this manually, however it must correspond to the
[page:WebGLRenderer.domElement domElement] in order to render to the screen.
</div>

<div>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, it may be neccessary to turn off sorting and use other methods to deal with transparency rendering e.g. manually determining the object rendering order.</div>
<h3>[property:DOMElement domElement]</h3>
<div>
A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas 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 like so:<br />
<code>
document.body.appendChild( renderer.domElement );
</code>
</div>

<h3>[property:Object extensions]</h3>
<div>
A wrapper for the [page:WebGLRenderer.extensions.get .extensions.get] method, used internally to check whether
various extensions are supported and set parameters accordingly.
</div>

<h3>[property:Array clippingPlanes]</h3>
<h3>[property:Boolean gammaFactor]</h3>
<div>Default is *2*. </div>

<div>User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply globally. Points in space whose dot product with the plane is negative are cut away. Default is [].</div>

<h3>[property:Boolean localClippingEnabled]</h3>
<h3>[property:Boolean gammaInput]</h3>
<div>If set, then it expects that all textures and colors are premultiplied gamma. Default is *false*.</div>

<div>Defines whether the renderer respects object-level clipping planes. Default is false.</div>

<h3>[property:Boolean gammaOutput]</h3>
<div>If set, then it expects that all textures and colors need to be outputted in premultiplied gamma. Default is *false*.</div>

<h3>[property: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>geometries</li>
<li>textures</li>
</ul>
</li>
<li>render:
<ul>
<li>calls</li>
<li>vertices</li>
<li>faces</li>
<li>points</li>
</ul>
</li>
<li>programs
</li>
</ul>
</div>

<h3>[property:Boolean gammaInput]</h3>
<h3>[property:Boolean localClippingEnabled]</h3>
<div>Defines whether the renderer respects object-level clipping planes. Default is *false*.</div>

<div>Default is false. If set, then it expects that all textures and colors are premultiplied gamma.</div>
<h3>[property:Integer maxMorphTargets]</h3>
<div>
Default is 8. The maximum number of MorphTargets allowed in a shader.
Keep in mind that the standard materials only allow 8 MorphTargets.
</div>

<h3>[property:Integer maxMorphNormals]</h3>
<div>
Default is 4. The maximum number of MorphNormals allowed in a shader.
Keep in mind that the standard materials only allow 4 MorphNormals.
</div>

<h3>[property:Boolean gammaOutput]</h3>
<h3>[property:Integer physicallyCorrectLights]</h3>
<div>
Whether to use physically correct lighting mode. Default is *false*.
See the [example:webgl_lights_physical lights / physical] example.
</div>

<div>Default is false. If set, then it expects that all textures and colors need to be outputted in premultiplied gamma.</div>
<h3>[property:Object properties]</h3>
<div>
Used internally by the renderer to keep track of various sub object properties.
</div>

<h3>[property:WebGLShadowMap shadowMap]</h3>
<div>
This contains the reference to the component implementing shadow mapping.
This contains the reference to the shadow map, if used.
</div>

<h3>[property:Boolean shadowMap.enabled]</h3>

<div>Default is false. If set, use shadow maps in the scene.</div>
<div>If set, use shadow maps in the scene. Default is *false*.</div>

<h3>[property:Integer shadowMap.type]</h3>

<div>Defines shadow map type (unfiltered, percentage close filtering, percentage close filtering with bilinear filtering in shader)</div>
<div>Options are THREE.BasicShadowMap, THREE.PCFShadowMap (default), THREE.PCFSoftShadowMap. See [page:WebGLRenderer WebGLRenderer constants] for details.</div>

<h3>[property:Boolean shadowMap.renderReverseSided]</h3>

<div>Default is true. Whether to render the opposite side as specified by the material into the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>
<div>
Whether to render the opposite side as specified by the material into the shadow map.
When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can
both cast and receive shadows at the same time to render correctly. Default is *true*.
</div>

<h3>[property:Boolean shadowMap.renderSingleSided]</h3>
<div>
Whether to treat materials specified as double-sided as if they were specified as front-sided
when rendering the shadow map. When disabled, an appropriate shadow.bias must be set on the light
source for surfaces that can both cast and receive shadows at the same time to render correctly.
Default is *true*.
</div>

<div>Default is true. Whether to treat materials specified as double-sided as if they were specified as front-sided when rendering the shadow map. When disabled, an appropriate shadow.bias must be set on the light source for surfaces that can both cast and receive shadows at the same time to render correctly.</div>

<h3>[property:Integer maxMorphTargets]</h3>

<div>Default is 8. The maximum number of MorphTargets allowed in a shader. Keep in mind that the standard materials only allow 8 MorphTargets.</div>

<h3>[property:Boolean sortObjects]</h3>
<div>
Defines whether the renderer should sort objects. Default is *true*.<br /><br />

<h3>[property:Integer maxMorphNormals]</h3>
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,
it may be neccessary to turn off sorting and use other methods to deal with transparency
rendering e.g. manually determining the object rendering order.
</div>

<div>Default is 4. The maximum number of MorphNormals allowed in a shader. Keep in mind that the standard materials only allow 4 MorphNormals. </div>
<h3>[property:Object state]</h3>
<div>
Contains functions for setting various properties of the [page:WebGLRenderer.context] state.
</div>

<h3>[property:Constant toneMapping]</h3>
<div>
Default is [page:Renderer LinearToneMapping]. See the [page:Renderer Renderer constants] for other choices.
</div>

<h3>[property:Object info]</h3>
<h3>[property:Number toneMappingExposure]</h3>
<div>
Exposure level of tone mapping. Default is *1*.
</div>

<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>
<h3>[property:Number toneMappingWhitePoint]</h3>
<div>
<ul>
<li>memory:
<ul>
<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>
<li>programs
</li>
</ul>
Tone mapping white point. Default is *1*.
</div>

<h2>Methods</h2>

<h3>[method:Object extensions.get]( [page:String extensionName] )</h3>
<div>
Used internally to check whether various extensions are supported and set parameters accordingly.<br /><br />
</div>

<h3>[method:WebGLRenderingContext getContext]()</h3>
<div>
Return the WebGL context.
Expand Down
2 changes: 1 addition & 1 deletion docs/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var list = {
[ "DrawModes", "api/constants/DrawModes" ],
[ "Materials", "api/constants/Materials" ],
[ "Textures", "api/constants/Textures" ],
[ "WebGLRenderer", "api/constants/WebGLRenderer" ]
[ "Renderer", "api/constants/Renderer" ]
],

"Cameras": [
Expand Down

0 comments on commit e3635ed

Please sign in to comment.