al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
gSPTextureRectangleSyntax#include <ultra64.h> /* gbi.h */ gSPTextureRectangle( Gfx *gdl, u32 ulx, u32 uly, u32 lrx, u32 lry, s32 tile, s32 s, s32 t, s32 dsdx, s32 dtdy) gsSPTextureRectangle( u32 ulx, u32 uly, u32 lrx, u32 lry, s32 tile, s32 s, s32 t, s32 dsdx, s32 dtdy)Arguments
Explanation For example, when ulx=(0<<2) and lrx=(9<<2), 10 columns of pixels will be filled in copy mode and 9 columns of pixels will be filled in 1-cycle mode or 2-cycle mode. For details, please see Section 11.9.3, "Rectangles" in the N64 Online Programming Manual. See also, Section 14.2, "Simple Texture Effects" for examples of other effects. For information about each mode, see Section 2-7, "Rendering Cycle Modes" in Step 2 of the N64 Kantan Manual. To read how to set the cycle type, see gDPSetCycleType. To read about tile descriptors, see gDPSetTile and Section 13.5, "Tile Descriptor Loading" in the N64 Online Programming Manual.
Note
In copy mode, there is a 1:1 correspondence between texels and pixels, so when you use texture rendering, the two fractional bits of the x,y coordinates are ignored. Moreover, because four horizontally adjacent texels are copied in each clock tick, make sure to set dsdx to (4<<10). When the copied image can be expanded in the t direction (dtdy < (1<<10)), dtdy is set to (1<<10) so 1 texel is attached for each pixel. Finally, rendering modes using Z buffering cannot be used in copy mode. To learn which texture types are appropriate for copy mode, see Section 13.11, "Restrictions" in the N64 Online Programming Manual. To ensure that textures are attached appropriately when texture rectangles are being drawn, disable perspective correction in texture sampling mode using gDPSetTexturePersp.
Comments
When a standard frame scheduling algorithm is used such as for audio processing during the vertical retrace at every 1/60 of a second, do not send more than eight or nine consecutive full-screen rectangles to the RDP. Non-full-screen rectangles or non-consecutive rectangle commands (another command or a NOOP is inserted between them) do not present a problem. Also, if every frame rendering interval does not exceed 1/60 of a second, the scheduling algorithm is processed in a similar manner as yield.
See Also
Revision History
|