Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] Support for Accessors for mesh in SimpleMeshLayer and scenegraph in ScenegraphLayer #9251

Open
giacomoaugello1 opened this issue Nov 14, 2024 · 1 comment
Labels

Comments

@giacomoaugello1
Copy link

Target Use Case

In many complex visualizations, the need to dynamically adjust the 3D models (meshes or scenegraphs) per feature arises based on data attributes. Currently, the mesh property in SimpleMeshLayer and the scenegraph property in ScenegraphLayer only accept a constant value, limiting users to one fixed mesh or scenegraph for the entire layer. The ability to define these properties as accessors (i.e., functions that return a mesh or scenegraph based on each individual feature’s attributes) would enhance flexibility, enabling richer, data-driven 3D visualizations.

Proposal

Enhance the SimpleMeshLayer and ScenegraphLayer to support accessors for the mesh and scenegraph properties, respectively. This would allow users to define these properties as functions that take a feature as input and return a specific mesh or scenegraph based on its attributes.

@ibgreen
Copy link
Collaborator

ibgreen commented Nov 14, 2024

The power of deck.gl comes through instanced rendering, that the same geometry is renderered multiple times in a single GPU draw call.

Having a layer that accepts different meshes for each row is performance wise more-or-less equivalent with creating one scenegraph layer per row in your table, which is why it hasn't been pursued.

That doesn't mean that it couldn't be a useful layer. Especially if only a couple of meshes are used.

Perhaps the way an application writer would choose to approach this might be to create a custom composite deck.gl layer, that adds the getMesh accessor you want, and then breaks its input table down into subtables for each unique mesh returned by the getMesh calls, and renders each of those subtables using the existing instanced mesh layers.

Done well, such a layer could potentially be contributed to the deck.gl-community repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants