question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with blending of layers

See original GitHub issue

Actual 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.

screenshot 2018-07-12 17 29 39

screenshot 2018-07-12 17 35 30

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:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Pessimistresscommented, Apr 11, 2019

@DominusVilicus all colors in deck.gl already support both RGB and RGBA formats.

1reaction
AlbertMarashicommented, Apr 11, 2019

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 the getColor option with an RGBA array ([0,0,0,0.5] or ([0,0,0,255])

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found