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

Thank you so much for this tutorial series! #3

Open
mehmetron opened this issue Apr 25, 2024 · 3 comments
Open

Thank you so much for this tutorial series! #3

mehmetron opened this issue Apr 25, 2024 · 3 comments

Comments

@mehmetron
Copy link

I've been learning computer graphics and webgl/webgpu for a few weeks now and this series has been wonderful!

I really look forward to your upcoming lessons on bezier curve rendering! I've been trying to implement line rendering in webgpu. Right now I'm trying to understand and copy this repo https://github.com/rreusser/regl-gpu-lines

That repo also has some amazing links at the bottom of the README about line rendering. Do you guys plan on adding a lesson about line rendering as well? I'm assuming it'd be related to bezier curve rendering unless you plan to do that in the fragment shader.

In regards to text rendering. There is this repo with very nice understandable code https://github.com/astiopin/webgl_fonts
However, it uses sdf and not msdf so for some typefaces, it can have artifacts.

Again, thank you so much! This is an awesome project! I'll try to find a way to contribute once I get a hand of this computer graphics stuff

@xiaoiver
Copy link
Owner

Thank you for your encouragement!
The next part of our tutorial will cover the drawing of lines and text.
I will read the code from https://github.com/rreusser/regl-gpu-lines.

In my previous implementation(a small rendering engine), I use the method from:
https://www.khronos.org/assets/uploads/developers/presentations/Crazy_Panda_How_to_draw_lines_in_WebGL.pdf
They also calculate vertex coords in vertex shader.

Here's the demo and you can switch to WebGL renderer with GUI.
https://g.antv.antgroup.com/en/examples/shape/polyline/#polyline

@xiaoiver
Copy link
Owner

xiaoiver commented Apr 26, 2024

I used SDF generated at runtime to draw the text before, but it does have artifacts as you said.

Maybe later I'll try some pre-generated methods like:

@xiaoiver
Copy link
Owner

xiaoiver commented Nov 5, 2024

I hope this article helps. @mehmetron
https://infinitecanvas.cc/guide/lesson-012

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

No branches or pull requests

2 participants