内容概述
本篇文章内容
1.自定义着色器
2.生成Cesium材质
3.在entity中使用材质。
4.源码下载
效果图
1. 自定义着色器"czm_material czm_getMaterial(czm_materialInput materialInput)\n" +
"{\n" +
" czm_material material = czm_getDefaultMaterial(materialInput);\n" +
" material.diffuse = 1.5 * color.rgb;\n" +
" vec2 st = materialInput.st;\n" +
" float dis = distance(st, vec2(0.5, 0.5));\n" +
" float per = fract(time);\n" +
" if(dis > per * 0.5) {\n" +
" material.alpha = 0.0;\n" +
" discard;\n" +
" }else{\n" +
" material.alpha = color.a * dis / per / 1.0;\n" +
" }\n" +
" return material;\n"