Git Product home page Git Product logo

Comments (5)

yocontra avatar yocontra commented on April 28, 2024

ah, my mistake - reordering works, needs to be the last item not the first item though

from deck.gl.

locomotif avatar locomotif commented on April 28, 2024

I apologize in advance if this has been documented, is there a way for individual data points within a single layer to have a z-index? Currently I been doing what was mentioned here, essentially having individual layers for icons that i want to appear on top. I tried using the third position on the position attribute z, which is for altitude, but I guess I cannot use it for that purpose.

from deck.gl.

ibgreen avatar ibgreen commented on April 28, 2024

@locomotif Which layers are you working with? Most layers support a third (z) coordinate.

Not sure I understand your use case? Are you having z-fighting issues within your layer?

from deck.gl.

locomotif avatar locomotif commented on April 28, 2024

@ibgreen sorry for not being completely clear, and thank you for your reply. I am working with IconLayer, and PathLayer. Say I have N amount of paths rendered on a single PathLayer instance. Currently all paths have the same color, and there are some paths that overlap. I want to be able to change the color of a single path on a single PathLayer with N paths, and have it render on top of all paths. I tried sorting the data array but that didn't work.

from deck.gl.

ibgreen avatar ibgreen commented on April 28, 2024

@locomotif Controlling the order in which paths render is tricky since we use instanced rendering in deck.gl - all paths are drawn "in parallel" with a single GPU draw call - this is one of the tricks we use that are critical for deck.gl's rendering performance on big data.

It so happens that we are developing a new PathOutlineLayer on master that does what I think you want by using "shadow buffer" techniques (you can assign a z value to each path). You can test it by pulling latest master, go to examples/layer-browser and do npm run start-local to see if it does what you want.

You could try to copy it to your app, but unfortunately I will not recommend that you do that it just yet, it will likely be more pain than it is worth. You might need to use deck.gl 4.2, which is still in alpha and rapidly changing. A couple of weeks from now things should look better.

For now your best bet might be to use minuscule z deltas in the layer positions for each path (and make sure to turn on depthTest). Experiment and see what works.

from deck.gl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.