This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
rcpstructs [2018/04/20 12:41] trenavix [RSP Geometry Mode] |
rcpstructs [2018/10/01 05:58] (current) David [Vertex Structure] Lowered some capitals in the description, also testing if this summary appears with the waluigi bot. Hi Hack64 discord! |
||
---|---|---|---|
Line 3: | Line 3: | ||
===== RSP Geometry Mode ===== | ===== RSP Geometry Mode ===== | ||
- | This 32-bit value configures how the RSP will process geometry. They are all 1-bit flags. All of these flags are disabled by default //except// for <color #00a2e8>G_CLIPPING</color> | + | This 32-bit value configures how the RSP will process geometry. They are all 1-bit flags. All of these flags are disabled by default //except// for <color #00a2e8>G_CLIPPING</color>.\\ |
+ | <color #1df61d>1</color> is the affected bit, and <color #FF121b>1</color> is the affected bit for F3D and F3DEX (if different from EX2). | ||
^ Affects Bit ^ Name ^ Description ^ | ^ Affects Bit ^ Name ^ Description ^ | ||
| <color #206320>0000 0000 0000 0000 0000 0000 0000 000</color><color #1df61d>1</color> | <color #00a2e8>G_ZBUFFER</color> | Enables depth (Z buffer) calculations in the RSP | | | <color #206320>0000 0000 0000 0000 0000 0000 0000 000</color><color #1df61d>1</color> | <color #00a2e8>G_ZBUFFER</color> | Enables depth (Z buffer) calculations in the RSP | | ||
| <color #206320>0000 0000 0000 0000 0000 0000 0000 0</color><color #1df61d>1</color><color #206320>00</color> | <color #00a2e8>G_SHADE</color> | Enables calculating vertex color for triangle. Uses flat shading without <color #00a2e8>G_SHADING_SMOOTH.</color> | | | <color #206320>0000 0000 0000 0000 0000 0000 0000 0</color><color #1df61d>1</color><color #206320>00</color> | <color #00a2e8>G_SHADE</color> | Enables calculating vertex color for triangle. Uses flat shading without <color #00a2e8>G_SHADING_SMOOTH.</color> | | ||
- | | <color #206320>0000 0000 0000 0000 0000 00</color><color #1df61d>1</color><color #206320>0 0000 0000</color> | <color #00a2e8>G_CULL_FRONT</color> | Front-face culling | | + | | <color #206320>0000 0000 0000 0000 000</color><color #FF121b>1</color> <color #206320>00</color><color #1df61d>1</color><color #206320>0 0000 0000</color> | <color #00a2e8>G_CULL_FRONT</color> | Front-face culling | |
- | | <color #206320>0000 0000 0000 0000 0000 0</color><color #1df61d>1</color><color #206320>00 0000 0000</color> | <color #00a2e8>G_CULL_BACK</color> | Back-face culling | | + | | <color #206320>0000 0000 0000 0000 00</color><color #FF121b>1</color><color #206320>0 0</color><color #1df61d>1</color><color #206320>00 0000 0000</color> | <color #00a2e8>G_CULL_BACK</color> | Back-face culling | |
| <color #206320>0000 0000 0000 000</color><color #1df61d>1</color><color #206320> 0000 0000 0000 0000</color> | <color #00a2e8>G_FOG</color> | Calculates alpha value of primitives for fog effects | | | <color #206320>0000 0000 0000 000</color><color #1df61d>1</color><color #206320> 0000 0000 0000 0000</color> | <color #00a2e8>G_FOG</color> | Calculates alpha value of primitives for fog effects | | ||
| <color #206320>0000 0000 0000 00</color><color #1df61d>1</color><color #206320>0 0000 0000 0000 0000</color> | <color #00a2e8>G_LIGHTING</color> | Enables lighting calculations to determine vertex color (determines how the color/normal part of loaded vertices are interpreted) | | | <color #206320>0000 0000 0000 00</color><color #1df61d>1</color><color #206320>0 0000 0000 0000 0000</color> | <color #00a2e8>G_LIGHTING</color> | Enables lighting calculations to determine vertex color (determines how the color/normal part of loaded vertices are interpreted) | | ||
| <color #206320>0000 0000 0000 0</color><color #1df61d>1</color><color #206320>00 0000 0000 0000 0000</color> | <color #00a2e8>G_TEXTURE_GEN</color> | Generates spherical texture coordinates, based on X and Y components of the projected version of the normal | | | <color #206320>0000 0000 0000 0</color><color #1df61d>1</color><color #206320>00 0000 0000 0000 0000</color> | <color #00a2e8>G_TEXTURE_GEN</color> | Generates spherical texture coordinates, based on X and Y components of the projected version of the normal | | ||
| <color #206320>0000 0000 0000 </color><color #1df61d>1</color><color #206320>000 0000 0000 0000 0000</color> | <color #00a2e8>G_TEXTURE_GEN_LINEAR</color> | Generates linear texture coordinates, based on acos() of X and Y components of the normal, after projection transformation | | | <color #206320>0000 0000 0000 </color><color #1df61d>1</color><color #206320>000 0000 0000 0000 0000</color> | <color #00a2e8>G_TEXTURE_GEN_LINEAR</color> | Generates linear texture coordinates, based on acos() of X and Y components of the normal, after projection transformation | | ||
- | | <color #206320>0000 0000 00</color><color #1df61d>1</color><color #206320>0 0000 0000 0000 0000 0000</color> | <color #00a2e8>G_SHADING_SMOOTH</color> | Enables smooth (Gouraud) shading of primitives. Needs <color #00a2e8>G_SHADE</color> enabled to work. | | + | | <color #206320>0000 0000 00</color><color #1df61d>1</color><color #206320>0 0000 0000 00</color><color #FF121b>1</color><color #206320>0 0000 0000</color> | <color #00a2e8>G_SHADING_SMOOTH</color> | Enables smooth (Gouraud) shading of primitives. Needs <color #00a2e8>G_SHADE</color> enabled to work. | |
| <color #206320>0000 0000 </color><color #1df61d>1</color><color #206320>000 0000 0000 0000 0000 0000</color> | <color #00a2e8>G_CLIPPING</color> | In F3DLX2, can disable clipping calculations, and is on by default. Ignored by other F3D microcodes, clipping is always on. | | | <color #206320>0000 0000 </color><color #1df61d>1</color><color #206320>000 0000 0000 0000 0000 0000</color> | <color #00a2e8>G_CLIPPING</color> | In F3DLX2, can disable clipping calculations, and is on by default. Ignored by other F3D microcodes, clipping is always on. | | ||
Line 128: | Line 129: | ||
* <color #1df61d>__10:__</color> <color #00a2e8>G_BL_1:</color> Constant 1.0 value | * <color #1df61d>__10:__</color> <color #00a2e8>G_BL_1:</color> Constant 1.0 value | ||
* <color #1df61d>__11:__</color> <color #00a2e8>G_BL_0:</color> Constant 0.0 value | * <color #1df61d>__11:__</color> <color #00a2e8>G_BL_0:</color> Constant 0.0 value | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Vertex Structure ===== | ||
+ | |||
+ | Vertices are points in 3D space that are used in drawing triangles. This structure is the same no matter which graphics microcode you use. Each vertex takes up 16 bytes. | ||
+ | |||
+ | ''[<color red>XX XX</color>] [<color green>YY YY</color>] [<color cyan>ZZ ZZ</color>] [<color lightgray>FF FF</color>] [<color orange>UU UU</color>] [<color #AA88DD>VV VV</color>] [<color pink>XR</color>] [<color lightgreen>YG</color>] [<color lightblue>ZB</color>] [<color lightgray>AA</color>]'' | ||
+ | |||
+ | | <color red>XXXX</color> | short | Position on X axis | | ||
+ | | <color green>YYYY</color> | short | Position on Y axis | | ||
+ | | <color cyan>ZZZZ</color> | short | Position on Z axis | | ||
+ | | <color lightgray>FFFF</color> | ushort | Flag. Unknown usage, usually just 0000 | | ||
+ | | <color orange>UUUU</color> | short | Texture coordinate on the U axis | | ||
+ | | <color #AA88DD>VVVV</color> | short | Texture coordinate on the V axis | | ||
+ | | <color pink>XR</color> | byte or ubyte | X unit vector of normal or red color* | | ||
+ | | <color lightgreen>YG</color> | byte or ubyte | Y unit vector of normal or green color* | | ||
+ | | <color lightblue>ZB</color> | byte or ubyte | Z unit vector of normal or blue color* | | ||
+ | | <color lightgray>AA</color> | ubyte | Alpha (Transparency)<nowiki>**</nowiki> | | ||
+ | |||
+ | * You cannot use vertex colors and vertex lighting at the same time. Normals are used if the geometry mode ''G_LIGHTING'' bit is enabled, otherwise the RGB colors will be used instead. (see: [[rcpstructs#rsp_geometry_mode|RSP Geometry Mode]]) | ||
+ | |||
+ | <nowiki>**</nowiki> Vertex alpha cannot be used when fog is enabled. The vertex will use the fog alpha value instead. | ||
---- | ---- | ||