Sign in to follow this  
EvilNando

how to do these sprite effects

Recommended Posts

EvilNando    96
[url="http://youtu.be/b4b9H05xrlU"]http://youtu.be/b4b9H05xrlU[/url]
(fw to 38:30)

This is a video of FF from the wonderswan.. at that time I believe there were no shaders to use so Im guessing they were just manipulating (a copy) of the current textures being used on the scene

isnt this kind of operations kinda of slow? (for that hardware)

If I were to recreate those same effects to day on current hardware should I still be using texture manipulation routines or should I use shaders?

also about the texture waving effect: how does it never shows any black pixels? I mean the effect sways the texture from beyond the current viewable area, so unless the texture is bigger than the screen size shouldnt black pixels get displayed?

</div></div>

Share this post


Link to post
Share on other sites
MJP    19754
You could do it really easily with a pixel shader. Just use sin() to create a wavey offset, and then add it to your U texture coordinate. You can use WRAP, CLAMP, or MIRROR filtering mode to fill in the parts where it samples off the textures.

You could also do it without shaders by creating a grid of triangles that cover the screen, and then on the CPU each frame using sin() to offset the texture coordinates for each vertex in the grid. Then you just full a dynamic vertex buffer with those verts and render.

Share this post


Link to post
Share on other sites
Katie    2244
" Im guessing they were just manipulating (a copy) of the current textures being used on the scene

isnt this kind of operations kinda of slow? (for that hardware)"

There's a couple of approaches that work on 8/16 bit hardware.

The first would be to trigger interrupts at the start of the scanlines and to manipulate the start address of the scanline. This would work on machines with a suitably programmable interrupt generator. (Certainly Amiga type hardware could do this). Some of the 8-bits could do it with h/w interrupts. The others would do something like this with timing loops.

Pixel accurate scrolling on 8 bits was pretty much a no-no in real-time (a video ram byte encoded more than 1 pixel, so almost all games used byte scrolling which would make the waves really tricky).

On 16 bits, there were byte-per-pixel displays at which point scrolling by pixel becomes practical. One of the cunning things about this particular effect is that it's largely immune to tearing -- you don't actually have to do the pixel scrolls for every pixel line on the screen in one flyback... if (say) the bottom half of the screen lags by a field, no-one will notice...

Hardware sprites makes it all a lot easier because then you can muck about with the backdrop without needing to fret about the figures.

Actually, the platform you're looking at has a 3MHz 80186 clone CPU but an entirely not inconsiderable sprite/video co-processor; it's a 32 bit co-pro with features like sprite scaling, so I'd expect that the effect is being done on the graphics system. The extra pixels are just done by having the image bigger than the screen.

Share this post


Link to post
Share on other sites
Firestryke31    350
They used fancy hardware tricks. HBlank ISR to modify a background tilemap x-offset via a LUT, most likely. With the hardware that the game was for, you can do a lot of fancy hardware tricks, including faking perspective using only a 2D tilemap and the hardware graphics scaling system. GBA programming is very similar, and probably used a lot of the same tricks, but with the benefit of a slightly faster, 32-bit processor.

Standardized hardware means you can do a lot more to push it to it's limits, since you are guaranteed to know what those limits are. You'd be amazed at some of the tricks that had to go into those fancy effects that you see for 2 seconds.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this