You need two texenv stages to blend the texture color with the fragment lighting color, like this:
Code: Select all
environment = C3D_GetTexEnv(0);
C3D_TexEnvSrc(environment, C3D_Both, GPU_FRAGMENT_PRIMARY_COLOR, GPU_FRAGMENT_SECONDARY_COLOR, 0);
C3D_TexEnvFunc(environment, C3D_Both, GPU_ADD);
environment = C3D_GetTexEnv(1);
C3D_TexEnvSrc(environment, C3D_Both, GPU_PREVIOUS, GPU_TEXTURE0, 0);
C3D_TexEnvFunc(environment, C3D_Both, GPU_MODULATE);
In effect, these texenv settings calculate (fragPrimaryColor + fragSecondaryColor) * texture0Color.