我决定不从claygl基础来讲了 直接整合arcgis与claygl可视化来讲
关于整合clagyl 有兴趣看我这篇文章 arcgis 与 claygl 引擎结合做地图可视化
我整合一个类库 后续不断更新中
npm i @haibalai/gismap4-claygl
初始化gismap4-claygl 类库, view是arcgis的sceneView对象
import { ClayglMapManager} from “@haibalai/gismap4-claygl”;
ClayglMapManager.init(view);
添加特效
import { ClayglMapManager} from “@haibalai/gismap4-claygl”;
import * as clay from “claygl”;
const fragmentShader = `
uniform float iTime;
const vec2 iResolution = vec2(1.0,1.0);
varying vec2 vUv;
#define PASS_COUNT 1
vec4 iMouse = vec4(.0, 0, 0.2, 0);
float fBrightness = 2.5;
// Number of angular segments
float fSteps = 121.0;
float fParticleSize = 0.015;
float fParticleLength = 0.5 / 60.0;
// Min and Max star position radius. Min must be present to prevent stars too near camera
float fMinDist = 0.8;
float fMaxDist = 5.0;
float fRepeatMin = 1.0;
float fRepeatMax = 2.0;
// fog density
float fDepthFade = 0.8;
floatRandom(float x)
Arcgis 与 Claygl 可视化 glsl 特效篇(二十六) - 小专栏