Class: PolylineColorAppearance

PolylineColorAppearance

new PolylineColorAppearance()

This allows the use of the same Primitive to draw multiple instances of geometry, each with a different color.

Name Type Default Description
options.translucent Boolean true optional

When true, the geometry will appear semi transparent, so PolylineColorAppearance # renderState will enable alpha blending.

options.vertexShaderSource String optional

Optional GLSL vertex shader source, used to override default vertex shaders.

options.fragmentShaderSource String optional

Optional GLSL fragment shader source, used to override default fragment shaders.

options.renderState RenderState optional

Optional presentation state, used to override the default presentation state.

Example
// A solid white line segment
var primitive = new SuperMap3D.Primitive({
  geometryInstances : new SuperMap3D.GeometryInstance({
    geometry : new SuperMap3D.PolylineGeometry({
      positions : SuperMap3D.Cartesian3.fromDegreesArray([
        0.0, 0.0,
        5.0, 0.0
      ]),
      width : 10.0,
      vertexFormat : SuperMap3D.PolylineColorAppearance.VERTEX_FORMAT
    }),
    attributes : {
      color : SuperMap3D.ColorGeometryInstanceAttribute.fromColor(new SuperMap3D.Color(1.0, 1.0, 1.0, 1.0))
    }
  }),
  appearance : new SuperMap3D.PolylineColorAppearance({
    translucent : false
  })
});

Members

(static, constant) VERTEX_FORMATVertexFormat

VertexFormat vertex format compatible with all PolylineColorAppearance instances. This only requires a location attribute.

readonly closedBoolean

When true, the geometry will be turned off. PolylineColorAppearance # renderState has enabled backside culling.

Default Value:
false

readonly fragmentShaderSourceString

GLSL source code for fragment shader.

materialMaterial

This attribute is part of the Appearance interface, but PolylineColorAppearance is not used because a fully customized fragment shader is being used.

Default Value:
undefined

readonly renderStateObject

The WebGL fixed function state used when rendering geometry.

The rendering state can be explicitly defined when building PolylineColorAppearance, or implicitly set through PolylineColorAppearance # translatent. Explicitly defined during instance, or implicitly set through PolylineColorAppearance # translatent.

translucentBoolean

When true, the geometry will appear semi transparent, so PolylineColorAppearance # renderState will enable alpha blending.

Default Value:
true

readonly vertexFormatVertexFormat

This appearance instance is compatible with VertexFormat. A geometry can have more vertex attributes, but still be compatible - at the cost of potential performance costs - but not less.

Default Value:
PolylineColorAppearance.VERTEX_FORMAT

readonly vertexShaderSourceString

GLSL source code for vertex shader.

Methods

getFragmentShaderSource(){String}

Programmatically create a complete GLSL fragment shader source.

Returns:
Type Description
String Complete GLSL fragment shader source.

getRenderState(){Object}

Create a presentation state. This is not the final presentation state instance; On the contrary, it can contain a subset of presentation state attributes that are the same as those created in the context.

Returns:
Type Description
Object Rendering status.

isTranslucent(){Boolean}

Determine whether the geometry is semi transparent based on PolylineColorAppearance # translatant.

Returns:
Type Description
Boolean If the appearance is semi transparent, it is true.