- The options object takes the following properties
- {Boolean} [options.flat=false] When true, flat shading is used in the fragment shader, which means lighting is not taking into account.
- {Boolean} [options.faceForward=options.aboveGround] When true, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like WallGeometry
- {Boolean} [options.translucent=true] When true, the geometry is expected to appear translucent so EllipsoidSurfaceAppearance#renderState has alpha blending enabled.
- {Boolean} [options.aboveGround=false] When true, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so EllipsoidSurfaceAppearance#renderState has backface culling enabled.
- {Material} [options.material=Material.ColorType] The material used to determine the fragment color.
- {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader.
- {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader.
- {RenderState} [options.renderState] Optional render state to override the default render state.
var primitive = new Cesium.Primitive({
geometryInstances : new Cesium.GeometryInstance({
geometry : new Cesium.PolygonGeometry({
vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
// ...
})
}),
appearance : new Cesium.EllipsoidSurfaceAppearance({
material : Cesium.Material.fromType('Stripe')
})
});
An appearance for geometry on the surface of the ellipsoid like PolygonGeometry and RectangleGeometry, which supports all materials like MaterialAppearance with MaterialAppearance.MaterialSupport However, this appearance requires fewer vertex attributes since the fragment shader can procedurally compute
normal
,binormal
, andtangent
.alias EllipsoidSurfaceAppearance
- The options object takes the following properties - {Boolean} [options.flat=false] When
true
, flat shading is used in the fragment shader, which means lighting is not taking into account. - {Boolean} [options.faceForward=options.aboveGround] Whentrue
, the fragment shader flips the surface normal as needed to ensure that the normal faces the viewer to avoid dark spots. This is useful when both sides of a geometry should be shaded like WallGeometry - {Boolean} [options.translucent=true] Whentrue
, the geometry is expected to appear translucent so EllipsoidSurfaceAppearance#renderState has alpha blending enabled. - {Boolean} [options.aboveGround=false] Whentrue
, the geometry is expected to be on the ellipsoid's surface - not at a constant height above it - so EllipsoidSurfaceAppearance#renderState has backface culling enabled. - {Material} [options.material=Material.ColorType] The material used to determine the fragment color. - {String} [options.vertexShaderSource] Optional GLSL vertex shader source to override the default vertex shader. - {String} [options.fragmentShaderSource] Optional GLSL fragment shader source to override the default fragment shader. - {RenderState} [options.renderState] Optional render state to override the default render state.var primitive = new Cesium.Primitive({ geometryInstances : new Cesium.GeometryInstance({ geometry : new Cesium.PolygonGeometry({ vertexFormat : Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT, // ... }) }), appearance : new Cesium.EllipsoidSurfaceAppearance({ material : Cesium.Material.fromType('Stripe') }) });
https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric