NV30VertexFormat

Vertex Format for NV30

(Tested on NV34)

glBegin/glEnd

FIFO Command:

0x1808 (NV30_BEGIN_END)

Arguments:

Always take only one argument. It depends on what type of drawing will be done. STOP means glEnd(). These are the possible values:

STOP                        0x00000000
POINTS                      0x00000001
LINES                       0x00000002
LINE_LOOP                   0x00000003
LINE_STRIP                  0x00000004
TRIANGLES                   0x00000005
TRIANGLE_STRIP              0x00000006
TRIANGLE_FAN                0x00000007
QUADS                       0x00000008
QUAD_STRIP                  0x00000009
POLYGON                     0x0000000a

Vertex Info

Notes

The number of arguments is the minimum needed to reach all types of vertex data that will be set between the glBegin/glEnd. For example, if glVertex3f, glNormal4f and glTexCoord3f are called in between glBegin/glEnd, then the number of arguments will be 9, and it will set arguments 2, 4, 5, 6, 7 and 8 to 0x02, although it could be 0x04 or 0x05 (from doc/vertex_attributes).

FIFO Command:

0x1740 (NV30_VERTEX_FORMAT)

Arguments:

Each argument represents one type of attribute that can be given in a glBegin/glEnd block. The value on the argument represents how much components will be set to the given attribute and the type of this information (for NV20+ it seems to be only float) with this format:

(number_of_components << 4)|2 (always uses float)

These are the 16 arguments (extracted from doc/vertex_format_nv44):

01                          vertex position
02                          vertex weights
03                          normal
04                          primary color
05                          secondary color
06                          fog coord
07                          (not used?)
08                          (not used?)
09                          texture coord 0
10                          texture coord 1
11                          texture coord 2
12                          texture coord 3
13                          texture coord 4
14                          texture coord 5
15                          texture coord 6
16                          texture coord 7

Example

(from doc/vertex_format_nv44)

Big vertices (Position + texture coordinates or Position + texture coordinates + normal):

STOP                        0x00000000
0x00243740                  (max 36 byte vertices, so 9 slots)
0x00000022                  (2 coordinates per vertex) or 0x00000032 (3 coordinates per vertex) or 0x00000042 (4 coordinates per vertex)
0x00000002
0x00000032                  (3 normal components)
0x00000032                  (3 color components [RGB] per vertex)
0x00000002
0x00000002
0x00000002
0x00000002
0x00000022                  (2 texture components)

Vertex Data

Notes:

(from doc/vertex_format_nv44)

Restart a batch after 60 vertices. Maximum number of bytes is 2016; restart a batch for more.

FIFO Command:

0x40001818 (NV30_VERTEX_INFO)

Arguments:

(from doc/vertex_format_nv44)

All vertex data is in IEEE floating point format ordered as follows (each property is optional except the first two vertex coordinates):

** vertex coordinates within ]-inf,inf[
X
Y
Z
T

** normal coordinates within [0,1]
NX
NY
NZ

**  vertex color within [0,1]
R
G
B
A

** texture coordinates within [0,1]
TX
TY
TZ