Re: [xmoto-dev] Z-buffer support in xmoto

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


> 
> Did you test the performance gain?
> 

Performance gain could be measured when I finish. I'm going to refactor
renderer code:
 - create one superclass for every object that can be drawn with one
   virtual method - render(Renderer*) and z-value of object
 - add to renderer methods that could be called via render(Renderer*)
   method from superclass.
 - create one vector of z-sorted objects. To draw frame renderer would
   have to scan this vector from start to end and choose objects which
   fit on screen. Also that objects can be cached to speed up rendering
   further frames. 

In current code during one frame method for choosing objects to draw is
called severla times, for exaple all visible sprites are choosen but
only this in background are rendered. During 2nd call of this function
only sprites in middle are rendered and during 3rd only sriptes in
foreground. In refactored code no function will be called - just one
scan of table. I cannot tell how big the speedup will be, but I don't
expect significant gain.
Best Regards
Janek Polak

-- 
Janek Polak
WWW: http://www.icpnet.pl/~benetnash  GnuPG: 6A1E7B75
GG: 2852217  Jabber: benetnash@xxxxxxxxxxxxx
ICQ: 473154175  Skype: benetnash86

Attachment: pgpkwrzxz6hXi.pgp
Description: PGP signature



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/