Rendering Commands And Explination
==================================
Any Link Below is truncated to the root of SDK Manual,
This Link is not visible and I request it not be Spread.
htt.../NINTENDO%2064%20SDK%205%20_CDROM/man/allman50/
Can Also be downloaded at romhacking
Compiled By Trevor
Credits to Zoinkity for Original Find |
| B9 G_SETOTHERMODE_L | ||
|---|---|---|
| typedef struct { | ||
| int | cmd:8; | |
| int | pad0:8; | |
| int | sft:8; | |
| int | len:8; | |
| unsigned int | data:32; | |
| } GsetothermodeL; | ||
G_SETOTHERMODE_L, G_MDSFT_RENDERMODE, SetRenderMode(). (where B9 = G_SETOTHERMODE_L, 00 = Nothing, 03 = G_MDSFT_RENDERMODE, 1D = SetRenderMode() ) Nothing is actually Padding for memory Alignment |
| 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:
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. | |||||||||||||||||||||||||||||
upper word 0000FF00 shift (PD only: 32-shift-length) here are shift values for each of the various segments (hex): 0 alpha compare 2 depth source select [ZSRCSEL] 3 render mode [G_MDSFT_RENDERMODE] 10 blender Discontinued and reserved in F3DEX 000000FF length (PD only: length-1) here are lengths for each of the various segments (hex): 1 depth source 2 alpha compare 1D render mode (encompases render mode, converge ST, depth mode, and blender from below) 10 blender Discontinued and reserved in F3DEX |
| "Fog can be used in one cycle mode for non-antialiased opaque surfaces only" |
| "You cannot, however, use vertex alpha with fog. The per alpha supplied in the vertices will be ignored and if the color combiner selects a SHADE alpha, it will get the fog alpha value instead (not what was intended)." |
=Zoinkitys Original================================================================================= lower word
i.e. if (1.0) draw pixle, if (0.5) draw pixle at half its colour, and half the BG colour. if (0.0) then draw BG colour. See 15.5.3 Coverage Calculation ===================================================================================================== | ||||
| 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 | |||
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Bit | |||
| TE_ED | FC_BL | A_CVG | CV_XA | Z_XUL | INTER | CFULL | CWRAP | C_CVG | IM_RD | Z_UPD | Z_CMP | AA_EN | ZPrim | ADith | AThre | Flags | |||
| 00 = Z_OPA 11 = Z_DEC |
00 = CClamp 11 = CSave |
||||||||||||||||||
AA_EN = 0 | AA_En = 1 |

RenderMode: RenderMode
AA_EN Z_CMP Z_UPD Z_XUL IM_RD AA_EN Z_CMP Z_UPD Z_XUL CVG*A C_CVG FC_BL IM_RD
Alpha Compare: THRESHOLD Alpha Compare:None

RenderMode: RenderMode
AA_EN Z_XUL FC_BL C_CVG IM_RD AA_EN Z_CMP Z_UPD Z_OPA A_CVG IM_RD
Alpha Compare:None Alpha Compare:None
For more Information on Transparent Primitives go here
Blender Multiplexor decompilation
=================================
Description of Blender Mux (c0/1):
Mux1 or c0 is the first pass in the blender. As stated above it normally takes Fog.
Mux2 or c1 sets the second pass. From experiments with CCBL it seems as though the best
settings are, Colour_In * Alpha_In + Colour_Mem * Alpha_Mem.
You will notice its an equation. CCBL shows this as follows (showing both MUX's)
[MUX1]
( C_FOG * A_Shade + C_IN * 1-A )
_______________________________
(A_Shade + 1-A)
[MUX2]
( C_IN * A_IN + C_MEM * A_MEM )
_______________________________
(A_IN + A_MEM)
|
#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 |
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | Bit Number | |||
| 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | Runway 66AFD4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Bit |
| 0m1a | 1m1a | 0m1b | 1m1b | 0m2a | 1m2a | 0m2b | 1m2b | Flags | |||||||||||
| #define G_BL_CLR_IN | 00 | Colour Combiner Output |
| #define G_BL_CLR_MEM | 01 | Previous Mux Colour Output (2 Cycle) |
| #define G_BL_CLR_BL | 10 | Blend Colour (one of 3 model colours: Prim, Blend and VertShade) |
| #define G_BL_CLR_FOG | 11 | FOG Colour |
| #define G_BL_A_IN | 00 | Colour Combiner Alpha Output |
| #define G_BL_A_FOG | 01 | FOG Intensity |
| #define G_BL_A_SHADE | 10 | Face Alpha |
| #define G_BL_0 | 11 | 0.0 |
| #define G_BL_1MA | 00 | 1.0 Minus Previous Mux Alpha (1-A=) |
| #define G_BL_A_MEM | 01 | Previous Mux Alpha |
| #define G_BL_1 | 10 | 1.0 |
| #define G_BL_0 | 11 | 0.0 |