| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>MeshStandardMaterial - 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">MeshStandardMaterial</h1>
- <section>
- <header>
- <div class="class-description"><p>A standard physically based material, using Metallic-Roughness workflow.</p>
- <p>Physically based rendering (PBR) has recently become the standard in many
- 3D applications, such as <a href="https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/" target="_blank" rel="noopener">Unity</a>,
- <a href="https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/" target="_blank" rel="noopener">Unreal</a> and
- <a href="http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017" target="_blank" rel="noopener">3D Studio Max</a>.</p>
- <p>This approach differs from older approaches in that instead of using
- approximations for the way in which light interacts with a surface, a
- physically correct model is used. The idea is that, instead of tweaking
- materials to look good under specific lighting, a material can be created
- that will react 'correctly' under all lighting scenarios.</p>
- <p>In practice this gives a more accurate and realistic looking result than
- the <a href="MeshLambertMaterial.html">MeshLambertMaterial</a> or <a href="MeshPhongMaterial.html">MeshPhongMaterial</a>, at the cost of
- being somewhat more computationally expensive. <code>MeshStandardMaterial</code> uses per-fragment
- shading.</p>
- <p>Note that for best results you should always specify an environment map when using this material.</p>
- <p>For a non-technical introduction to the concept of PBR and how to set up a
- PBR material, check out these articles by the people at <a href="https://www.marmoset.co" target="_blank" rel="noopener">marmoset</a>:</p>
- <ul>
- <li><a href="https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/" target="_blank" rel="noopener">Basic Theory of Physically Based Rendering</a></li>
- <li><a href="https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/" target="_blank" rel="noopener">Physically Based Rendering and You Can Too</a></li>
- </ul>
- <p>Technical details of the approach used in three.js (and most other PBR systems) can be found is this
- <a href="https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf" target="_blank" rel="noopener">paper from Disney</a>
- (pdf), by Brent Burley.</p></div>
- <iframe id="viewer" src="../scenes/material-browser.html#MeshStandardMaterial"></iframe>
- </header>
- <article>
- <div class="container-overview">
- <h2>Constructor</h2>
- <h3 class="name name-method" id="MeshStandardMaterial" translate="no">new <a href="#MeshStandardMaterial">MeshStandardMaterial</a><span class="signature">( parameters : <span class="param-type">Object</span> )</span> </h3>
- <div class="method">
- <div class="description">
- <p>Constructs a new mesh standard 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="aoMap" translate="no">.<a href="#aoMap">aoMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The red channel of this texture is used as the ambient occlusion map.
- Requires a second set of UVs.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="aoMapIntensity" translate="no">.<a href="#aoMapIntensity">aoMapIntensity</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Intensity of the ambient occlusion effect. Range is <code>[0,1]</code>, where <code>0</code>
- disables ambient occlusion. Where intensity is <code>1</code> and the AO map's
- red channel is also <code>1</code>, ambient light is fully occluded on a surface.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bumpMap" translate="no">.<a href="#bumpMap">bumpMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The texture to create a bump map. The black and white values map to the
- perceived depth in relation to the lights. Bump doesn't actually affect
- the geometry of the object, only the lighting. If a normal map is defined
- this will be ignored.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="bumpScale" translate="no">.<a href="#bumpScale">bumpScale</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>How much the bump map affects the material. Typical range is <code>[0,1]</code>.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="color" translate="no">.<a href="#color">color</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
- <div class="description">
- <p>Color of the material.</p>
- <p>Default is <code>(1,1,1)</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="emissive" translate="no">.<a href="#emissive">emissive</a><span class="type-signature"> : <a href="Color.html">Color</a></span> </h3>
- <div class="description">
- <p>Emissive (light) color of the material, essentially a solid color
- unaffected by other lighting.</p>
- <p>Default is <code>(0,0,0)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="emissiveIntensity" translate="no">.<a href="#emissiveIntensity">emissiveIntensity</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Intensity of the emissive light. Modulates the emissive color.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="emissiveMap" translate="no">.<a href="#emissiveMap">emissiveMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>Set emissive (glow) map. The emissive map color is modulated by the
- emissive color and the emissive intensity. If you have an emissive map,
- be sure to set the emissive color to something other than black.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="envMap" translate="no">.<a href="#envMap">envMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The environment map. To ensure a physically correct rendering, environment maps
- are internally pre-processed with <a href="PMREMGenerator.html">PMREMGenerator</a>.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="envMapIntensity" translate="no">.<a href="#envMapIntensity">envMapIntensity</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Scales the effect of the environment map by multiplying its color.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="envMapRotation" translate="no">.<a href="#envMapRotation">envMapRotation</a><span class="type-signature"> : <a href="Euler.html">Euler</a></span> </h3>
- <div class="description">
- <p>The rotation of the environment map in radians.</p>
- <p>Default is <code>(0,0,0)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="flatShading" translate="no">.<a href="#flatShading">flatShading</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether the material is rendered with flat shading or not.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="fog" translate="no">.<a href="#fog">fog</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Whether the material is affected by fog or not.</p>
- <p>Default is <code>true</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="isMeshStandardMaterial" translate="no">.<a href="#isMeshStandardMaterial">isMeshStandardMaterial</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="lightMap" translate="no">.<a href="#lightMap">lightMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The light map. Requires a second set of UVs.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="lightMapIntensity" translate="no">.<a href="#lightMapIntensity">lightMapIntensity</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Intensity of the baked light.</p>
- <p>Default is <code>1</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>. The texture map
- color is modulated by the diffuse <code>color</code>.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="metalness" translate="no">.<a href="#metalness">metalness</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>How much the material is like a metal. Non-metallic materials such as wood
- or stone use <code>0.0</code>, metallic use <code>1.0</code>, with nothing (usually) in between.
- A value between <code>0.0</code> and <code>1.0</code> could be used for a rusty metal look.
- If <code>metalnessMap</code> is also provided, both values are multiplied.</p>
- <p>Default is <code>0</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="metalnessMap" translate="no">.<a href="#metalnessMap">metalnessMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The blue channel of this texture is used to alter the metalness of the
- material.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="normalMap" translate="no">.<a href="#normalMap">normalMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The texture to create a normal map. The RGB values affect the surface
- normal for each pixel fragment and change the way the color is lit. Normal
- maps do not change the actual shape of the surface, only the lighting. In
- case the material has a normal map authored using the left handed
- convention, the <code>y</code> component of <code>normalScale</code> should be negated to compensate
- for the different handedness.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="normalMapType" translate="no">.<a href="#normalMapType">normalMapType</a><span class="type-signature"> : <a href="global.html#TangentSpaceNormalMap">TangentSpaceNormalMap</a> | <a href="global.html#ObjectSpaceNormalMap">ObjectSpaceNormalMap</a></span> </h3>
- <div class="description">
- <p>The type of normal map.</p>
- <p>Default is <code>TangentSpaceNormalMap</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="normalScale" translate="no">.<a href="#normalScale">normalScale</a><span class="type-signature"> : <a href="Vector2.html">Vector2</a></span> </h3>
- <div class="description">
- <p>How much the normal map affects the material. Typical value range is <code>[0,1]</code>.</p>
- <p>Default is <code>(1,1)</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="roughness" translate="no">.<a href="#roughness">roughness</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>How rough the material appears. <code>0.0</code> means a smooth mirror reflection, <code>1.0</code>
- means fully diffuse. If <code>roughnessMap</code> is also provided,
- both values are multiplied.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="roughnessMap" translate="no">.<a href="#roughnessMap">roughnessMap</a><span class="type-signature"> : <a href="Texture.html">Texture</a></span> </h3>
- <div class="description">
- <p>The green channel of this texture is used to alter the roughness of the
- material.</p>
- <p>Default is <code>null</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="wireframe" translate="no">.<a href="#wireframe">wireframe</a><span class="type-signature"> : boolean</span> </h3>
- <div class="description">
- <p>Renders the geometry as a wireframe.</p>
- <p>Default is <code>false</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="wireframeLinecap" translate="no">.<a href="#wireframeLinecap">wireframeLinecap</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
- <div class="description">
- <p>Defines appearance of wireframe ends.</p>
- <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
- <p>Default is <code>'round'</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="wireframeLinejoin" translate="no">.<a href="#wireframeLinejoin">wireframeLinejoin</a><span class="type-signature"> : 'round' | 'bevel' | 'miter'</span> </h3>
- <div class="description">
- <p>Defines appearance of wireframe joints.</p>
- <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
- <p>Default is <code>'round'</code>.</p>
- </div>
- </div>
- <div class="member">
- <h3 class="name" id="wireframeLinewidth" translate="no">.<a href="#wireframeLinewidth">wireframeLinewidth</a><span class="type-signature"> : number</span> </h3>
- <div class="description">
- <p>Controls the thickness of the wireframe.</p>
- <p>Can only be used with <a href="SVGRenderer.html">SVGRenderer</a>.</p>
- <p>Default is <code>1</code>.</p>
- </div>
- </div>
- <h2 class="subsection-title">Source</h2>
- <p>
- <a href="https://github.com/mrdoob/three.js/blob/master/src/materials/MeshStandardMaterial.js" translate="no" target="_blank" rel="noopener">src/materials/MeshStandardMaterial.js</a>
- </p>
- </article>
- </section>
- <script src="../scripts/linenumber.js"></script>
- <script src="../scripts/page.js"></script>
- </body>
- </html>
|