-
I want to draw a gradient line like this Here's my code so far class MyExtension extends LayerExtension {
public getShaders = () => {
return {
inject: {
"fs:DECKGL_FILTER_COLOR": `
color = vec4(1,0,0,-geometry.uv.x * 0.5);
`,
},
};
};
}
const linesLayer = new GeoJsonLayer({
data: myLInes,
// ...
extensions: [new MyExtension({})],
}); It works well for the straight lines, but looks wired on the line joints... How to handle the joints properly? |
Beta Was this translation helpful? Give feedback.
Answered by
AdriSolid
Nov 4, 2022
Replies: 2 comments 2 replies
-
An additive blending could work: parameters: {
blendFunc: [0x0302, 0x0304], // GL.SRC_ALPHA, GL.DST_ALPHA
blendEquation: 0x8006 // GL.FUNC_ADD
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lianzhao
-
Is there a way to achieve this gradient blur in both sides of the line? Currently it only displays on the right side |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An additive blending could work:
So you get something like: