NVIDIA GPU-accelerated Path / SVG Vector Graphics Rendering

This definitely needs attention:

(video with link without slides: http://www.youtube.com/watch?v=bCrohG6PJQE)
Try viewing for example this svg image in your browser - it'll definately kill it. This particular image renders at 35 FPS on my GPU (GTX 260) in NVIDIAs svg viewer which uses their quite new (June 2011) GL_NV_path_rendering OpenGL extension. Remarkable.
The GPU implementation doesn't implement the filters - blurring in this example - (neither does IE). I'll try to add these, I don't think they'll slow it down too much.

Read more at http://developer.nvidia.com/nv-path-rendering

Note: Many browsers claim to have GPU accelerated rendering, but this mostly only applies to the final composition of different elements (though some do have GPU text rendering).

Edit: After looking at the specification and some samples, I see that this is actually pretty complex: You can define various intermediate targets and in and outputs for filters. The easiest way to do this would of course be to render every step to a texture, then apply a shader that represents the predefined effect (one of just a handful) and repeat. However this can be optimized - e.g. a blur and offset pass can be done in one step. Applying such optimizations will require smart runtime shader compilation... let's see what we can do. It would also be interesting to implement the pathrendering with OpenGL and shaders in WebGL to provide an  alternative for the current browser's software svg rendering.

Edit 2: Not even browser/software svg renderer makers bothered to implement all of the specification, I couldn't find a browser or program that supports enable-background and renders this correctly (maybe OpenVG would):

Should look like this:

Another edit: Opera does! Looks like it's 100% compilant.

Comments

Popular posts from this blog

How to monitor a directory for changes with ReadDirectoryChangesW

Coins - Pay to Win

Fastest way to zero out memory - stream past cache with movntdq/_mm_stream_si128