WebGLCustomLayerRenderState
interface WebGLCustomLayerRenderState {
blend?: WebGLCustomLayerBlend;
cullFace?: "none" | "back" | "front";
depthFunc?:
| "never"
| "less"
| "equal"
| "lequal"
| "greater"
| "notequal"
| "gequal"
| "always";
depthTest?: boolean;
depthWrite?: boolean;
frontFace?: "ccw"
| "cw";
}
blend?: WebGLCustomLayerBlend;
cullFace?: "none" | "back" | "front";
depthFunc?:
| "never"
| "less"
| "equal"
| "lequal"
| "greater"
| "notequal"
| "gequal"
| "always";
depthTest?: boolean;
depthWrite?: boolean;
frontFace?: "ccw"
| "cw";
}
渲染状态。这是唯一能改深度 / 混合 / 剔除的入口 —— 地图对这些全局 GL 状态做了缓存, 自己调
gl.enable/gl.blendFunc会让缓存与真实状态失配、底图渲染出错, 所以只能声明式地表达,由图层统一施加并在画完精确还原