Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Craig Venz Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Transparent screen grabs? Date: Wed, 21 Oct 1998 09:55:03 -0400 Organization: SCEA News Server Lines: 54 Message-ID: <362DE7B7.EC375C69@cobite.com> References: <362B0900.27655A77@bristol.ac.uk> <362DD8C8.3290@manc.u-net.com> NNTP-Posting-Host: snew.cobite.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.33 i586) James Shaughnessy wrote: > > Yes indeed a good question there. You say you've tried setting all > the STP bits for each frame -- but are you setting them while > on the frame buffer? This will take in the order of 100,000 HSyncs > if you are using a LoadImage and a StoreImage for each pixel by my > reckoning, so as you say causes a rediculous slow-down. > > Have you tried StoreImage'ing the whole screen to main memory, > then doing some speedy bit-masking to all the pixels, then a quick > LoadImage back to VRAM where the sprite info is? The code could be: > > RECT screen = {0, activeBuff*240, 320, 240}; > u_long *mainmem = (u_long *)RESERVED_MEM_ADDR; // or use malloc() > > StoreImage(&screen, &mainmem); > for (i=0; i<320*240/2; i++;) > mainmem[i] |= (1<<15) + (1<<31); > LoadImage(&screen_sprite_area, &mainmem); > > Note how TWO pixel STP bits are set for each loop execution, so > it only (?) needs to loop about 40,000 times. It's only doing one > logical OR (as 1<<15 + 1<<31 is evaluated at compile time) so it > should be plenty quick enough and do the trick if no other bright > soul comes up with a better solution. > Later, > Jim > > TEJ Madams wrote: > > Hi there, > > I've been programming the Yaroze for a couple of weeks with > > a small amount of sucess but I've come across a problem. I wanted to > > recreate that 'fade to battle' effect in FFVII and I know how it's > > done but I don't know exactly how to do it. I need to grab the screen > > and make it into a transparent sprite an paste the image back onto > > the screen again after modifying a bit. Now here's my point, to make > > a TIM image transparent, the transparency bits for every pixel in the > > image need to be set but when you grab the screen, these bits aren't > > set. Arse. All the bits in the screen grab (320*240) need to be set > > every frame which slows the frame rate down dramatically. I know it > > can be done quicker but how? I had an idea for doing this myself, by setting 2 GsSPRITE structures to point to the previous doublebuffer, as 16bit sprites... I would think that would be a real easy way to do it... While trying this out, though, I've had no luck getting it to work, whatsoever. I think I must be doing something wrong with GetTPage and the u and v values... Anyway, I still maintain that this _should_ work. Anyone want to prove me wrong? Craig