material in Cesium

Cesium from entry to project implementation general directory: click

Article directory


Material in Cesium is used to define the appearance of 3D objects, including color, transparency, texture, shader, etc. Material is a special type of Globe or Primitive property that can be applied to Primitive objects, Batch in 3D Tiles, GeometryInstance, and almost any other object with geometric shapes. Cesium provides multiple types of materials to meet the needs of different scenarios, such as ColorMaterial, ImageMaterial, PolylineArrowMaterial, etc.

The following are the main properties and methods in the Material class:

Attributes

  • materialType: Returns the type of Material, such as ColorMaterial, ImageMaterial, etc.
  • uniforms: Returns the Uniform property of Material.
  • vertexShaderSource: Returns the Vertex Shader code of the Material.
  • fragmentShaderSource: Returns the Fragment Shader code of Material.
  • translucent: Returns whether the Material is a translucent material.
  • closed: Returns whether the Material is a closed material.
  • fabric: Returns the Material's Canvas 2D drawing context.

method

  • isTranslucent(): Returns whether the Material is a translucent material.
  • isClosed(): Returns whether the Material is a closed material.
  • isConstant(): Returns whether the Material is a constant material.
  • isDestroyed(): Returns whether the Material has been destroyed.
  • destroy(): Destroy the Material object.
  • getShaderProgram(context, sceneMode, closed): Get the Shader program of the Material object.
  • isTranslucent(): Returns whether the Material is a translucent material.
  • isClosed(): Returns whether the Material is a closed material.
  • isConstant(): Returns whether the Material is a constant material.
  • isDestroyed(): Returns whether the Material has been destroyed.
  • destroy(): Destroy the Material object.
  • getShaderProgram(context, sceneMode, closed): Get the Shader program of the Material object.
  • getShaderProgram(): Get the Shader program of the Material object.
  • isTranslucent(): Returns whether the Material is a translucent material.
  • isClosed(): Returns whether the Material is a closed material.
  • isConstant(): Returns whether the Material is a constant material.
  • isDestroyed(): Returns whether the Material has been destroyed.
  • destroy(): Destroy the Material object.
  • getShaderProgram(context, sceneMode, closed): Get the Shader program of the Material object.

The Material class also provides many other properties and methods, which can be consulted and used according to actual needs. When using Material, you need to choose the appropriate type according to different scenarios and needs, and set related properties and methods to achieve the desired effect.
Welcome to follow my original public account [GISer World]. This sharing ends here.
Insert image description here

Guess you like

Origin blog.csdn.net/weixin_44857463/article/details/129333660