11.9 Primitives

Availability of different geometry primitives depends on the version of the RSP microcode which has been loaded for execution.

UP


11.9.1 Triangles

Table 11-11 gsSP1Triangle(int v0,int v1,int v2,int flag)
ParameterValues
v0vertex buffer index of the first coordinate. (0-15)
v1vertex buffer index of the second coordinate. (0-15)
v2vertex buffer index of the third coordinate. (0-15)
flagused for flat shading; ordinal id of the vertex parameter to use for shading: 0, 1, or 2

Other bits of the flag field are currently reserved.

UP


11.9.2 Lines

Table 11-12 gsSPLine3D(int v0,int v1,int flag)
ParameterValues
v0vertex buffer index of the first coordinate. (0-15)
v1vertex buffer index of the second coordinate. (0-15)
flagunused (should be 0)

Lines are only available when running the line microcode. All the normal vertex attributes (color, texture, z) are also available for lines. Lines however require separate RDP render modes to be set than for polygons. Consult the man pages for more details. Z-buffered lines will only do reads of the Z-buffer, and not writes. Thus Z-buffered lines should be drawn after Z-buffered polygons.

UP


11.9.3 Rectangles

All rectangles are 2D primitives, specified in screen-coordinates. They are not clipped, but they are scissored in a limited fashion. In 1CYCLE and 2CYCLE mode, rectangles are scissored in the same way as triangles. In COPY and FILL modes, rectangles are scissored to four pixel boundaries; meaning that additional scissoring may be necessary in the application program.

Filled rectangles are implemented entirely in the RDP, as "pass-through" commands with respect to the RSP. They are mentioned here for completeness:

Table 11-13 gsDPFillRectangle(unsigned int ulx,unsigned int uly,unsigned int lrx,unsigned int lry)
ParameterValues
ulxscreen coordinate of upper-left x (10.2 format)
ulyscreen coordinate of upper-left y (10.2 format)
lrxscreen coordinate of lower-right x (10.2 format)
lryscreen coordinate of lower-right y (10.2 format)

Textured rectangles require minimal RSP intervention, and are thus an SP operation:

Table 11-14 gsSPTextureRectangle(unsigned int ulx,unsigned int uly,unsigned int lrx,unsigned int lry,int tile,short int s,short int t,short int dsdx,short int dtdy)
ParameterValues
ulxscreen coordinate of upper-left x (10.2 format)
ulyscreen coordinate of upper-left y (10.2 format)
lrxscreen coordinate of lower-right x (10.2 format)
lryscreen coordinate of lower-right y (10.2 format)
tilewhich tile in TMEM to use
ss coordinate of upper-left corner (S10.5 format)
tt coordinate of upper-left corner (S10.5 format)
dsdxchange in s per change in x coordinate (S5.10 format)
dtdychange in t per change in y coordinate (S5.10 format)

There is a related macro, gsSPTextureRectangleFlip(), that is identical to gsSPTextureRectangle(), except that the texture is flipped so that the s coordinate changes in the y direction, and the t coordinate changes in the x direction:

Table 11-15 gsSPTextureRectangleFlip(unsigned int ulx,unsigned int uly,unsigned int lrx,unsigned int lry,int tile,short int s,short int t,short int dtdx,short int dsdy)
ParameterValues
ulxscreen coordinate of upper-left x (10.2 format)
ulyscreen coordinate of upper-left y (10.2 format)
lrxscreen coordinate of lower-right x (10.2 format)
lryscreen coordinate of lower-right y (10.2 format)
tilewhich tile in TMEM to use
ss coordinate of upper-left corner (S10.5 format)
tt coordinate of upper-left corner (S10.5 format)
dtdxchange in t per change in x coordinate (S5.10 format)
dsdychange in s per change in y coordinate (S5.10 format)

UP