kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #04278
Re: Re: wxDC & wxGraphicsContext Test
-
To:
kicad-devel@xxxxxxxxxxxxxxx
-
From:
Vesa Solonen <vsolonen@...>
-
Date:
Thu, 18 Feb 2010 21:47:01 +0200
-
In-reply-to:
<20100218184227.166280@...>
-
User-agent:
Thunderbird 2.0.0.23 (X11/20090817)
Torsten Hüter kirjoitti:
> OpenGL is the hottest candidate if it should be *fast*. Most KiCad
> graphic primitives are lines, then circles, arcs - circles are easy to
> draw (with gluDisc), arcs need perhaps our own implementation.
> In my opinion a pure OpenGL variant should be considered; already the 3D
> view of KiCad is faster than the wxGC main screen.
As an observer this graphics discussion seems somewhat similar to that
of gEDA project's. If one has some time to spend, go read some threads
on geda-dev and later geda-user. The end result was Cairo for schematics
(with lines grid fitting and serious antialiasing tunings) and raw
OpenGL for layout. There may at least be some implementation details to
borrow. Cairo's OpenGL backend has been in the makings for five or so
years, but the current state is somewhat unknown. Does any of the
distros even ship it? One should remember that it's not quite backend
developers fault as (free)driver situation is just lately getting into
shape.
You can also see that KiCad 3D is in no way optimized regarding
primitives grouping, so I bet even more speed is there if it is needed.
By clever "scene manipulation", leaving out or reducing rendering
precision for too small stuff there is very much potential for savings
too. There is probably no point rendering to much more precision than
there are pixels on the screen (antialiasing needs more naturally). If
we want KiCad really scale up, say motherboard level designs, rendering
cleverness is a must not just a nice thing to have. I guess in
architectural CAD, every nail and screw is not renedered on every zoom
level, even if they are in the model... For OpenGL the possibilities of
merging 3D features/viewing to PCB editor is a very nice bonus too.
Some cons to consider are the work needed and rendering quality
variations depending on hardware and software. I like smooth arcs and
circles and fonts, btw. At least in open drivers such an important
feature as line smoothing is mostly missing or of bad quality. The best
I have seen is r200 which has HW-based line smooth. R300 doesn't do it
at all (no proper shader program) and Intel 965 does, but with bad
quality. What OpenGL level to choose for a baseline?
My practise on the subject has been limited to just plotting some live
data with >25Hz update rate and OpengGL was the only way I could achieve
it reliably and in decent quality. In python with GL_LINE_STRIP vertex
array.
-Vesa
References