ccbl


Table of contents

Overview

Operation

Menu Descriptions

Example Settings

Primitive Color
Texture Decal
Writing
Reflection Mapping
Specular Highlighting
Fog
Trilinear MIP Mapping
Anti-aliasing
Transparent Surface
Texture Edge Mode
Decal Surface
Interpenetration Mode
Particle Effects

Miscellaneous Items

Menu Rendering Mode
Near/Far-Plane Clipping Values
Unsupported Combine Modes
Performance Meter
Parameters that ccbl Cannot Set

Overview

This program was created as a means of easily learning about the Nintendo64 RDP feature block, particularly the ColorCombiner and Blender features.

ccbl is typically started by the Windows application dptest. Work performed in ccbl cannot be saved be saved or loaded. However, ccbl can be run by downloading it to the debugging target as a normal N64 application. It also can be run by writing it to a flash cartridge.


Operation

Although two controllers are normally used, the program can be operated with only one controller if necessary.

Camera Operations(Controller 1)
Control Stick Rotates model
Z+Control Stick UP/DOWN Changes camera position
Menu Operations (Controller 1)
R Trigger Turns menu ON/OFF
+ Button Moves cursor
A Button Opens next window
Determines menu.
B Button Closes window
Control Pad Changes parameters
Changing Parameters(Controller 1)
Hexadecimal Display Parameters(e.g. changing*_COLOR)
Control Pad Decreases value by 1
Control Pad Increases value by 1
Control Pad Decreases value by 0x10
Control Pad Increases value by 0x10
L+Control Pad Sets to minimum value
L+Control Pad Sets to maximum value
Decimal Display Parameters (change FogPosition)
Control Pad Decreases by the specified number of decimal places
Control Pad Increases by the specified number of decimal places
Changing the ON/OFF parameter
Control Pad Changes the ON/OFF (>/~) Parameter
Menu Screen Dump (Controller 2)
L Trigger(*) Processes menu screen dump with osSyncPrintf()
Toggling Cover ValueVisualization (Controller 2)
R Trigger Uses RM_VISCVG to visualize cover values.
See the N64 Programming Manual, Section 15.7.11.
GBI Macro Output (Controller 2)
Button A(*) Processes settings parameters in GBI format (gSP*,gDP*) with osSyncPrintf()
Button B(*) Processes settings parameters in GBI format (gsSP*,gsDP*) with osSyncPrintf()
(*) Not supported in programs created using make DPTEST=1 and make FINAL=1

Menu Descriptions


Example Settings

Cycle mode is set to 1 cycle unless otherwise indicated.

Default parameter values are used unless otherwise indicated.

The (*) symbol indicates settings that are required to view the effect with ccbl.


Primitive color

Displays an object using the primitive color.

Set the Combine mode to PRIMITIVE.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: PRIMITIVE

Try changing the primitive color and see the results.

[RDP]->CL_COMBINE->PRIM_COLOR


Texture Decal

Applies a texel color unchanged.

Sets Combine mode to DECALRGB. (*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: DECALRGB


Writing

Sets to a display with writing.

Set the Geometry mode.

Settings for [RSP]->GEO_MODE are as follows.

+[GEO_MODE]---------+        
| G_SHADE         :O|*        
| G_LIGHTING      :O|*        
| G_SHADING_SMOOTH:O|*        
| G_ZBUFFER       :O|*        
| G_TEXTURE_GEN   :x|        
| G_TEXTURE_GEN_L :x|        
|>G_CULL_FRONT    <x|        
| G_CULL_BACK     :O|        
| G_FOG           :x|        
|- - - - - - - - - -|        
|  REFLECTION EN  :x|        
+-------------------+        

Settings for Combine mode are as follows.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: SHADE

Try changing the light color and see the results.

[RSP]->LIGHT_COL

Using MODULATERGB for Combine mode enables a light to be applied to a textured object.


Reflection Mapping

Performs reflection mapping.

Set the Geometry mode.

[RSP]->The GEO_MODE setting is as follows.

+[GEO_MODE]---------+        
| G_SHADE         :O|*        
| G_LIGHTING      :O|*        
| G_SHADING_SMOOTH:O|*        
| G_ZBUFFER       :O|*        
| G_TEXTURE_GEN   :O|*        
| G_TEXTURE_GEN_L :x|        
| G_CULL_FRONT    :x|        
| G_CULL_BACK     :O|        
| G_FOG           :x|        
|- - - - - - - - - -|        
|> REFLECTION EN  <O|*        
+-------------------+        

The Combine mode setting is as follows.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: DECALRGB

Note: If reflection mapping is enabled without performing only the ccbl settings, the settings performed internally will be insufficient.

Specular Highlighting

Uses reflection mapping to simulate specular highlighting.

TORUS2 is used as the model so that the effect is readily seen.

Select IA8 HIGHLIGHT for the texture.

The Geometry mode settings used are the same as for reflection mapping.(*)

Because reflection mapping is used, the light is assumed be located at the viewpoint. Thus, only DIF1 is used.

Light color settings are as follows.(*)

+[LIGHT COLOR]--+        
|      R  G  B  |        
|DIF1: 50 50>00<|        
|DIF2: 00 00 00 |        
|DIF3: 00 00 00 |        
|DIF4: 00 00 00 |        
|DIF5: 00 00 00 |        
|DIF6: 00 00 00 |        
|DIF7: 00 00 00 |        
|AMB : 00 00 00 |        
+---------------+        

The Combine mode setting is as follows.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: HILIGHTRGB

The primitive color is set to the same color as the light color.(*)

+[PRIM COL]-+           
| RED  : FF |           
| GREEN: FF |           
| BLUE : 00 |           
|>ALPHA< 80 |           
|- - - - - -|           
| MIN  : 80 |           
| LOD  : 80 |           
+-----------+           

The primitive color becomes the light color.

Note: Specular highlighting can always be simulated using reflection mapping. For examples of the correct settings, see the N64 Programming Manual.

Fog

Uses Fog.

Set the Geometry mode.

[RSP]->GEO_MODE settings are as follows.

+[GEO_MODE]---------+
| G_SHADE         :O|(*)
| G_LIGHTING      :O|(*)
| G_SHADING_SMOOTH:O|
| G_ZBUFFER       :O|(*)
| G_TEXTURE_GEN   :x|
| G_TEXTURE_GEN_L :x|
| G_CULL_FRONT    :x|
| G_CULL_BACK     :x|
| G_FOG           :O|(*)
|- - - - - - - - - -|
|> REFLECTION EN  <x|
+-------------------+

The cycle type is set to 2 cycles.(*)

[RDP]->CYCLE_TYPE->G_CYC_2CYCLE

To make the effect readily visible, select DECALRGB as the Combine mode, CUBE as the model, and BRICK as the texture. In addition, specify the following Combine node settings.

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: DECALRGB
[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: PASS2

Set the Rendering mode.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: FOG_SHADE_A
[RDP]->BLENDER->RENDER_MODE->CYCLE2: AA_ZB_OPA_SURF2

Select the Fog color.(*)

[RDP]->BLENDER->FOG_COLOR settings are as follows.

+[FOG COL]--+            
|<RED  > 80 |            
| GREEN: 80 |            
| BLUE : 80 |            
| ALPHA: 80 |            
+-----------+            

Set the BG color to a color close to that of the Fog.

[MISC]->BG_COLOR->GLAY

The positions of the Fog threshold and Fog color saturation can be changed by changing the Fog position ([RSP]->FOG_POS).


Trilinear MIP Mapping

Set the cycle type to 2 cycles.(*)

[RDP]->CYCLE_TYPE->G_CYC_2CYCLE

Set the Combine mode.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: TRILERP
[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: DECALRGB2

Set the Rendering mode.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: PASS
[RDP]->BLENDER->RENDER_MODE->CYCLE2: AA_ZB_OPA_SURF2

Set the texture.(*)

[MISC]->TEXTURE->RGBA16 BRICK_MM

Note: ccbl specifies texture tiling internally when BRICK_MM is used as the texture.

Anti-aliasing

Anti-aliasing in N64 is ultimately performed by VI. Blender writes the anti-aliasing data (cover values) to the frame buffer when it writes the pixel values to that buffer.

Using the G_RM_VISCVG, ccbl enables cover values to be visualized. Try changing the Blender settings and using this feature to see the types of cover values generated. The result will likely be many very interesting discoveries.


Transparent Surface

Combine mode is set as follows.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: PRIM

Blender mode is set as follows.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: AA_ZB_XLU_SURF

Change BG_COLOR so that the effect is easily seen.

[MISC]->BG_COLOR->IMAGE2

Try changing the alpha for the primitive color and see the results.

[RDP]->CL_COMBINER->PRIM_COLOR->ALPHA


Texture Edge Mode

The model and texture are set as follows.

[MISC]->MODEL->CUBE
[MISC]->TEXTURE->RGBA16 TREE

Combine mode is set as follows.(*)

[RDP]->CL_COMBINE->COMBINE_MODE->CYCLE1: DECALRGBA

Rendering mode is set as follows.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: AA_ZB_TEX_EDGE


Decal Surface

The model is set as follows.(*)

[MISC]->MODEL->TRIANGLE

The model is set as follows.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: AA_ZB_OPA_DECAL

The BG model is set as follows.(*)

[MISC]->BG_MODEL->PLANE


Interpenetration Mode

The model is set as follows.(*)

[MISC]->MODEL->TETRA

Rendering mode is set as follows.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: AA_ZB_OPA_INTER

The BG model is set as follows.(*)

[MISC]->BG_MODEL->PLANE

The BG model is set as follows.


Particle Effects

Rendering mode is set as follows.(*)

[RDP]->BLENDER->RENDER_MODE->CYCLE1: AA_ZB_PCL_SURF

Alpha comparison is set as follows.(*)

[RDP]->BLENDER->CD AD AC->G_AC_DITHER

Note With the macros in PR/gbi.h, the alpha comparison is set automatically when the G_RM_*_PCL_SURF setting is specified. Under the ccbl specifications, the alpha comparison cannot be set while in a RENDER_MODE, so be sure to specify the alpha comparison here.

A common bug is to set the alpha comparison after the rendering mode, so that even if G_RM_*_PCL_SURF is specified as the rendering mode, it is subsequently overwritten with the alpha comparison setting.


Miscellaneous Items


Menu Rendering Mode

The menu rendering mode used is G_RM_XLU_SURF.
Because this mode uses the CVG_DIST_FULL setting, it may corrupt the cover values for the display model. For a proper display, turn off the menu display.


Near/Far-Plane Clipping Values

ccblJ sets the near-plane clipping value to 500 and the far-plane clipping value to 20,000. These are not necessarily recommended values.
Values that are appopriate for the application should be selected.


Unsupported Combine Modes

The Combine mode macro settings shown below are not supported. In addition, parameters for these settings have been omitted. The Color Combiner parameters can be set directly.

G_CC_TEMPLERP
G_CC_1CYUV2RGB
G_CC_YUV2RGB
G_CC_CHROMA_KEY2

Performance Meter

The nuDebTaskPerfBar1() function of NuSystem is used as the performance meter. For information on the performance meter, see the NuSysytem documentation.
The performance meter includes not only the model display time but also latencies such as the time for frame buffer clearing and menu display.


Parameters that ccbl Cannot Set

ccbl cannot be used to set items that are not closely related to Color Combiner and Blender.
In developing an actual application, setting only those parameters that can be set by ccbl will not produce a proper display. Please use the documentation and sample source code available as references.