new PolylineMaterialAppearance()
PolylineGeometry's appearance supports material coloring.
| Name | Type | Default | Description |
|---|---|---|---|
options.translucent |
Boolean | true |
optional
When true, the geometry should be semi transparent, so PolylineMaterialAppearance # renderState has enabled alpha blending. |
options.material |
Material | Material.ColorType |
optional
The material used to determine the color of the fragment. |
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 rendering state, used to override the default rendering state. |
Example
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.PolylineMaterialAppearance.VERTEX_FORMAT
})
}),
appearance : new SuperMap3D.PolylineMaterialAppearance({
material : SuperMap3D.Material.fromType('Color')
})
});
Members
-
(static, constant) VERTEX_FORMATVertexFormat
-
All PolylineMaterialAppearance instances are compatible with VertexFormat. This requires the position and st attributes.
-
readonly closedBoolean
-
When true, the geometry will be turned off, so PolylineMaterialAppearance # renderState will enable backside culling. This is always incorrect for polyline material appearance.
- Default Value: false
readonly fragmentShaderSourceString
GLSL source code for fragment shader.
materialMaterial
The material used to determine the color of the fragment. Unlike other PolylineMaterialAppearance properties, it is not read-only, so the appearance material can be changed at any time.
- Default Value:
Material.ColorTypereadonly renderStateObject
The WebGL fixed feature state used when rendering geometric shapes.
The rendering state can be explicitly defined when constructing PolylineMaterialAppearance instances, or through PolylineMaterialAppearance # translated and PolylineMaterialAppearance # closed
translucentBoolean
When true, the geometry should be semi transparent, so PolylineMaterialAppearance # renderState enables alpha blending.
- Default Value: true
readonly vertexFormatVertexFormat
This appearance instance is compatible with VertexFormat, which allows a geometry to have more vertex attributes and still be compatible - at the cost of potential performance costs - but it cannot be omitted.
- Default Value:
PolylineMaterialAppearance.VERTEX_FORMATreadonly vertexShaderSourceString
GLSL source code for vertex shader.
Methods
-
getFragmentShaderSource(){String}
-
Create a complete GLSL fragment shader source on the program. For PolylineMaterialAppearance, this is derived from PolylineMaterialAppearance # fragmentShaderSource and PolylineMaterialAppearance # material.
Returns:
Type Description String Complete GLSL fragment shader source code. -
getRenderState(){Object}
-
Create presentation status. This is not the final rendering 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 Present the status. -
isTranslucent(){Boolean}
-
Determine whether the geometry is semi transparent based on PolylineMaterialAppearance # Translucent and Material # isTranslucent.
Returns:
Type Description Boolean If the appearance is semi transparent, it is True.