Earlier quoted context omitted.
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.
Stupid question: Why not use the hardware (fixed function) rasterizer inside the GPU? I guess that one is only optimized for triangles.
Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
41–50 of 58 posts
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#42Earlier quoted context omitted.
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.
Stupid question: Why not use the hardware (fixed function) rasterizer inside the GPU? I guess that one is only optimized for triangles.
Rasterizer can solve quadratic curves in the fragment shaders, which massively reduces the geometry needed for a scene.
Also, the native rasterizer only supports MSAA, which is inferior to reference analytic area AA.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#43I've been working on this problem on and off for over 10 years. AMA ;-)
From what I recall they are converting it to triangles. Your solution (curves in the shaders?) seems both cheaper and more accurate, so I'm wondering if they could use it!
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#44https://developer.download.nvidia.com/assets/gamedev/files/N...
and this:
https://developer.nvidia.com/nv-path-rendering-videos
The faq points 30 & 31 say it use multisampling (up to 32 samples per pixel) for AA, and the winding at each sample is calculated analytically from the curve.
From other searching, it seems no other vendor supports that extension.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#45Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#46Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#47I've been working on this problem on and off for over 10 years. AMA ;-)
Mark Kilgard surveyed some path rendering engines with a few curves that most have trouble with. It’d be fun to see how Rasterizer stacks up, and perhaps a nice bragging point if you dominate the competition. https://arxiv.org/pdf/2007.12254
Having used the quadratic solver code that you found on ShaderToy (sqBezier), you might be able to shave some cycles by doing a constant-folding pass on the code. It can be simplified from the state it’s in. Also the constant in there 1.73205 is just sqrt(3), and IMO it’s nicer to see the sqrt(3) than the constant, and it won’t slow anything down, the compiler will compute the constant for you. Also, it might be nice to additionally link to the original source of that code on pouet.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#48I find that caching of renders brings orders of magnitude higher performance when using the native iOS / macOS canvas, however I get the feeling that there is really a limit to the direct drawing performance possible with a canvas API. I haven’t tried this yet so I’d be happy to be surprised.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#49Wow, that is an amazing piece of work, more so because it is so small. You should probably be more explicit about commercial licensing so companies that want to use it know where and how to contact you.
Re: Rasterizer: A GPU-accelerated 2D vector graphics engine in ~4k LOC
#50I recall many years ago nvidia released an openGL extension for rasterizing vectors/svg type stuff. A bit of googling found this from 2011: https://developer.download.nvidia.com/assets/gamedev/files/N... and this: https://developer.nvidia.com/nv-path-rendering-videos The faq points 30 & 31 say it use multisampling (up to 32 samples per pixel) for AA, and the winding at each sample is calculated analytically from the…