Path: chuka.playstation.co.uk!tjs From: tjs@cs.monash.edu.au (Toby Sargeant) Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Rotation problems Date: 10 Jun 1998 05:13:50 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 37 Message-ID: References: <35007aa1.25789418@news.playstation.co.uk> <6lk0lk$1298@chuka.playstation.co.uk> <357d9f83.668434@www.netyaroze-europe.com> NNTP-Posting-Host: indy16.cs.monash.edu.au X-Newsreader: slrn (0.9.5.1 UNIX) On Tue, 09 Jun 1998 20:49:35 GMT, Barry wrote: >On Tue, 9 Jun 1998 20:58:58 +0200, "Jan-Lieuwe Koopmans" >wrote: > >>>I've been using rotation on sprites extensively in my game, but have >>>come up with the following problems that REALLY annoy me. Is there >>>something obvious I am doing wrong, or is it (as I assume) yet another >>>bug in the psx (I was going to put 'another' in caps, but thought two >>>capitalised words would merely annoy) > >I seem to remember my brother having the same problem with rotating >large sprites for his edge entry game. >He was told it was simply a matter of the playstation being totally >optimised for small sprites, and some of the 'shortcuts' used to >acheive this make large ones dead slow or worse, incorrect. Not at all. it's the texture cache (again). you can only do (from memory) a 32x32 16bit sprite, a 64x32 8 bit sprite, and a 128x32 4 bit sprite without overflowing the texture cache. If, however, you split a 256x256 16 bit sprite up into 64 32x32 sprites, then your texture cache misses will be less pathological, at odd rotations, and the whole thing should be a lot faster. this last bit is hypothesis, but i think it's a pretty sound. what's happening is that as the texture rotates past a few degrees, the vmem reads are scattered all over the texture for a particular scanline. the GPU caches areas of the texture, and then has to throw them out again, for the next scanline, when it goes back to the start of the texture. if you split it up, then the GPU only sees a small area at a time, which fits completely in its cache, so it doesn't need to do as many (? depends on the caching algorithm) reads and those reads aren't doubled up (if one texel maps to >1 pixel). This is something that I think Sony should comment definitively upon, because I'm sure that it's hurting the performance of a lot of people's code. toby.