This page covers information for programmers who create custom shaders.
The default shader settings of NW4C are given below.
This is a provisional setting and may be changed.
| Name | Registers | Number | Description |
|---|---|---|---|
| aPosition | -- | 1 | Vertex position information. |
| aNormal | -- | 1 | Normal vector information of vertex. |
| aTangent | -- | 1 | Tangent vector information of vertex. |
| aColor | -- | 1 | Vertex color information. (w is also used by the hemisphere light alpha.) |
| aTexCoord0 | -- | 1 | Texture coordinate information of vertex. |
| aTexCoord1 | -- | 1 | Texture coordinate information of vertex. |
| aTexCoord2 | -- | 1 | Texture coordinate information of vertex. |
| aBoneIndex | -- | 1 | Bone index number information of vertex. |
| aBoneWeight | -- | 1 | Vertex bone weight information. |
| Being Studied | -- | -- | Vertex morphing delta attribute information. |
| Name | Registers | Number | Description |
|---|---|---|---|
| ProjMtx | c0 | 4 | Projection matrix |
| ViewMtx | c4 | 3 | View matrix. |
| NormMtx | c7 | 3 | Normal matrix |
| PosOffs | c10 | 1 | Position offset for input registers |
| IrScale | c11 | 3 | Scale for input register |
| TexcMap | c14 | 1 | Texture coordinate allocation |
| TexMtx0 | c15 | 3 | Texture coordinate matrix 0 |
| TexMtx1 | c18 | 3 | Texture coordinate matrix 1 |
| TexMtx2 | c21 | 3 | Texture coordinate matrix 2 |
| -- | c24 | 3 | Reserved |
| MatAmbi | c27 | 1 | Material ambient color (w = VertexColorScale) |
| MatDiff | c28 | 1 | Material diffuse color |
| HslGCol | c29 | 1 | Ground color for hemispherical lighting |
| HslSCol | c30 | 1 | Space color for hemispherical lighting |
| HslSDir | c31 | 1 | Directional vector toward space for hemispherical lighting (w = LerpFactor) |
| UnivReg | c32 | 60 | General-purpose register (variable: first half, matrix palette; second half, light settings) |
| 3 x ? | Position matrix | ||
| 3 x ? | Normal matrix | ||
| 4 | Light ambient color | ||
| 4 | Light diffuse color | ||
| 4 | Light position (w = IsDirectionalLight) | ||
| 4 | Spotlight direction (w = IsSpotLightEnabled) | ||
| 4 | Light distance attenuation parameter (x = K0, y = K1, z = K2, w = IsAttenuationDistanceEnabled) | ||
| 4 | List spot parameter (x = SpotExponent , y = SpotCutoffAngle) | ||
| UserVal | c92 | 1 | User register. |
| -- | c93 | 3 | Constant value |
| Name | Registers | Number | Description |
|---|---|---|---|
| IsSkinM | b1 | 1 | Skinning ON/OFF |
| IsRgdSk | b2 | 1 | Rigid skinning ON/OFF |
| IsUniSc | b3 | 1 | Uniform scale ON/OFF |
| UseNorM | b4 | 1 | Use normal matrix ON/OFF |
| IsHemiL | b5 | 1 | Hemispherical light ON/OFF |
| IsHemiO | b6 | 1 | Hemispherical light occlusion ON/OFF |
| IsVertA | b7 | 1 | Vertex color alpha ON/OFF |
| IsBoneW | b8 | 1 | Bone weight ON/OFF |
| TexPos0 | b9 | 1 | Texture coordinate 0 ON/OFF |
| TexPos1 | b10 | 1 | Texture coordinate 1 ON/OFF |
| TexPos2 | b11 | 1 | Texture coordinate 2 ON/OFF |
| IsVertL | b12 | 1 | Vertex light ON/OFF |
| Name | Registers | Number | Description |
|---|---|---|---|
| LightCt | i0 | 1 | Number of vertex lights (loop counter) |
| i1 | 1 | ||
| i2 | 1 | ||
| i3 | 1 |
CONFIDENTIAL