by sakitume » Fri Nov 06, 2009 3:32 pm
Great news. Thanks for the update.
If it helps, my test case is super simple and uses a single, plain, non-attenuated diffuse directional light. I setup the lighting with COLOR0A0 as follows:
GXSetChanCtrl(GX_COLOR0A0, GX_ENABLE, GX_SRC_REG, GX_SRC_REG, GX_LIGHT0, GX_DF_CLAMP, GX_AF_NONE);
I set the light position to be very very far away (to mimic an infinitely far directional light):
// lightPos is set and is in view space
lightPos.norm();
lightPos *= 1.e18f;
GXInitLightPos(&lightObj, lightPos.x, lightPos.y, lightPos.z);
The light attenuation terms are set to be 1,0,0,1,0,0, This shouldn't be necessary with the GX but I do it anyways. I do that using these functions:
GXInitLightSpot(&lightObj, 45.0F, GX_SP_OFF );
GXInitLightDistAttn(&lightObj, 0.0F, 0.5F, GX_DA_OFF );
I setup the normal matrix correctly, I've tried using both versions, on different occasions, (providing the proper version of the matrix: 3x4 versus 4x4) just in case one was buggy:
GX_LoadNrmMtxImm() and GX_LoadNrmMtxImm3x3()
I could give more specific descriptions to shagkur if desired, please don't hesitate to ask.
Cheers,
sakitume