Q&A- Sprite

QA1 How do I express a sprite?
QA2 How many sprites can be displayed?
QA3 How do I make the seams between sprite tiles less apparent?


Q1 What is the procedure for expressing a sprite?

A1 Currently, the popular method is to use the S2DEX microcode. Since there are samples of this included here, install and use them.

As for typical methods that don't use S2DEX, there are two concepts. First, you can use the sprite library or use the sprite microcode in the case of sprites with which parallel motion and/or clipping will be performed. However, textures must be used when performing rotation, reduction, or enlargement. Since there are samples of each in "spgame,", "spritemonkey," and "spball" in the /usr/src/PR/ directory, please refer to them. Until you have referenced these, you could probably just apply the sprite to a polygon as a texture, as shown below.

top


Q2 When several sprites are displayed in the samples, the processing immediately slows down. As a rule of thumb, about how many sprites can be displayed in a finished version?

A2 This is probably a problem in the layout of the program. If it is efficiently put together, we have confirmed displaying 1000 sprites at this point.

top


Q3 I am using the N64 Sprite Library. I noticed that, when I wanted to make a slightly smaller image of a large scene and scaled the sprites, the seams between the various tiles became really noticeable. How can I resolve this?

A3 This is a phenomenon which is caused by the bilinear texture interpolation function. Since bilinear interpolation interpolates looking at the surrounding pixels, the edge of the texture will become unnatural out of necessity (especially when tiling). It is common here to create filtered textures increasing the perimeter per dot, and to adjust the st value (0.5 shift). Since the N64 Sprite Library that you are using has an attribute called SP_TEXSHIFT in spSetAttribute, you can utilize this.

top