PDA

View Full Version : NVidia path render extension



H. Guijt
11-07-2014, 05:55 AM
I'm trying to use this extension to draw high-quality, high-performance graphs. The graphs consist of potentially millions of line-pieces (this is data coming from various scientific measurements). I can draw this using operating system functions, which is fast but ugly (no anti-aliasing, no support for dashing/linewidth combinations, no transparency), or using Cairo, which doesn't suffer any of these drawbacks but is of course much slower. The path render extension offers a third option, which is about as fast as OS rendering, and as pretty as Cairo, so that's good. I still have some questions though:

- Is there any place where good documentation on all the path render functions and options can be found? The SDK offered by NVidia doesn't even begin to explain what everything is. For example, take this function call:

glCoverStrokePathNV (MyPath, GL_BOUNDING_BOX_NV);

Why should I pass GL_BOUNDING_BOX_NV? Why not GL_CONVEX_HULL_NV? As far as I can tell the first one is (much - up to 4x) faster, but what is the difference and when should one be preferred over the other?

- I'm actually somewhat disappointed by the overal performance. Sure, it is just as fast as rendering non-antialiased lines using OS calls... But shouldn't I be able to get much better performance from a powerful GPU? My draw calls use glPathCommandsNV(), with very long arrays of floating point coordinates (30,000 line pieces is no exception). Drawing seems limited by the number of line pieces - the number of fragments actually written seems to not matter at all. Are there any performance tricks or pitfalls I should be aware of in this scenario?

- So far I have only tested on my development PC, which has a 560ti in it. Would performance be better on high-end cards? Or is it limited by other factors such as buffer transfers?

GClements
11-07-2014, 10:26 PM
For example, take this function call:

glCoverStrokePathNV (MyPath, GL_BOUNDING_BOX_NV);

Why should I pass GL_BOUNDING_BOX_NV? Why not GL_CONVEX_HULL_NV? As far as I can tell the first one is (much - up to 4x) faster, but what is the difference and when should one be preferred over the other?

I would expect a convex hull to have a higher per-segment setup overhead than a bounding box, but to touch fewer fragments (particularly if the shape is long, thin, and diagonal with respect to the path's coordinate system). In which case, a bounding box would be preferred if you have many path segments bounded by a small rectangle, while a convex hull would be preferred if you have few path segments but the bounding box has a significantly larger area than the convex hull.



- I'm actually somewhat disappointed by the overal performance. Sure, it is just as fast as rendering non-antialiased lines using OS calls... But shouldn't I be able to get much better performance from a powerful GPU?
I would expect the GPU to offer a greater improvement for paths with fewer segments, and for filling rather than stroking. The extension appears to be oriented toward letting you fill "polygons" which are arbitrary PostScript/SVG-style paths, rather than for accelerating line-drawing per se.

H. Guijt
11-08-2014, 05:32 AM
I forgot another question I was meaning to ask... When I enable debug output (using glDebugMessageCallback), every invocation of glStencilStrokePathNV results in the following message:

source=API; type=other; severity=notification; ID=0x00020071; Buffer detailed info: Buffer object -1073823746 (bound to NONE, usage hint is GL_STATIC_DRAW) will use VIDEO memory as the source for buffer object operations.

Should I be worried about this? Am I doing something incorrectly, or suboptimally?

Dimitris
11-08-2014, 07:39 AM
hello. I just started use openGL and i am strangling.......I have to build a simple spaceship game that shout's asteroids. Initially i made the spaceship which is basically a triangle and the rotation of it.Now i am trying to build a moving background of stars.I am using points as stars. I made the code for the point..... so i build only one point how can i build 100 points random points using "array" and moving background? This my first question. I am very new in openGL and i can not understand properly how it works...... can someone help me please???

2nd question is how can i make the ship shouting the asteroids and the asteroids will disappear? can someone tell me the commands and how to apply them and explain me what they do please????