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

Custom "point" mark shapes #236

Open
tuner opened this issue Feb 12, 2024 · 0 comments
Open

Custom "point" mark shapes #236

tuner opened this issue Feb 12, 2024 · 0 comments
Labels
core Related to the Core package enhancement New feature or request good first issue Good for newcomers WebGL Somehow related to WebGL or GPU

Comments

@tuner
Copy link
Member

tuner commented Feb 12, 2024

This is a very low-priority issue.

Custom SVG shapes would be nice to have. Vega-Lite supports them in the shape property/channel through SVG path strings: https://vega.github.io/vega-lite/docs/point.html#properties

The custom paths could be rendered into an SDF texture, as shown in Ricky Reusser's sdf-points-with-regl notebook.
However, Ricky's notebook uses bitmap-sdf, which produces very low-quality SDFs, requiring very large texture sizes. Bitmap-sdf could be replaced with webgl-sdf-generator, which uses a different algorithm with a superior quality. Still, neither of them generates multichannel SDFs.

A significant limitation of SDF-based shapes is the rendering of strokes, which always have rounded joins, making shapes with sharp corners look quite silly:
image

To get sharp edges, pseudo distances (2.5 Pseudo-distance fields in Viktor Chlumský's thesis) could be used instead true distances. No JavaScript or WASM implementation exists, however.

@tuner tuner added enhancement New feature or request good first issue Good for newcomers core Related to the Core package WebGL Somehow related to WebGL or GPU labels Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the Core package enhancement New feature or request good first issue Good for newcomers WebGL Somehow related to WebGL or GPU
Projects
None yet
Development

No branches or pull requests

1 participant