-
Notifications
You must be signed in to change notification settings - Fork 128
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
GPU-based antialiased vector rendering #550
Comments
Just to add on the GPU based text rendering - I did a port of the that gllabel implementation in Kotlin here which may be useful as an additional resource. |
Thanks @LeHaine ! I'll have a look when implementing this. What I did for now in the meantime is this experiment: https://glslsandbox.com/e#79489.2
|
To do antialiasing, I’m going to use the nanovg approach. Create a stroke around the shape lines in the center, then draw only outside the stencil with an alpha based on the distance to the center (the line) to approximate the pixel coverage. Once this is working, we can try to draw the inner of the shapes with the current approach, and then draw triangles with the curves later. This will reduce required points a lot, with less memory and points sent to the gpu. |
Non-zero winding can be implemented as what nanovg does (and Ejecta): do separate stencil operations: for front faces increment the stencil, for back faces decrement the stencil. |
For rendering huge scaled vectors, we might want to implement gpu-based vector rendering:
https://github.com/memononen/nanovg
For text, there are some tricks (either distances, or passing bezier curves to the shaders [this would require not supporting it in webgl1]):
https://github.com/azsn/gllabel
The text was updated successfully, but these errors were encountered: