Fragment lighting fixed (!)

This commit is contained in:
fincs 2015-09-15 17:50:11 +02:00
parent 133d10c629
commit a0345263df
2 changed files with 2 additions and 2 deletions

View File

@ -220,6 +220,7 @@ void C3Di_UpdateContext(void)
u32 enable = env != NULL;
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE0, enable);
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE1, !enable);
GPUCMD_AddMaskedWrite(GPUREG_006F, 0x8, enable<<24); // Enable normalquat (& view?) outputs
ctx->flags &= ~C3DiF_LightEnv;
}

View File

@ -31,7 +31,6 @@ int C3D_LightInit(C3D_Light* light, C3D_LightEnv* env)
light->flags = C3DF_Light_Enabled | C3DF_Light_Dirty | C3DF_Light_MatDirty;
light->id = i;
light->parent = env;
light->conf.config = BIT(0);
env->flags |= C3DF_LightEnv_LCDirty;
return i;
@ -81,7 +80,7 @@ void C3D_LightPosition(C3D_Light* light, C3D_FVec* pos)
{
// Enable/disable positional light depending on W coordinate
light->conf.config &= ~BIT(0);
light->conf.config |= (pos->w != 0.0);
light->conf.config |= (pos->w == 0.0);
light->conf.position[0] = f32tof16(pos->x);
light->conf.position[1] = f32tof16(pos->y);
light->conf.position[2] = f32tof16(pos->z);