我决定不从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;
- uniform vec2 iResolution;
- varying vec2 vUv;
- vec3 COLOR1 = vec3(0.0, 0.0, 0.3);
- vec3 COLOR2 = vec3(0.5, 0.0, 0.0);
- float BLOCK_WIDTH = 0.01;
- voidmain(void) {
- vec2 uv = (vUv - 0.3) * 2.0 ;
- // To create the BG pattern
- vec3 final_color = vec3(1.0);
- vec3 bg_color = vec3(0.0);
- vec3 wave_color = vec3(0.0);
- float c1 = mod(uv.x, 2.0 * BLOCK_WIDTH);
- c1 = step(BLOCK_WIDTH, c1);
- float c2 = mod(uv.y, 2.0 * BLOCK_WIDTH);
- c2 = step(BLOCK_WIDTH, c2);
- bg_color = mix(uv.x * COLOR1, uv.y * COLOR2, c1 * c2);
Arcgis 与 Claygl 可视化 glsl 特效篇(二十三) - 小专栏
标签:glsl,claygl,WIDTH,0.0,uv,Claygl,Arcgis,vec3,BLOCK From: https://www.cnblogs.com/haibalai/p/17328443.html