Cesium 自定义Material 系列 (十八)

  • 对于反射纹理效果 我们先定义一下他的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);
posted @ 2022-01-20 17:12  haibalai  阅读(44)  评论(0编辑  收藏  举报