mapbox-gl添加下雪效果
原理: webgl制作snowing效果 叠加上一个制作的snowing canvas到mapbox gl的canvas下面 效果: 源码: <! DOCTYPE html > < html lang ="en" > < head > < meta charset ="UTF-8" > < title > Title </ title > < style > #canvas { position : absolute ; top : 0 ; left : 0 ; height : 100% ; width : 100% ; } </ style > </ head > < body > < canvas id ="canvas" ></ canvas > < script src ="../resources/webgl-utils.js" ></ script > < script id ="2d-vertex-shader" type ="x-shader/x-vertex" > attribute vec2 a_position; uniform vec2 u_wh; void main() { gl_PointSize = 4.0 ; vec2 t1 = a_position * 2.0 / u_wh ; vec2 t4 = vec2(t1.x - 1.0 ,(t1.y -