帶有顏色屬性和
new PolylineColorAppearance(options)
PolylineGeometry
或GroundPolylineGeometry
的GeometryInstance
實(shí)例的外觀。這允許使用相同的Primitive
繪制多個(gè)幾何圖形實(shí)例,每個(gè)實(shí)例的顏色都不同。
Parameters:
options
(Object)
Name | Description |
---|---|
options.translucent
Boolean
default true
|
當(dāng)true 時(shí),幾何體將顯示為半透明,因此PolylineColorAppearance#renderState 啟用了alpha混合。
|
options.vertexShaderSource
String
|
可選的glsl頂點(diǎn)明暗器源覆蓋默認(rèn)的頂點(diǎn)明暗器。 |
options.fragmentShaderSource
String
|
可選的glsl fragment shader source覆蓋默認(rèn)的fragment shader。 |
options.renderState
RenderState
|
可選的渲染狀態(tài)以覆蓋默認(rèn)的渲染狀態(tài)。 |
Example
// A solid white line segment
var primitive = new bmgl.Primitive({
geometryInstances : new bmgl.GeometryInstance({
geometry : new bmgl.PolylineGeometry({
positions : bmgl.Cartesian3.fromDegreesArray([
0.0, 0.0,
5.0, 0.0
]),
width : 10.0,
vertexFormat : bmgl.PolylineColorAppearance.VERTEX_FORMAT
}),
attributes : {
color : bmgl.ColorGeometryInstanceAttribute.fromColor(new bmgl.Color(1.0, 1.0, 1.0, 1.0))
}
}),
appearance : new bmgl.PolylineColorAppearance({
translucent : false
})
});
Members
(static, constant) VERTEX_FORMAT : VertexFormat
(readonly) closed : Boolean
當(dāng)
true
時(shí),幾何圖形將關(guān)閉,因此PolylineColorAppearance#renderState
啟用背面剔除。這總是false
表示PolylineColorAppearance
。
-
Default Value:
false
(readonly) fragmentShaderSource : String
片段明暗器的glsl源代碼。
material : Material
此屬性是
Appearance
接口的一部分,但PolylineColorAppearance
不使用,因?yàn)槭褂昧送耆远x的片段明暗器。
-
Default Value:
undefined
(readonly) renderState : Object
呈現(xiàn)幾何圖形時(shí)要使用的WebGL固定函數(shù)狀態(tài)。
在構(gòu)造PolylineColorAppearance
實(shí)例時(shí),可以顯式定義呈現(xiàn)狀態(tài),或者通過PolylineColorAppearance#translucent
隱式設(shè)置呈現(xiàn)狀態(tài)。
translucent : Boolean
當(dāng)
true
時(shí),幾何體將顯示為半透明,因此PolylineColorAppearance#renderState
啟用了alpha混合。
-
Default Value:
true
(readonly) vertexFormat : VertexFormat
此外觀實(shí)例與之兼容的
VertexFormat
。幾何體可以有更多的頂點(diǎn)屬性,并且仍然是兼容的(以潛在的性能代價(jià)),但是它不能有更少的頂點(diǎn)屬性。
-
Default Value:
PolylineColorAppearance.VERTEX_FORMAT
(readonly) vertexShaderSource : String
頂點(diǎn)明暗器的glsl源代碼。
Methods
getFragmentShaderSource() → {String}
程序創(chuàng)建完整的glsl片段明暗器源。
創(chuàng)建渲染狀態(tài)。這不是最終的渲染狀態(tài)實(shí)例;相反,它可以包含與上下文中創(chuàng)建的渲染狀態(tài)相同的渲染狀態(tài)屬性的子集。
確定幾何圖形是否基于
PolylineColorAppearance#translucent
半透明。