3 ms·
The basic problem is that, without compute, you either have to encode the vector scene into GPU primitives (triangles) as quickly as possible, and all the ways
by pcwalton 6y ago
The basic problem is that, without compute, you either have to encode the vector scene into GPU primitives (triangles) as quickly as possible, and all the ways I know of to do that either involve (a) an expensive CPU process or (b) a cheap CPU process but way too much overdraw on GPU side. Compute gives you the best of both worlds, allowing you to upload outlines directly to GPU and do the processing necessary to lower them to primitives on the GPU itself.
Pathfinder in there is actually using regular old GPU rasterization with triangles and so forth, and I'm fairly confident it's about as fast as you can go at D3D10 level (i.e. no compute shaders) without sacrificing quality. Note that the numbers can vary wildly depending on hardware. On my MacBook Pro, with a powerful CPU and limiting myself to the Intel integrated GPU only, Pathfinder is actually about equal to the GPU compute approach on a lot of scenes like the tiger, though it uses a lot of CPU.
- stephc_int13 6y agoIs it true for all 2D rendering? From my intuition, this seems pretty specialized for vector-like rendering, with a lot of small bezier shapes.
- pcwalton 6y agoYeah, when I say 2D I mean vector art. There are a lot of things under the heading of 2D rendering, such as blitting raster sprites, that are much closer to being solved problems. (Though you might be surprised--power concerns, coupled with greatly increased pixel density, have brought renewed attention to performance of blitting lately...)
- Const-me 6y ago> all the ways I know of to do that either involve (a) an expensive CPU process or (b) a cheap CPU process but way too much overdraw on GPU side That's fixable, take a look: https://github.com/Const-me/Vrmac#vector-graphics-engine https://github.com/Const-me/Vrmac#vector-graphics-engine My CPU process is moderately expensive, and I use quite a few tricks to reduce overdraw, e.g. both draw calls (the complete vector image, however complex, takes 2 draw calls to render) use hardware depth buffer and early Z rejection.