Path: chuka.playstation.co.uk!news From: James Shaughnessy Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Transparent screen grabs? Date: Wed, 21 Oct 1998 13:51:20 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 45 Message-ID: <362DD8C8.3290@manc.u-net.com> References: <362B0900.27655A77@bristol.ac.uk> Reply-To: james@manc.u-net.com NNTP-Posting-Host: manc.u-net.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.0 (Win95; I) 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? -- ----------------------------------------- James Shaughnessy james@manc.u-net.com http://www.netyaroze-europe.com/~shaughnj -----------------------------------------