mirror of https://gitee.com/antv-l7/antv-l7
fix: 修复 点图层兼容问题
This commit is contained in:
parent
6a1eaaecd8
commit
82e2bcda36
|
@ -54,12 +54,12 @@ vec4 filterColor(vec4 color) {
|
|||
}
|
||||
|
||||
// TODO: 优化水波点 blend additive 模式下有的拾取效果
|
||||
vec4 filterColorAnimate(vec4 color) {
|
||||
vec4 filterColorAnimate(vec4 color, float weight) {
|
||||
// TODO: 过滤多余的 shader 计算
|
||||
if(u_shaderPick < 0.5) {
|
||||
return color; // 暂时去除 直接取消计算在选中时拖拽地图会有问题
|
||||
} else {
|
||||
return filterPickingColor(filterHighlightColor(color, color.a));
|
||||
return filterPickingColor(filterHighlightColor(color, weight));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,18 +89,19 @@ void main() {
|
|||
float intensity = clamp(cos(d * PI), 0.0, 1.0) * clamp(cos(2.0 * PI * (d * 2.0 * u_aimate.z - u_aimate.y * u_time)), 0.0, 1.0);
|
||||
|
||||
// TODO: 根据叠加模式选择效果
|
||||
if(u_additive > 0.0) {
|
||||
gl_FragColor *= intensity;
|
||||
} else {
|
||||
gl_FragColor = vec4(gl_FragColor.xyz, intensity);
|
||||
}
|
||||
|
||||
// if(u_additive > 0.0) {
|
||||
// gl_FragColor *= intensity;
|
||||
// } else {
|
||||
// gl_FragColor = vec4(gl_FragColor.xyz, intensity);
|
||||
// }
|
||||
gl_FragColor = vec4(gl_FragColor.xyz, intensity);
|
||||
// TODO: 优化在水波纹情况下的拾取(a == 0 时无法拾取)
|
||||
if(d < 0.7) {
|
||||
gl_FragColor.a = max(gl_FragColor.a, 0.001);
|
||||
}
|
||||
|
||||
gl_FragColor = u_additive > 0.0 ?filterColorAnimate(gl_FragColor) : filterColor(gl_FragColor);
|
||||
// gl_FragColor = u_additive > 0.0 ?filterColorAnimate(gl_FragColor) : filterColor(gl_FragColor);
|
||||
gl_FragColor = filterColor(gl_FragColor);
|
||||
} else {
|
||||
gl_FragColor = filterColor(gl_FragColor);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ export default class GaodeMapComponent extends React.Component {
|
|||
// none = 'none',
|
||||
// blend: 'additive'
|
||||
|
||||
let layer = new PointLayer({ zIndex: 2, blend: 'additive' })
|
||||
let layer = new PointLayer({ zIndex: 2, }) // blend: 'additive'
|
||||
.source(
|
||||
[
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue