[Kstars-devel] [patch] improve rendering time for stars by a factor of 20

James Bowlin bowlin at mindspring.com
Mon Dec 24 22:00:12 CET 2007


On Mon December 24 2007, Jason Harris wrote:
> You can see this by dragging around the sky slowly and watching as
> the positions of the stars wobble slightly.  This actually still
> happens with the drawEllipse() code, but it's much less obvious. 

I thought we stopped anti-aliasing when slewing (dragging).  Did you
disable this feature when testing the ellipse drawing code?  I think
the code is in skymapevents.cpp line 779:

  psky.setRenderHint(QPainter::Antialiasing, (!slewing &&
     Options::useAntialias()));

> I'm trying to find a way to force the pixmap to get resampled to the
> correct floating-point pixel coordinates, but doing so might take
> away (some of) the speed advantage we've found.

I suspect re-sampling will destroy most or all speed advantage.

> Perhaps we can do something like store multiple versions of the
> pixmap cache, for stars centered on pixel edges vs. centered on pixel
> centers.

This should work but starts to get a little complicated since you will
need to have a two dimensional area of images for each picture.  I'm
guessing you will want somewhere between 5x5 and 10x10 images for
each picture.

> Maybe I should just commit what we have for now, and worry about the
> rest for 4.1...

I agree with this.  It might be hard to go from what we have now 
(anti-aliased ellipse drawing) to your faster solution since there
is a discernable degradation in quality.  But users will be going
from 3.x to the released version of 4.0 and will only see improvement.

This is another reason to include your fix in 4.0.  Then for 4.1 we can
work on the array of images solution or if that fails, just give them a
simple checkbox that will return to anti-aliased ellipse drawing.


-- 
Peace, James

Everything should be made as simple as possible, but not simpler.
                                                  -- Albert Einstein


More information about the Kstars-devel mailing list