Issue with blending of layers
See original GitHub issueActual Result
Lower indexed layers are visible through supposed opaque layers. The blue PathLayer
should be fully opaque however the separate [dashed] PathLayer
underneath is visible through it. The same happens with a supposed opaque white PolygonLayer
on top of a PathLayer
.
I’ve not touched any gl parameters. I am only using the high level api provided by deck.gl with core layers.
Expected Result
Lower indexed layers under a layer with no transparency should not be visible.
Reproduce Steps
Have several layers with no transparency (ie. getColor => [0, 0, 0]
) and render them over the top of each other.
Code Example
Can/will be followed up if the answer isn’t a simple one!
<PolygonLayer
id="road"
fp64={true}
coordinateSystem={COORDINATE_SYSTEM.METER_OFFSETS}
coordinateOrigin={[0, 51]}
data={roadData.lanes}
getPolygon={lane => lane.contour}
stroked={true}
lineWidthScale={0.2}
getLineColor={lane => [20, 20, 20]}
getFillColor={lane => [0, 0, 0]}
/>
<PathLayer
id="midlines"
fp64={true}
coordinateSystem={COORDINATE_SYSTEM.METER_OFFSETS}
coordinateOrigin={[0, 51]}
data={roadData.lanes}
getPath={lane => lane.midline}
getColor={lane => [246, 127, 1]}
widthScale={0.1}
rounded={true}
dashJustified={true}
getDashArray={lane => [20, 10]}
/>
<PolygonLayer
id="agents"
fp64={true}
coordinateSystem={COORDINATE_SYSTEM.METER_OFFSETS}
coordinateOrigin={[0, 51]}
data={framesData[frameIndex]}
getPolygon={agent => agent.bounds}
stroked={false}
getFillColor={lane => [255, 255, 255]}
extruded={true}
getElevation={lane => 2}
/>
<PathLayer
id="belief-follow-paths"
fp64={true}
coordinateSystem={COORDINATE_SYSTEM.METER_OFFSETS}
coordinateOrigin={[0, 51]}
data={framesData[frameIndex].filter(
agent => agent.belief_trajectories[0].length > 0
)}
getPath={agent => agent.belief_trajectories[0]}
getWidth={agent => agent.beliefs[0]}
widthScale={3}
getColor={agent => [0, 121, 165]}
/>
To Do List
- Add label and assign to milestone
- Coding
- Test
Issue Analytics
- State:
- Created 5 years ago
- Comments:6
Top Results From Across the Web
Issue with blending of layers #2039 - visgl/deck.gl - GitHub
Lower indexed layers under a layer with no transparency should not be visible. Reproduce Steps. Have several layers with no transparency (ie.
Read more >How To Merge Layer Blend Modes In Photoshop
In this Photoshop tutorial, learn how to merge multiple layers together when each layer is set to a different blend mode!
Read more >Solved: Issue with Labels and Annotation Layers Blend
I wanted to use Layer Blend effects applying a Hard Light Blend to the Annotation Layer and this happened. The Point Feature Layer...
Read more >Layer opacity and blending modes in Adobe Photoshop
A layer's blending mode determines how its pixels blend with underlying pixels in the image. You can create a variety of special effects ......
Read more >Landscape layer blending issue with more than 3 layers.
So I'm new, I've been playing around with making a landscape material with layer blended textures. If I try to use more than...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@DominusVilicus all colors in deck.gl already support both RGB and RGBA formats.
Maybe we need an RFC for this. I can update the docs in the meanwhile
I’d support adding a breaking change for this and making the default opacity
1
, and perhaps adding a feature to add opacity via thegetColor
option with an RGBA array ([0,0,0,0.5]
or ([0,0,0,255]
)