Questions concerning Vector Graphics

Started by
4 comments, last by Antheus 14 years, 3 months ago
Hey, I have a couple of questions concerning Vector vs Raster Graphics. Basicly Vector Graphic Images are simply a collection of formulas while Raster Images (bitmaps) are matrixes in which every component contain the colour of a pixel. I know that much. So .. Would that mean that Vector Graphics ... suffer alot less from alaising? ... performance would remain unchanged at higher resolutions? ... performance would depend on the complexiticy of the formulas? Raster Graphics ... would be better at lower resolutions, performance-wise? ... simply easier to work with? I'm really curious about what the performance advantages are of Vector Graphics compared to Raster Graphics (bitmaps), especially at higher resolutions. Links to some articles would be more then welcome! I'm really thirsty for some juicy info.
Advertisement
Would that mean that Vector Graphics
... suffer alot less from alaising?
Yes
... performance would remain unchanged at higher resolutions?
No, other things like fill rate and complexity can cause increased cost in higher resolutions as you still need to determine what color to make more pixels on the screen. Might be less of an increase than with raster graphics though.
... performance would depend on the complexiticy of the formulas?
Yes

Raster Graphics
... would be better at lower resolutions, performance-wise?
Again, varies based on the data/formulas you are working with.
... simply easier to work with?
I would assume simplicity here is based mostly on what people are use to using.

Other considerations would be that graphics cards are typically optimized for working with rasterizers and not vector graphics, so although in a software rendered some things would be cheaper for a vector graphics renderer it wouldnt necessarily be as such when hardware accelerated.
// Full Sail graduate with a passion for games// This post in no way indicates my being awake when writing it
A couple of months ago I tried to write a basic GPU-accelerated renderer. I had to drop it for a while since my work is taking me too much attention but I feel I could share something of the experience, keep in mind that I am not speaking from the viewpoint of an user but from an "internal" perspective.

Quote:Does vector graphics suffer alot less from aliasing?
In theory yes. Writing vector rasterization code is often difficult. My system, which was still on its early stages had to cut some corners. As a result, the produced output were aliased.
The difference is mainly perceptive. With raster one tends to go blocky or, more typically to go blurry using bi/trilinear with some aniso.
With GPU accelerated vector rendering, the result is that bounduary computations have to be approximated. As pointed out by Blinn and Loop this isn't exactly a cakewalk. The result of the aliased edges is a very noticeable high-energy seam I personally find way less appealing than raster's blurriness.

The problem is exacerbated by the fact rasters are meant to be useful. For example, in a X360 game, all textures would be built using a target resolution of 720p, resulting in a certain texel count and a minification/magnification factor that can be somehow estimated and controlled.
Vectors are typically worshiped as the holy grail of infinite resolution, but the result is that in typical scenarios the zoom level is generally limited. It is also worth noting that FP hardware will often just go nuts at a certain point. Not even pure fractals can be indefinably zoomed in (with naive approaches).

Comparing a 64x64 texture to a vector graphic image just doesn't make sense. I've seen a few cases in which the raster graphic looked just better than the vector one at essentially all available resolutions. Considering a magnification factor of 200X just does not make any sense to me in the beginning.
The benefit of the more compact representation is limited to certain specific scenarios. By sure it is not there for any PC built after year 2000.
Quote:Does vector graphics performance remain unchanged at higher resolutions?
As dclyde says, performance typically changes. I expect to find out border pixels to be constantly more involved to render. I disagree with him/her when (s)he says that the performance loss "Might be less of an increase than with raster graphics though". Based on my experience with this prototype rasterizer, vector performance is always lower, and it'll go even lower when proper antialiasing will be added. Even 1024x1024 textures go faster than the simplest vector shader I've used (the one proposed by Blinn) on fragment-processing weak (low end to low-midrange) cards.
On faster cards, there's not even a clear cut since I haven't managed to envision a meaningful benchmark, but I don't expect vector rasterization to beat the highly tuned texture processing & filtering units any time soon, regardless of BW constraints of computational effort.
Texture conics, an alternative approach by Gustavson, seem to run even slower due to the more complex fragment shader. In practice this approach is also less resilient to FP errors and I often spotted slight mismatches in the rasterized vector textures. Maybe driver optimizations have something to deal with those small errors.
Quote:Does vector graphics performance depend on the complexiticy of the formulas?
If you think at it in terms of formulas... but generally, the only formula that is available is quadratic/cubic bezier (Blinn-Loop) and conic section (Gustavson), instanced multiple times. If you want to think at the resulting image as the composition of multiple formulas then yes, performance depends on the complexity, but I think you're stretching it a bit. Sure, Inkscape will allow you to draw cubes, ovals and such, often using the appropriate encoding, I am not sold on the need to provide those features.

Quote:Would raster graphics be better at lower resolutions, performance-wise?
As I said above, generally yes, and also probably looks better (.dds has support for explicit mipmaps, which I don't support nor plan to do any time soon, but it's worth noticing).
Maybe you have figured out and written the best rasterizer around encapsulating psico-optic metrics for 'better looking result'... I am still not sold you could beat a humanly-optimized raster, in many cases.
Quote:Would raster graphics simply easier to work with?
Raster graphics is massively easier on GPUs. They understand it natively. They have been doing so since... I guess 'last century' is the more appropriate term.

Quote:I'm really curious about what the performance advantages are of Vector Graphics compared to Raster Graphics (bitmaps), especially at higher resolutions.
For me, there's no performance advantage. There's a resource usage advantage at high resolution for sure, whatever this counts something depends on your budget so I'd say the neither technique has a serious advantage on the other.

EDIT: added a line on bounduary edges.

Previously "Krohm"

Thanks both for your clearing up a thing or two.

However, I don't really believe Vector Graphics are as bad as you make them out to be, Krohm.

If I understand the differences between Vector Graphics and Raster Images well enough then wouldn't that mean Vector Graphics Games have shorter loading times and alot higher texture image quality at higher resolutions?

I also find it difficult to believe that Vector Graphics are slower then loading Bitmaps. Very complex ones, sure, but you said that even the fastest vector shader was slower then a 1024x1024 bitmap. I'll to ask more around.

The reason I'm interested in this is because GPUs are slowly being used for more then just games so we're seeing more and more fixed-function units removed in favour of General Purpose Units. Using Vector Graphics could allow them to get rid of Texture Units in favour of more Vector/Streaming Processing Units for decent/comparable performance.

And to end this post with a question: Wouldn't Vector Graphics be small enough to be run on on-chip-memory?
Quote:Original post by CAPS
If I understand the differences between Vector Graphics and Raster Images well enough then wouldn't that mean Vector Graphics Games have shorter loading times and alot higher texture image quality at higher resolutions?
You seem to not understand how a content pipeline is supposed to work.
When a PRO draws a texture, the texture is designed to work at a certain resolution. Say 720p or 1080p. There's nothing as "higher resolution" in many cases - consoles won't give you a choice, but even on PC, there's little to gain if the texture was designed for 1080p texel density.

Sure, Quake2 looks like crap at 1920x1080, and this happens because the assets weren't authored to be used at that resolution.
So, in theory your expectation is founded.
In practice, you're targeting an inappropriate resolution / dropping the high-res capable systems since the start.

Quote:Original post by CAPS
I also find it difficult to believe that Vector Graphics are slower then loading Bitmaps. Very complex ones, sure, but you said that even the fastest vector shader was slower then a 1024x1024 bitmap. I'll to ask more around.
Maybe that's me but I think I was rather clear on the fact I was speaking about rendering them (as opposed to loading).
Maybe I overlooked some wording and I apologize for that, but I never, ever wanted to comment on loading performance.

Previously "Krohm"

Quote:Original post by CAPS
... suffer alot less from alaising?

Yes, but analog vector displays are hard to come by. To display vector graphics on raster display, rasterization must be performed, at which point only the quality of rasterizer will determine the amount of aliasing.

Quote:... performance would remain unchanged at higher resolutions?

No. Vector graphics can be displayed on either analog vector display, in which case there is no resolution, or on raster display, where time to display scales with resolution as well as number of objects that are rendered.
Quote:... performance would depend on the complexiticy of the formulas?

Not necessarily. This is the rasterization vs. ray-tracing argument. Ideally, one needs to display w*h pixels, the rest is a matter of finding this pixel.

In practice, vector graphics are incredibly slow, so various caching and precomputation schemes are used to make them usable. Instead of displaying them, they are rendered onto raster, and the raster is blitted.

Rasterization of vector graphics will invariably introduce some overdraw, whereas generic vector representation of overlapping primitives will incur either considerable overdraw, or require extensive visibility culling. Either way, the only possible way for vector graphics to do less work than raster is if majority of image is transparent.

But even in this case it is a moot point, since display hardware needs to render "transparent" pixels as well. So simply put - vector rasterization will always require more work than simple raster blit (on raster hardware).

Quote:... would be better at lower resolutions, performance-wise?
Raster graphics displayed on raster display without resizing are a matter of blit. This is either a NOP (if imagi is already in frame buffer, or a memcpy equivalent, which is limited by memory bandwidth).
Quote:... simply easier to work with?
Hammer vs. screwdriver. Right tool for the job and apples to oranges comparison.

Quote:I'm really curious about what the performance advantages are of Vector Graphics compared to Raster Graphics (bitmaps), especially at higher resolutions.


Vector graphics are slow since each shape must be rasterized. So the complexity is a factor of number of shapes, the constant factor overhead of post-processing (anti-aliasing) as well as target resolution.

In addition, unless the vector graphics are fully expressable via one of GPU-friendly techniques (OGL, DX), they will need to be rendered by CPU, which is several orders of magnitude slower.

As mentioned, fast vector graphics use raster caches to make them suitable for raster-based hardware which is in almost exclusive use today.


Vector graphics are used to provide resolution-independent storage. That is all. And as every logo designer will tell you, no image scales in practice. What works well on business card will not work for billboard.

Custom drawn icons targeting specific resolution will always look better than a vector image scaled to same resolutions - assuming adequate artistic effort. Vector graphics provide a convenient and flexible representation, but strictly depend on targeted resolutions.

This topic is closed to new replies.

Advertisement