任意几何图形的外观(例如,与
EllipsoidSurfaceAppearance
相反)
支持材质着色。Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | optional
具有以下属性的对象:
|
Example:
var primitive = new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.WallGeometry({
materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat,
// ...
})
}),
appearance : new Cesium.MaterialAppearance({
material : Cesium.Material.fromType('Color'),
faceForward : true
})
});
Demo:
See:
Namespaces
Members
当
true
时,几何体应该这样闭合
MaterialAppearance#renderState
已启用背面消隐。
如果查看器进入几何体,它将不可见。-
Default Value:
false
当
true
时,碎片着色器翻转曲面法线
如有必要,确保观察者避开法线
暗点。当几何体的两侧都应该
阴影像WallGeometry
。-
Default Value:
true
当
true
时,在片段着色器中使用平面着色,
这意味着照明不考虑在内。-
Default Value:
false
片段着色器的GLSL源代码。完整片段着色器
按照程序构建源时考虑到
MaterialAppearance#material
,
MaterialAppearance#flat
和MaterialAppearance#faceForward
。
使用MaterialAppearance#getFragmentShaderSource
获取完整源代码。material : Material
用来确定碎片颜色的材料。不像其他的
MaterialAppearance
属性,这不是只读的,因此外观的材质可以动态更改。-
Default Value:
Material.ColorType
See:
readonly materialSupport : MaterialAppearance.MaterialSupportType
此实例支持的材质类型。这会影响所需的
VertexFormat
以及顶点和碎片着色器的复杂性。-
Default Value:
MaterialAppearance.MaterialSupport.TEXTURED
WebGL修复了渲染几何体时要使用的函数状态。
The render state can be explicitly defined when constructing a MaterialAppearance
instance, or it is set implicitly via MaterialAppearance#translucent
and MaterialAppearance#closed
.
当
true
时,几何体看起来是半透明的。-
Default Value:
true
readonly vertexFormat : VertexFormat
此外观实例与
VertexFormat
兼容。
一个几何体可以有更多的顶点属性并且仍然是兼容的
潜在的性能成本-但它不能少。-
Default Value:
MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat
顶点着色器的GLSL源代码。
Methods
按程序创建完整的GLSL片段着色器源。对于
MaterialAppearance
,
它来自MaterialAppearance#fragmentShaderSource
,MaterialAppearance#material
,
MaterialAppearance#flat
和MaterialAppearance#faceForward
。Returns:
完整的GLSL片段着色器源。
创建渲染状态。这不是最终渲染状态实例;而是,
它可以包含与渲染状态相同的渲染状态属性子集
在上下文中创建。
Returns:
渲染状态。
基于
MaterialAppearance#translucent
和Material#isTranslucent
确定几何体是否半透明。Returns:
如果外观是半透明的,则为
true
。Type Definitions
Properties:
Name | Type | Description |
---|---|---|
vertexFormat |
VertexFormat | |
vertexShaderSource |
String | |
fragmentShaderSource |
String |