Class/Object

cesium

Material

Related Docs: object Material | package cesium

Permalink

class Material extends Object

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 page for more details on Fabric.

<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:

alias Material

- The options object takes the following properties - {Boolean} [options.strict=false] Throws errors for issues that would normally be ignored, including unused uniforms or materials. - {Boolean|Function} [options.translucent=true] When true or a function that returns true, the geometry with this material is expected to appear translucent. - {Object} options.fabric The fabric JSON used to generate the material.

exception {DeveloperError} fabric: uniform has invalid type. exception {DeveloperError} fabric: uniforms and materials cannot share the same property. exception {DeveloperError} fabric: cannot have source and components in the same section. exception {DeveloperError} fabric: property name is not valid. It should be 'type', 'materials', 'uniforms', 'components', or 'source'. exception {DeveloperError} fabric: property name is not valid. It should be 'diffuse', 'specular', 'shininess', 'normal', 'emission', or 'alpha'. exception {DeveloperError} strict: shader source does not use string. exception {DeveloperError} strict: shader source does not use uniform. exception {DeveloperError} strict: shader source does not use material.

Annotations
@RawJSType() @native() @JSName( "Cesium.Material" )
Example:
  1. // 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) } } });

See also

wiki page for a more detailed options of Fabric. demo Sandcastle Materials Demo

Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Material
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Material(options: MaterialOptions)

    Permalink
  2. new Material()

    Permalink
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def destroy(): Unit

    Permalink
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def isDestroyed(): Boolean

    Permalink
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  16. def isTranslucent(): Dynamic

    Permalink
  17. var materials: Any

    Permalink
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  22. var shaderSource: String

    Permalink
  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. var translucent: |[Boolean, Function]

    Permalink
  27. var type: String

    Permalink
  28. var uniforms: Any

    Permalink
  29. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  30. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped