Path: chuka.playstation.co.uk!news From: James Russell Newsgroups: scee.yaroze.beginners Subject: Feedback effect Date: Fri, 29 May 1998 16:30:09 +0100 Organization: Sony Computer Entertainment Europe Lines: 59 Message-ID: <356ED481.818036C3@scee.sony.co.uk> References: <356C9B7A.C18CCEE4@easynet.co.uk> <6ki72j$lev11@chuka.playstation.co.uk> <356CAE49.AFC4F92E@netmagic.net> <356D2C25.C4E7B0B3@hinge.mistral.co.uk> <356F2542.6F7C@easynet.co.uk> NNTP-Posting-Host: camfw01.millennium.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) > But anyone know how certain other effects are done - for instance I've > seen Yaroze games where the whole screen melts away, starting from the > centre. Is there a way of addressing individual pixels in the frame > buffer to shift them around, apply different transparencies and RGB > values to them etc to create this effect? This is a dead easy effect, as seen on Final Fantasy VII and a few Yaroze games - you just use the screen that's currently being displayed as a giant texture on a sprite (with transparency on), then rotate and scale the sprite by a few degrees and pop it in the OT. Set up is about 10 lines, and performing the feedback effect each frame is 1 line! Cheers, James Here's some code: (BTW a texture can be a maximum of 256 pixels wide, which isn't great if you've got a 320 wide screen - so I cheated and had a 256 wide screen. For > 256 pixels wide, you've got to use two sprites) If you adjust this code so that it draws the sprite just before it draws your normal screen (assuming you've got some black edges) then you get a really great effect! void flashScreen(void) { #define FLASHLEN 200 int flashlength = FLASHLEN; GsSPRITE sprite; int activeBuff; int zoomx,zoomy; MATRIX tmpls; sprite.attribute=(2<<24)+(0<<28)+(1<<30); // Transparency set up (experiment with different types of transparency) sprite.x = 0; sprite.y = 0; sprite.w = 256; sprite.h = 240; sprite.u = 0; sprite.v = 0; sprite.cx = 0; sprite.cy = 0; sprite.r = sprite.g = sprite.b = 128; sprite.mx = 128; sprite.my = 120; // Set the middle of the sprite to be the middle of the screen sprite.scalex = sprite.scaley = 4350; // That's about 105% scaling sprite.rotate = 4096*2; // Rotate by 2 degrees while(flashlength--) { activeBuff = GsGetActiveBuff(); sprite.tpage = activeBuff ? 0 : 16; // The tpage points to the 'screen' you're about to feedback. GsSetWorkBase((PACKET*)GpuPacketArea[activeBuff]); ClearOT(&WorldOT[activeBuff], OTSIZE); GsSortSprite(&sprite, &WorldOT[activeBuff], 0); DrawSync(0); VSync(2); GsSwapDispBuff(); // You might have to swap these two lines DrawOT(&WorldOT[activeBuff]); // around... } }