美文网首页
Cesium 自定义Material 系列 (十八)

Cesium 自定义Material 系列 (十八)

作者: haibalai | 来源:发表于2022-02-23 15:47 被阅读0次

    对于反射纹理效果 我们先定义一下他的interface, 方便使用的人知道他的调用参数

    export interface PMaterialReflection{

    cubeMap: {

    positiveX: string,

    negativeX: string,

    positiveY: string,

    negativeY: string,

    positiveZ: string,

    negativeZ: string

    },

    channels?:string,

    }

    对于反射纹理我们叫 MaterialReflection

    ```javascript

    import { MaterialProperty } from "../MaterialProperty";

    const defaultOption: PMaterialReflection = {

    cubeMap: Cesium.Material.DefaultCubeMapId,

    channels: 'rgb'

    }

    //反射效果

    export class MaterialReflection extends MaterialProperty {

    protected _getType(option: any): string {

    return "MaterialReflection"

    }

    constructor(option = defaultOption) {

    super(MaterialReflection.prototype, defaultOption, option);

    }

    protected _getTranslucent(material: any) {

    return false;

    }

    protected getSource(option: any): string {

    return `

    uniform samplerCube cubeMap;

    czm_material czm_getMaterial(czm_materialInput materialInput){

    czm_material material = czm_getDefaultMaterial(materialInput);

     更多参考 https://xiaozhuanlan.com/topic/8920573146

    相关文章

      网友评论

          本文标题:Cesium 自定义Material 系列 (十八)

          本文链接:https://www.haomeiwen.com/subject/dnqglrtx.html