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);
更多参考 https://xiaozhuanlan.com/topic/8920573146