0xXX | Function | Lower Word | Action | Description | RESULT |
0x02 | SetAlphaCompare() | 0x00000000 | None | Do not compare, Normal Non-Transparent Textures (or Multi-Bit Alpha) | |
0x00000001 | Threshold | Compare with the blend Colour Alpha value, Used for 1 bit alpha transparent textures if Fog Enabled | |
0x00000003 | Dither | Compare with a random dither value, Makes for odd Partical effect (eg flies) | |
0x01 | SetDepthSource() | 0x00000000 | Pixel | Use the Z value and deltaZ value repeated for each pixel | |
0x00000004 | Primitive | Use the primitive depth register's Z value and deltaZ value. This is faster but less accurate /n64man/gdp/gDPSetDepthSource.htm | |
0x1D | SetRenderMode(|) | 0xFFFFFFFF | | Options Below | |
0x10 | Blender | ? | ? | ! Discontinued and reserved in F3DEX ! | |
Setting the DepthSource to a Primitive Can be used for 'Horizon' Images. In this case you model a horizon close to the player (a dome or cylinder centered around the players head, but orientated to the world), Then you set its z-value to 0x7fff (Far Clip Plane). This will cause the Horizon Image to always be at the back. FOG however will apply (since FOG is calculated on Z Value) so FOG needs to be disabled for the Horizon Display List.
Example:
| // Set cycle type | |
| gDPSetCycleType(G_CYC_2CYCLE); | BA001400 00100000 |
| // Set rendering mode | |
| gDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2); | B900031D 00552078 |
| // Set depth source value | |
| gDPSetDepthSource(G_ZS_PRIM); | B9000201 00000004 |
| // Set primitive depth | |
| gDPSetPrimDepth(2047, 0); | EE000000 7FFF0000 |
Interesting Note - Decals:
The dz (Delta-Z (Change-In-Z)) value should be set to 0. This value is used for antialiasing and objects drawn in decal render mode and must always be a power of 2 (0, 1, 2, 4, 8, ... 0x4000). If you are using decal mode and part of the decaled object is not being rendered correctly, try setting this to powers of 2. Otherwise use 0.
|
-Bit Map-----------------------------------------------------------------
| [------------------MUX 1 and 2 see Below!----------------] |
| 0 0 0 0 1 1 0 0 0 0 0 1 1 0 0 0 |N/A
| see MUX BitMap Below |
| |
| 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 |Bit Number
| 0 0 1 0 0 0 0 0 0 1 1 1 1 0 0 0 |Runway 66AFD4
| te fb acs cxa ze zi cf cw cc ir du dc AA Pr Di Th |Flags
| [-------------------flags-------------------------][-flags-] |
| Flags Confirmed |
-------------------------------------------------------------------------
#define GBL_c0(m1a, m1b, m2a, m2b)
(m1a) << 30 | (m1b) << 26 | (m2a) << 22 | (m2b) << 18
#define GBL_c1(m1a, m1b, m2a, m2b)
(m1a) << 28 | (m1b) << 24 | (m2a) << 20 | (m2b) << 16 |
OK, So MUX is now figured out. To Start with this didnt make sence, but after compiling my own code, it works.
The numbers are (16-30) BitShifts.
This works out like the following Bit map of the Upper Half Lower Word B90000 XXXX0000: