[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Bump mapping



On Wed, 30 Jun 2004, Jasper Phillips wrote:
> For 380x360  I got  .35 seconds for a ~3.7x speed improvement.
> For 1220x840 I got 1.30 seconds for a ~7.5x speed improvement.
> For the next size up (~2000x2000) it appears to suck up memory/cpu and hang!
> Not sure what's going on here. :-/

[snip]

> def expandShadeMap( shade, (wOrig,hOrig), (wEnd,hEnd) ):
>     '''Tile the shade surfarray up to newSize'''
>     xTiles = (wEnd+wOrig)/wOrig
>     yTiles = (hEnd+hOrig)/hOrig
>     shade  = N.concatenate((shade,)*xTiles,0)
>     shade  = N.concatenate((shade,)*yTiles,1)   #!!! Hangs?!
>     return shade[:wEnd,:hEnd,...]

Its hanging on the y-axis N.concatenate().  Memory and CPU usage spike, but
then idle back -- yet the program doesn't move on!  The Y concatenate
results in a height a bit over 2048, but the X concatenate's resulting width
is under 2048...

Is there some sort of 2048 limit here?  If so, why does it idly hang instead
of throw an exception?  How can it do nothing, and yet not move forward?
Baffling. :-/

-Jasper