Skip to main content
GameDev.net gamedev.net
🔒 Locked

2D Vector Graphics performance...

Started by Pavel Krupets Jan 5, 2002 at 9:37 AM 3 replies 400+ views
Original Post
Pavel Krupets
Pavel Krupets
Hello everybody! I have 1 big trouble!!! I have a 2D Vector Graphics Editor and everything is okay but: * When I have a big picture then performance is terrible. (I draw only visible objects and this problem will occur only if I draw all objects) (Editor: Win32API/GDI) I wonder how it works in AutoCAD for instance. They draw picture once quite slow and when everything is FAST!!! (even Zoom) Help please!!! P.S. Sorry it might be an off topic but I don''t know where I can ask this question.
MirekCz
MirekCz
Autocad probably uses custom drawing functions which are well optimized. Another way is to use somekind of 3d api to speed up things.
Also doubling a picture width and height makes it 4 times bigger in terms of pixel count , therefore it needs much more power to calculate etc.


With best regards,
Mirek Czerwiñski
http://kris.top.pl/~kherin/
With best regards, Mirek Czerwiñski
Countach
Countach
Most programs also draw stuff to a buffer. If something changes they can make a few modifications to the buffer and show the rest unchanged.




-------homepage - email
TerranFury
TerranFury
I''m pretty sure Autocad brteaks curves into a series of line segments. Zooming does not change this; the view has to be re-drawn if smoother curves are desired. When this breaking down of curves into line segments occurs will have to either be up tpo the program or the user. The easiest and most likely fastest way to draw all these line segments is to use OpenGL/D3D to draw them. Note that it may be faster to draw an individual triangle for each line segment rather than an API-specified line (in the case of OpenGL, that would be using GL_TRIANGLE instead of GL_LINE. I''m not sure where GL_LINE_STRIP fits in in terms of speed). Which method is faster depends on the specific driver implimentation. Of course, draw only lines within the current view, but put these lines into vertex buffers.
Dredge-Master
Dredge-Master
The buffer point made above is pretty much correct. It also depends in what mode you are using at the time.

SolidEdge (was unigraphics)
AutoCAD
Corel Dream3D (or whatever it is called now)

Back in the days of dos they were all redrawn, now it places it all in a buffer, so if you move in, it has most of the data there already. Some either have over-drawn data so it has enough data to store for a few factors of zooming in, some zoom in (eg a simple box inlargement), and then just fill in the unfilled pixels with fresh data. If you change one part of them (a line) it will only re-render the affected section of the display. It doesn''t re-draw the buffer all the time either, unlike a computer game.

Oh yeah, most of them (the above three for example) don''t use Direct3D or OpenGL (well, maybe the latest version of autocad might as I haven''t used it yet). They use their own graphics engines in them which makes the buffer thing easier to perform.



Beer - the love catalyst
good ol'' homepage
Beer - the love catalystgood ol' homepage

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.