An appearance for arbitrary geometry (as opposed to EllipsoidSurfaceAppearance, for example)
that supports shading with materials.
alias MaterialAppearance
- 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.closed] 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 MaterialAppearance#renderState has alpha blending enabled.
- {Boolean} [options.closed=false] When true, the geometry is expected to be closed so MaterialAppearance#renderState has backface culling enabled.
- {MaterialAppearance.MaterialSupport} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported.
- {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.
An appearance for arbitrary geometry (as opposed to EllipsoidSurfaceAppearance, for example) that supports shading with materials.
alias MaterialAppearance
- 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.closed] 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 MaterialAppearance#renderState has alpha blending enabled. - {Boolean} [options.closed=false] Whentrue
, the geometry is expected to be closed so MaterialAppearance#renderState has backface culling enabled. - {MaterialAppearance.MaterialSupport} [options.materialSupport=MaterialAppearance.MaterialSupport.TEXTURED] The type of materials that will be supported. - {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.WallGeometry({ materialSupport : Cesium.MaterialAppearance.MaterialSupport.BASIC.vertexFormat, // ... }) }), appearance : new Cesium.MaterialAppearance({ material : Cesium.Material.fromType('Color'), faceForward : true }) });
https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric|Fabric demo Sandcastle Material Appearance Demo