Doodle3D-Slicer/three.js-master/docs/api/materials/Material.html
2015-06-12 15:58:26 +02:00

167 lines
5.2 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script src="../../list.js"></script>
<script src="../../page.js"></script>
<link type="text/css" rel="stylesheet" href="../../page.css" />
</head>
<body>
<h1>[name]</h1>
<div class="desc">Materials describe the appearance of [page:Object objects]. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.</div>
<h2>Constructor</h2>
<h3>[name]()</h3>
<div>
This creates a generic material.
</div>
<h2>Properties</h2>
<h3>[property:Integer id]</h3>
<div>
Unique number for this material instance.
</div>
<h3>[property:String name]</h3>
<div>
Material name. Default is an empty string.
</div>
<h3>[property:Float opacity]</h3>
<div>
Float in the range of 0.0 - 1.0 indicating how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque. If
*transparent* is not set to true for the material, the material will remain
fully opaque and this value will only affect its color.
</div>
<div>Default is *1.0*.</div>
<h3>[property:Boolean transparent]</h3>
<div>
Defines whether this material is transparent. This has an effect on rendering
as transparent objects need special treatment and are rendered after
non-transparent objects. For a working example of this behaviour, check the
[page:WebGLRenderer WebGLRenderer] code.<br />
When set to true, the extent to which the material is transparent is
controlled by setting *opacity*.
</div>
<div>Default is *false*.</div>
<h3>.[page:Blending blending]</h3>
<div>
Which blending to use when displaying objects with this material. Default is [page:Materials NormalBlending]. See the blending mode [page:Materials constants] for all possible values.
</div>
<h3>.[page:Integer blendSrc]</h3>
<div>
Blending source. It's one of the blending mode constants defined in Three.js. Default is [page:CustomBlendingEquation SrcAlphaFactor]. See the destination factors [page:CustomBlendingEquation constants] for all possible values.
</div>
<h3>[property:Integer blendDst]</h3>
<div>
Blending destination. It's one of the blending mode constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation OneMinusSrcAlphaFactor].
</div>
<h3>[property:Integer blendEquation]</h3>
<div>
Blending equation to use when applying blending. It's one of the constants defined in [page:Three Three.js]. Default is [page:CustomBlendingEquation AddEquation.]
</div>
<h3>[property:Boolean depthTest]</h3>
<div>
Whether to have depth test enabled when rendering this material. Default is *true*.
</div>
<h3>[property:Boolean depthWrite]</h3>
<div>
Whether rendering this material has any effect on the depth buffer. Default is *true*.
</div>
<div>
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
</div>
<h3>[property:Boolean polygonOffset]</h3>
<div>
Whether to use polygon offset. Default is *false*. This corresponds to the *POLYGON_OFFSET_FILL* WebGL feature.
</div>
<h3>[property:Integer polygonOffsetFactor]</h3>
<div>
Sets the polygon offset factor. Default is *0*.
</div>
<h3>[property:Integer polygonOffsetUnits]</h3>
<div>
Sets the polygon offset units. Default is *0*.
</div>
<h3>[property:Number alphaTest]</h3>
<div>
Sets the alpha value to be used when running an alpha test. Default is *0*.
</div>
<h3>[property:Float overdraw]</h3>
<div>
Amount of triangle expansion at draw time. This is a workaround for cases when gaps appear between triangles when using [page:CanvasRenderer]. *0.5* tends to give good results across browsers. Default is *0*.
</div>
<h3>[property:Boolean visible]</h3>
<div>
Defines whether this material is visible. Default is *true*.
</div>
<h3>[property:Enum side]</h3>
<div>
Defines which of the face sides will be rendered - front, back or both.
</div>
<div>
Default is [page:Materials THREE.FrontSide]. Other options are [page:Materials THREE.BackSide] and [page:Materials THREE.DoubleSide].
</div>
<h3>[property:Boolean needsUpdate]</h3>
<div>
Specifies that the material needs to be updated at the WebGL level. Set it to true if you made changes that need to be reflected in WebGL.
</div>
<div>
This property is automatically set to *true* when instancing a new material.
</div>
<h2>Methods</h2>
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
<h3>[method:Material clone]([page:material material])</h3>
<div>
material -- this material gets the cloned information (optional).
</div>
<div>
This clones the material in the optional parameter and returns it.
</div>
<h3>[method:null dispose]()</h3>
<div>
This disposes the material.
</div>
<h3>[method:null setValues]([page:object values])</h3>
<div>
values -- a container with parameters.
</div>
<div>
Sets the properties based on the *values*.
</div>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>