olivieryuyu / N64-Microcode-

Testing - Phase 1
3 stars 0 forks source link

G_STRI1 #3

Open olivieryuyu opened 2 years ago

olivieryuyu commented 2 years ago

G_STRI1

Header of the command: 0x1E

Function: this command generates a single triangle face (using the vertices v0, v1, and v2) in the internal vertex buffer loaded by the gSPVertex macro. The flag (0, 1, or 2) identifies which of the three vertices contains the normal or the color for the face (for flat shading). the colors indexes (c1, c2 and c3) and textures coordinates indexes (st1, st2, st3) are used to pick up the colors and textures coordinates into their related buffer.

On the contrary of G_TRI1 command, the colors and the textures coordinates of the vertex are not the ones defined in the Vtx structure (colidx and stidx). They are defined in the command itself. Therefore if you do intend to use G_STRI1 command, such indexes will not be used so you don't have to bother much about them.

Related GBI macros:

gSP1STriangle(pkt, v0, v1, v2, flag, c0, c1, c2, st0, st1, st2) gsSP1STriangle(v0, v1, v2, flag, c0, c1, c2, st0, st1, st2)

pkt, v0, v1, v2, flag: same parameters than Fast3D c0, c1, c2: index of the colors to be used for the vertex v0, v1, v2 st0, st1, st2: index of the textures coordinates to be used for vertex v0, v1, v2