| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>MeshDistanceMaterial - Three.js Docs</title>
- <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <script src="../scripts/highlight.min.js"></script>
- <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
- <link type="text/css" rel="stylesheet" href="../styles/page.css">
- </head>
- <body>
- <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Material.html">Material</a> → </p>
- <h1 translate="no">MeshDistanceMaterial</h1>
- <section>
- <header>
- <div class="class-description"><p>A material used internally for implementing shadow mapping with
- point lights.</p>
- <p>Can also be used to customize the shadow casting of an object by assigning
- an instance of <code>MeshDistanceMaterial</code> to <a href="Object3D.html#customDistanceMaterial">Object3D#customDistanceMaterial</a>.
- The following examples demonstrates this approach in order to ensure
- transparent parts of objects do not cast shadows.</p></div>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="MeshDistanceMaterial" translate="no">new <a href="#MeshDistanceMaterial">MeshDistanceMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new mesh distance material.</p>
- </div>
- <table class="params">
- <tbody>
- <tr>
- <td class="name">
- <strong>parameters</strong>
- </td>
- <td class="description last">
- <p>An object with one or more properties
- defining the material's appearance. Any property of the material
- (including any property from inherited materials) can be passed
- in here. Color values can be passed any type of value accepted
- by <a href="Color.html#set">Color#set</a>.</p>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <h2 class="subsection-title">Properties</h2>
- <div class="member">
- <h3 class="name" id="alphaMap" translate="no">.<a href="#alphaMap">alphaMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The alpha map is a grayscale texture that controls the opacity across the
- surface (black: fully transparent; white: fully opaque).</p>
- <p>Only the color of the texture is used, ignoring the alpha channel if one
- exists. For RGB and RGBA textures, the renderer will use the green channel
- when sampling this texture due to the extra bit of precision provided for
- green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
- luminance/alpha textures will also still work as expected.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="displacementBias" translate="no">.<a href="#displacementBias">displacementBias</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>The offset of the displacement map's values on the mesh's vertices.
- The bias is added to the scaled sample of the displacement map.
- Without a displacement map set, this value is not applied.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="displacementMap" translate="no">.<a href="#displacementMap">displacementMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The displacement map affects the position of the mesh's vertices. Unlike
- other maps which only affect the light and shade of the material the
- displaced vertices can cast shadows, block other objects, and otherwise
- act as real geometry. The displacement texture is an image where the value
- of each pixel (white being the highest) is mapped against, and
- repositions, the vertices of the mesh.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="displacementScale" translate="no">.<a href="#displacementScale">displacementScale</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>How much the displacement map affects the mesh (where black is no
- displacement, and white is maximum displacement). Without a displacement
- map set, this value is not applied.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="isMeshDistanceMaterial" translate="no">.<a href="#isMeshDistanceMaterial">isMeshDistanceMaterial</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
- <div class="description">
- <p>This flag can be used for type testing.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="map" translate="no">.<a href="#map">map</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The color map. May optionally include an alpha channel, typically combined
- with <a href="Material.html#transparent">Material#transparent</a> or <a href="Material.html#alphaTest">Material#alphaTest</a>.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshDistanceMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshDistanceMaterial.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|