cesium-examples/map/3d/static/Cesium/Build/Documentation/Material.html

2776 lines
89 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Material - Cesium Documentation</title>
<!--[if lt IE 9]>
<script src="javascript/html5.js"></script>
<![endif]-->
<link href="styles/jsdoc-default.css" rel="stylesheet">
<link href="styles/prism.css" rel="stylesheet">
</head>
<body>
<div id="main">
<h1 class="page-title">
<a href="index.html"><img src="Images/CesiumLogo.png" class="cesiumLogo"></a>
Material
<div class="titleCenterer"></div>
</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="nameContainer">
<h4 class="name" id="Material">
<a href="#Material" class="doc-link"></a>
new Cesium.Material<span class="signature">(<span class="optional">options</span>)</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L303">Scene/Material.js 303</a>
</div>
</h4>
</div>
<div class="description">
A Material defines surface appearance through a combination of diffuse, specular, normal, emission, and alpha components. These values are specified using a JSON schema called Fabric which gets parsed and assembled into glsl shader code behind-the-scenes. Check out the <a href="https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric">wiki page</a> for more details on Fabric. <br /><br /> <style type="text/css"> #materialDescriptions code { font-weight: normal; font-family: Consolas, 'Lucida Console', Monaco, monospace; color: #A35A00; } #materialDescriptions ul, #materialDescriptions ul ul { list-style-type: none; } #materialDescriptions ul ul { margin-bottom: 10px; } #materialDescriptions ul ul li { font-weight: normal; color: #000000; text-indent: -2em; margin-left: 2em; } #materialDescriptions ul li { font-weight: bold; color: #0053CF; } </style> Base material types and their uniforms: <div id='materialDescriptions'> <ul> <li>Color</li> <ul> <li><code>color</code>: rgba color object.</li> </ul> <li>Image</li> <ul> <li><code>image</code>: path to image.</li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> </ul> <li>DiffuseMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels.</li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> </ul> <li>AlphaMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> </ul> <li>SpecularMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> </ul> <li>EmissionMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> </ul> <li>BumpMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channel</code>: One character string containing r, g, b, or a for selecting the desired image channel. </li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li> </ul> <li>NormalMap</li> <ul> <li><code>image</code>: path to image.</li> <li><code>channels</code>: Three character string containing any combination of r, g, b, and a for selecting the desired image channels. </li> <li><code>repeat</code>: Object with x and y values specifying the number of times to repeat the image.</li> <li><code>strength</code>: Bump strength value between 0.0 and 1.0 where 0.0 is small bumps and 1.0 is large bumps.</li> </ul> <li>Grid</li> <ul> <li><code>color</code>: rgba color object for the whole material.</li> <li><code>cellAlpha</code>: Alpha value for the cells between grid lines. This will be combined with color.alpha.</li> <li><code>lineCount</code>: Object with x and y values specifying the number of columns and rows respectively.</li> <li><code>lineThickness</code>: Object with x and y values specifying the thickness of grid lines (in pixels where available).</li> <li><code>lineOffset</code>: Object with x and y value
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>options</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Object with the following properties:
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>strict</code></td>
<td class="type">
<span class="param-type">Boolean</span>
</td>
<td class="default">
<code class="language-javascript">false</code>
</td>
<td class="description last">
<span class="optional">optional</span>
Throws errors for issues that would normally be ignored, including unused uniforms or materials.</td>
</tr>
<tr>
<td class="name"><code>translucent</code></td>
<td class="type">
<span class="param-type">Boolean</span>
|
<span class="param-type">function</span>
</td>
<td class="default">
<code class="language-javascript">true</code>
</td>
<td class="description last">
<span class="optional">optional</span>
When <code>true</code> or a function that returns <code>true</code>, the geometry with this material is expected to appear translucent.</td>
</tr>
<tr>
<td class="name"><code>fabric</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="default">
</td>
<td class="description last">
The fabric JSON used to generate the material.</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: fabric: uniform has invalid type.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: fabric: uniforms and materials cannot share the same property.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: fabric: cannot have source and components in the same section.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: fabric: property name is not valid. It should be 'type', 'materials', 'uniforms', 'components', or 'source'.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: fabric: property name is not valid. It should be 'diffuse', 'specular', 'shininess', 'normal', 'emission', or 'alpha'.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: strict: shader source does not use string.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: strict: shader source does not use uniform.
</div>
</li>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: strict: shader source does not use material.
</div>
</li>
</ul>
<dl class="details">
<h5>Example:</h5>
<pre><code class="language-javascript">// Create a color material with fromType: polygon.material = Cesium.Material.fromType('Color'); polygon.material.uniforms.color = new Cesium.Color(1.0, 1.0, 0.0, 1.0); // Create the default material: polygon.material = new Cesium.Material(); // Create a color material with full Fabric notation: polygon.material = new Cesium.Material({ fabric : { type : 'Color', uniforms : { color : new Cesium.Color(1.0, 1.0, 0.0, 1.0) } } });</code></pre>
<h5>Demo:</h5>
<ul class="see-list">
<li><a href="https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Materials.html">Cesium Sandcastle Materials Demo</a></li>
</ul>
<h5>See:</h5>
<ul class="see-list">
<li><a href="https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric">Fabric wiki page</a> for a more detailed options of Fabric.</li>
</ul>
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<div class="nameContainer">
<h4 class="name" id=".AlphaMapType">
<a href="#.AlphaMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.AlphaMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1171">Scene/Material.js 1171</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the alpha map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".AspectRampMaterialType">
<a href="#.AspectRampMaterialType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.AspectRampMaterialType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1577">Scene/Material.js 1577</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the aspect ramp material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".BumpMapType">
<a href="#.BumpMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.BumpMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1234">Scene/Material.js 1234</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the bump map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".CheckerboardType">
<a href="#.CheckerboardType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.CheckerboardType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1322">Scene/Material.js 1322</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the checkerboard material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".ColorType">
<a href="#.ColorType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.ColorType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1104">Scene/Material.js 1104</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the color material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".DefaultCubeMapId">
<a href="#.DefaultCubeMapId" class="doc-link"></a>
<span class="type-signature attribute-static">static</span>Cesium.Material.DefaultCubeMapId<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1097">Scene/Material.js 1097</a>
</div>
</h4>
</div>
<div class="description">
Gets or sets the default cube map texture uniform value.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".DefaultImageId">
<a href="#.DefaultImageId" class="doc-link"></a>
<span class="type-signature attribute-static">static</span>Cesium.Material.DefaultImageId<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1091">Scene/Material.js 1091</a>
</div>
</h4>
</div>
<div class="description">
Gets or sets the default texture uniform value.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".DiffuseMapType">
<a href="#.DiffuseMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.DiffuseMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1150">Scene/Material.js 1150</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the diffuce map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".DotType">
<a href="#.DotType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.DotType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1344">Scene/Material.js 1344</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the dot material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".ElevationContourType">
<a href="#.ElevationContourType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.ElevationContourType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1522">Scene/Material.js 1522</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the elevation contour material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".ElevationRampType">
<a href="#.ElevationRampType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.ElevationRampType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1541">Scene/Material.js 1541</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the elevation contour material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".EmissionMapType">
<a href="#.EmissionMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.EmissionMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1213">Scene/Material.js 1213</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the emmision map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".FadeType">
<a href="#.FadeType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.FadeType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1416">Scene/Material.js 1416</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the fade material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".GridType">
<a href="#.GridType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.GridType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1274">Scene/Material.js 1274</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the grid material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".ImageType">
<a href="#.ImageType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.ImageType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1126">Scene/Material.js 1126</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the image material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".NormalMapType">
<a href="#.NormalMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.NormalMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1254">Scene/Material.js 1254</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the normal map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".PolylineArrowType">
<a href="#.PolylineArrowType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.PolylineArrowType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1444">Scene/Material.js 1444</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the polyline arrow material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".PolylineDashType">
<a href="#.PolylineDashType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.PolylineDashType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1461">Scene/Material.js 1461</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the polyline glow material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".PolylineGlowType">
<a href="#.PolylineGlowType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.PolylineGlowType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1481">Scene/Material.js 1481</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the polyline glow material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".PolylineOutlineType">
<a href="#.PolylineOutlineType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.PolylineOutlineType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1500">Scene/Material.js 1500</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the polyline outline material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".RimLightingType">
<a href="#.RimLightingType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.RimLightingType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1394">Scene/Material.js 1394</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the rim lighting material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".SlopeRampMaterialType">
<a href="#.SlopeRampMaterialType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.SlopeRampMaterialType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1560">Scene/Material.js 1560</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the slope ramp material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".SpecularMapType">
<a href="#.SpecularMapType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.SpecularMapType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1192">Scene/Material.js 1192</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the specular map material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".StripeType">
<a href="#.StripeType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.StripeType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1298">Scene/Material.js 1298</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the stripe material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id=".WaterType">
<a href="#.WaterType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span><span class="type-signature attribute-readonly">readonly</span>Cesium.Material.WaterType<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L1366">Scene/Material.js 1366</a>
</div>
</h4>
</div>
<div class="description">
Gets the name of the water material.
</div>
<dl class="details">
</dl>
<div class="nameContainer">
<h4 class="name" id="materials">
<a href="#materials" class="doc-link"></a>
materials<span class="type-signature"> : Object</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L323">Scene/Material.js 323</a>
</div>
</h4>
</div>
<div class="description">
Maps sub-material names to Material objects.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">undefined</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="shaderSource">
<a href="#shaderSource" class="doc-link"></a>
shaderSource<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L316">Scene/Material.js 316</a>
</div>
</h4>
</div>
<div class="description">
The glsl shader source for this material.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">undefined</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="translucent">
<a href="#translucent" class="doc-link"></a>
translucent<span class="type-signature"> : Boolean|function</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L339">Scene/Material.js 339</a>
</div>
</h4>
</div>
<div class="description">
When <code>true</code> or a function that returns <code>true</code>, the geometry is expected to appear translucent.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">undefined</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="type">
<a href="#type" class="doc-link"></a>
type<span class="type-signature"> : String</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L309">Scene/Material.js 309</a>
</div>
</h4>
</div>
<div class="description">
The material type. Can be an existing type or a new type. If no type is specified in fabric, type is a GUID.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">undefined</code>
</dl>
<div class="nameContainer">
<h4 class="name" id="uniforms">
<a href="#uniforms" class="doc-link"></a>
uniforms<span class="type-signature"> : Object</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L330">Scene/Material.js 330</a>
</div>
</h4>
</div>
<div class="description">
Maps uniform names to their values.
</div>
<dl class="details">
<span class="details-header">Default Value:</span>
<code class="language-javascript">undefined</code>
</dl>
<h3 class="subsection-title">Methods</h3>
<div class="nameContainer">
<h4 class="name" id=".fromType">
<a href="#.fromType" class="doc-link"></a>
<span class="type-signature attribute-static">static</span>Cesium.Material.fromType<span class="signature">(type, <span class="optional">uniforms</span>)</span> &rarr; <span class="type-signature returnType"><a href="Material.html">Material</a></span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L388">Scene/Material.js 388</a>
</div>
</h4>
</div>
<div class="description">
Creates a new material using an existing material type. <br /><br /> Shorthand for: new Material({fabric : {type : type}});
</div>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">
The base material type.</td>
</tr>
<tr>
<td class="name"><code>uniforms</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">
<span class="optional">optional</span>
Overrides for the default uniforms.</td>
</tr>
</tbody>
</table>
<h5>Returns:</h5>
<div class="param-desc">
New material object.
</div>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: material with that type does not exist.
</div>
</li>
</ul>
<dl class="details">
<h5>Example:</h5>
<pre><code class="language-javascript">var material = Cesium.Material.fromType('Color', { color : new Cesium.Color(1.0, 0.0, 0.0, 1.0) });</code></pre>
</dl>
<div class="nameContainer">
<h4 class="name" id="destroy">
<a href="#destroy" class="doc-link"></a>
destroy<span class="signature">()</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L557">Scene/Material.js 557</a>
</div>
</h4>
</div>
<div class="description">
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object. <br /><br /> Once an object is destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a <a href="DeveloperError.html"><code>DeveloperError</code></a> exception. Therefore, assign the return value (<code>undefined</code>) to the object as done in the example.
</div>
<h5>Throws:</h5>
<ul>
<li>
<div class="param-desc">
<span class="param-type"><a href="DeveloperError.html">DeveloperError</a></span>
: This object was destroyed, i.e., destroy() was called.
</div>
</li>
</ul>
<dl class="details">
<h5>Example:</h5>
<pre><code class="language-javascript">material = material &amp;&amp; material.destroy();</code></pre>
<h5>See:</h5>
<ul class="see-list">
<li><a href="Material.html#isDestroyed">Material#isDestroyed</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="isDestroyed">
<a href="#isDestroyed" class="doc-link"></a>
isDestroyed<span class="signature">()</span> &rarr; <span class="type-signature returnType">Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L537">Scene/Material.js 537</a>
</div>
</h4>
</div>
<div class="description">
Returns true if this object was destroyed; otherwise, false. <br /><br /> If this object was destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a <a href="DeveloperError.html"><code>DeveloperError</code></a> exception.
</div>
<h5>Returns:</h5>
<div class="param-desc">
True if this object was destroyed; otherwise, false.
</div>
<dl class="details">
<h5>See:</h5>
<ul class="see-list">
<li><a href="Material.html#destroy">Material#destroy</a></li>
</ul>
</dl>
<div class="nameContainer">
<h4 class="name" id="isTranslucent">
<a href="#isTranslucent" class="doc-link"></a>
isTranslucent<span class="signature">()</span> &rarr; <span class="type-signature returnType">Boolean</span>
<div class="source-link rightLinks">
<a href="https://github.com/AnalyticalGraphicsInc/cesium/blob/1.58/Source/Scene/Material.js#L416">Scene/Material.js 416</a>
</div>
</h4>
</div>
<div class="description">
Gets whether or not this material is translucent.
</div>
<h5>Returns:</h5>
<div class="param-desc">
<code>true</code> if this material is translucent, <code>false</code> otherwise.
</div>
<dl class="details">
</dl>
</article>
</section>
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.2</a>
</footer>
</div>
<div class="nav">
<div class="menu">
<input type="text" class="classFilter" id="ClassFilter" placeholder="Search">
<ul id="ClassList"><li data-name="Animation"><a href="Animation.html">Animation</a></li><li data-name="AnimationViewModel"><a href="AnimationViewModel.html">AnimationViewModel</a></li><li data-name="Appearance"><a href="Appearance.html">Appearance</a></li><li data-name="ArcGisMapServerImageryProvider"><a href="ArcGisMapServerImageryProvider.html">ArcGisMapServerImageryProvider</a></li><li data-name="ArcType"><a href="ArcType.html">ArcType</a></li><li data-name="AssociativeArray"><a href="AssociativeArray.html">AssociativeArray</a></li><li data-name="AxisAlignedBoundingBox"><a href="AxisAlignedBoundingBox.html">AxisAlignedBoundingBox</a></li><li data-name="barycentricCoordinates"><a href="barycentricCoordinates.html">barycentricCoordinates</a></li><li data-name="BaseLayerPicker"><a href="BaseLayerPicker.html">BaseLayerPicker</a></li><li data-name="BaseLayerPickerViewModel"><a href="BaseLayerPickerViewModel.html">BaseLayerPickerViewModel</a></li><li data-name="Billboard"><a href="Billboard.html">Billboard</a></li><li data-name="BillboardCollection"><a href="BillboardCollection.html">BillboardCollection</a></li><li data-name="BillboardGraphics"><a href="BillboardGraphics.html">BillboardGraphics</a></li><li data-name="BillboardVisualizer"><a href="BillboardVisualizer.html">BillboardVisualizer</a></li><li data-name="binarySearch"><a href="binarySearch.html">binarySearch</a></li><li data-name="BingMapsApi"><a href="BingMapsApi.html">BingMapsApi</a></li><li data-name="BingMapsGeocoderService"><a href="BingMapsGeocoderService.html">BingMapsGeocoderService</a></li><li data-name="BingMapsImageryProvider"><a href="BingMapsImageryProvider.html">BingMapsImageryProvider</a></li><li data-name="BingMapsStyle"><a href="BingMapsStyle.html">BingMapsStyle</a></li><li data-name="BlendEquation"><a href="BlendEquation.html">BlendEquation</a></li><li data-name="BlendFunction"><a href="BlendFunction.html">BlendFunction</a></li><li data-name="BlendingState"><a href="BlendingState.html">BlendingState</a></li><li data-name="BlendOption"><a href="BlendOption.html">BlendOption</a></li><li data-name="BoundingRectangle"><a href="BoundingRectangle.html">BoundingRectangle</a></li><li data-name="BoundingSphere"><a href="BoundingSphere.html">BoundingSphere</a></li><li data-name="BoxEmitter"><a href="BoxEmitter.html">BoxEmitter</a></li><li data-name="BoxGeometry"><a href="BoxGeometry.html">BoxGeometry</a></li><li data-name="BoxGeometryUpdater"><a href="BoxGeometryUpdater.html">BoxGeometryUpdater</a></li><li data-name="BoxGraphics"><a href="BoxGraphics.html">BoxGraphics</a></li><li data-name="BoxOutlineGeometry"><a href="BoxOutlineGeometry.html">BoxOutlineGeometry</a></li><li data-name="CallbackProperty"><a href="CallbackProperty.html">CallbackProperty</a></li><li data-name="Camera"><a href="Camera.html">Camera</a></li><li data-name="CameraEventAggregator"><a href="CameraEventAggregator.html">CameraEventAggregator</a></li><li data-name="CameraEventType"><a href="CameraEventType.html">CameraEventType</a></li><li data-name="cancelAnimationFrame"><a href="cancelAnimationFrame.html">cancelAnimationFrame</a></li><li data-name="Cartesian2"><a href="Cartesian2.html">Cartesian2</a></li><li data-name="Cartesian3"><a href="Cartesian3.html">Cartesian3</a></li><li data-name="Cartesian4"><a href="Cartesian4.html">Cartesian4</a></li><li data-name="Cartographic"><a href="Cartographic.html">Cartographic</a></li><li data-name="CartographicGeocoderService"><a href="CartographicGeocoderService.html">CartographicGeocoderService</a></li><li data-name="CatmullRomSpline"><a href="CatmullRomSpline.html">CatmullRomSpline</a></li><li data-name="Cesium3DTile"><a href="Cesium3DTile.html">Cesium3DTile</a></li><li data-name="Cesium3DTileColorBlendMode"><a href="Cesium3DTileColorBlendMode.html">Cesium3DTileColorBlendMode</a></li><li data-name="Cesium3DTileContent"><a href="Cesium3DTileContent.html">Cesium3DTileContent</a></li><li data-name="Cesium3DTileFeature"><a href="Cesium3DTileFeature.html">Cesium3DTileFeature</a></li><li data-name="Cesium3DTilePointFeature"><a href="Cesium3
</div>
</div>
<script>
if (window.frameElement) {
document.body.className = 'embedded';
var ele = document.createElement('a');
ele.className = 'popout';
ele.target = '_blank';
ele.href = window.location.href;
ele.title = 'Pop out';
document.getElementById('main').appendChild(ele);
}
// Set targets on external links. Sandcastle and GitHub shouldn't be embedded in any iframe.
Array.prototype.forEach.call(document.getElementsByTagName('a'), function(a) {
if (/^https?:/i.test(a.getAttribute('href'))) {
a.target='_blank';
}
});
</script>
<script src="javascript/prism.js"></script>
<script src="javascript/cesiumDoc.js"></script>
</body>
</html>