Software Sprite Overview

Sample Execution Screen


Description

The software sprite displays a character using the square polygon of the NITRO 3D graphics engine.

Software Sprite Feature

Priority

The rendering priority of the software sprite can be specified with the Z value of the square polygons that make up the software sprite. In order to use orthogonal projection with the rendering of the square polygons, the depth test needs to be set up in the Z-buffer mode to properly carry out the test. If you are using a 3D object and the software sprite together, the Z values of each must be managed so they do not interfere with each other.

Alpha Blend

The opacity can be changed for one sprite at a time with the alpha blend feature of the software sprite.

Color Modulation

A specified color can be applied to the software sprite.

Setting the UV Value

The software sprite is rendered as a polygon with textures mapped, but the UV value of the mapped texture can be changed. The UV values are specified for the upper left and lower right of the sprite.

Setting of the Rotation Center

The center of rotation can be specified when rotating a software sprite. The center of the software sprite is the default center of rotation.

Vertical/Horizontal Flip

The software sprite can be flipped in the vertical and horizontal directions during display.

Software Sprite Rendering API

The API that renders the software sprite is roughly divided into two categories. One is an API that uses the data organization provided by the library to render. The other is an API that does not use data organization. It directly specifies parameters to functions and arguments to carry out rendering.

Differences in Performance Depending on API Classification

void NNS_G2dDrawSprite(  s16 px, s16 py, int pz,
int sx, int sy,
int U0, int V0, int U1, int V1 );
The API that specifies parameters and then carries out rendering is a simple function that sets up the UV value and renders the square polygons.
It operates quickly, but the appropriate settings for the 3D graphics engine must be configured.

void NNS_G2dDrawSpriteSimple  ( const  NNSG2dSimpleSprite*    pS );
void NNS_G2dDrawSpriteBasic   ( const  NNSG2dBasicSprite*     pB );
void NNS_G2dDrawSpriteExtended( const  NNSG2dExtendedSprite*  pE );
The API that carries out rendering using the library data organization executes the various settings of the 3D graphics engine in the function.
It is easy to use, but has a higher processing load in comparison to the API that directly designates parameters.

Comparing the sample demos, the API that directly specifies parameters runs approximately forty percent faster than the API that renders using data structures.
Using this API is recommended when your game involves rendering large sprites.

Software Sprite Data Organization

Software Sprite Data Organization

Type Possible Features Application Example
Simple Sprite Sprite position, rotation around Z-axis, priority, and alpha blend. rendering of particles, etc. where the texture is the same and only the position and size of the sprite differ.
Basic Sprite all features of Simple Sprite, texture specification, color modulation. rendering of standard sprites.
Extended Sprite all features of Basic Sprite, UV value setting, rotation center setting, vertical/horizontal flip. rendering of sprites with effects such as UV animation.

Three formats of software sprites are available based on the number of parameters that can be specified.
These parameters are processed internally as an Extended Sprite.
There are default values for the features that cannot be specified with Simple Sprite and Basic Sprite. Their calculation cost is reduced.
The default values can be changed by a separate API.

See Also

None.

Revision History

12/06/2004 Initial version.


CONFIDENTIAL