If this was to cone to Linux what would you recommend, OpenGL, Vulkan or something else ?
Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
31–40 of 58 posts
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#32Congratulations! Can you say how the it's similar and how it's different to superficially similar sounding work? (1) https://github.com/linebender/vello , dual Apache/MIT, by Raph Levien et al (2) https://sluglibrary.com/ , proprietary, by Eric Lengyel (Terathon)
Slug is primarily designed for text rendering. Vello is general purpose, like Rasterizer, but is based on GPU compute. Rasterizer uses the 'traditional' GPU pipeline. Performance numbers for both look very competitive, although Vello seems to have issues with GPU lock up at certain zoom scales. Rasterizer has been heavily tested with huge scenes at any scale.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#33Earlier quoted context omitted.
None of that yet. The underlying SVG library, nanosvg, is very simple with no text support. The first priority was to solve paths to pixels efficiently, including text (50,000 glyphs @ 60fps). Gradients will be added when time allows, as I have code from a previous engine. The coverage algorithm can be extended to support cheap box blurs, which could be used for drop shadows.
Ah ok cool! So what path to this being used in applications do you have in mind? Are you hoping to implement a decent part of the spec in the coming years? Do you have a rough timeline?
Fleshing out the spec is planned, but I cannot provide a timeline as this has all been done at my own considerable expense. Maybe if my tips grow: https://paypal.me/mindbrix
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#34Nice :) If this was to cone to Linux what would you recommend, OpenGL, Vulkan or something else ?
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#35Nice work, without having looked at your particular shader code, I can only imagine the horrors and countless of hours that went into writing and debugging the shader code... Which OpenGL and GLSL versions are you targeting? I've been thinking about possibly prototyping integrating an SVG renderer into my game engine that would rasterize the textures from .svg files on content load. Would offer some benefits of impro…
The current version uses Metal. I haven't even considered GPU ports yet, as my methodology is to get it working well on one platform first.
For single-pass SVG --> texture, a CPU approach would probably offer the lowest latency. For repeat passes, the GPU would probably win.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#36I've been working on this problem on and off for over 10 years. AMA ;-)
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#37This looks juicy! :) @mindbrix does it blend colors in linear space/are colors linearized internally?
Once you do color space correct color mixing you realize that people actually expect the wrong result, i.e. the result you get from mixing in sRGB and then you have to make the rendering output visually more "correct" by making it incorrect. One of the cases where the correct computation is the wrong answer. Heck, that's what people expect with CSS for example.
You can switch between CG and Rasterizer in the demo app using the 0 key to see the difference for yourself.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#38It uses this "personal use zlib license" And So earlier it was actually licensed under the zlib license which I think of as in something similar to the MIT license (I think, I am not a lawyer)
My issue with this is that the personal use zlib license to me feels like its made up by the author, and that you need to contact the author for a commerical license?
At this point, he should've just used something like a dual license with AGPL + commerical license.
Honestly, I get it, I also wish that there was some osi compliant that made open source make sense as a developer as open source is a really weak chain in this economy and I get it, but such licenses basically make your project only source available.
I have nothing wrong with that and honestly just wanted this to be discussed here. I had a blast looking at all the licenses in wikipedia or opensource.com website. Artistic license seems really cool if you want relicense or something. I am looking more into it. I genuinely wish if something like sspl could've been considered open source as it doesn't impact 90% of users and only something like aws/big tech.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#39Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#40Congratulations! Can you say how the it's similar and how it's different to superficially similar sounding work? (1) https://github.com/linebender/vello , dual Apache/MIT, by Raph Levien et al (2) https://sluglibrary.com/ , proprietary, by Eric Lengyel (Terathon)
Slug is primarily designed for text rendering. Vello is general purpose, like Rasterizer, but is based on GPU compute. Rasterizer uses the 'traditional' GPU pipeline. Performance numbers for both look very competitive, although Vello seems to have issues with GPU lock up at certain zoom scales. Rasterizer has been heavily tested with huge scenes at any scale.