Fragment lighting fixed (!)
This commit is contained in:
parent
133d10c629
commit
a0345263df
@ -220,6 +220,7 @@ void C3Di_UpdateContext(void)
|
|||||||
u32 enable = env != NULL;
|
u32 enable = env != NULL;
|
||||||
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE0, enable);
|
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE0, enable);
|
||||||
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE1, !enable);
|
GPUCMD_AddWrite(GPUREG_LIGHTING_ENABLE1, !enable);
|
||||||
|
GPUCMD_AddMaskedWrite(GPUREG_006F, 0x8, enable<<24); // Enable normalquat (& view?) outputs
|
||||||
ctx->flags &= ~C3DiF_LightEnv;
|
ctx->flags &= ~C3DiF_LightEnv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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->flags = C3DF_Light_Enabled | C3DF_Light_Dirty | C3DF_Light_MatDirty;
|
||||||
light->id = i;
|
light->id = i;
|
||||||
light->parent = env;
|
light->parent = env;
|
||||||
light->conf.config = BIT(0);
|
|
||||||
|
|
||||||
env->flags |= C3DF_LightEnv_LCDirty;
|
env->flags |= C3DF_LightEnv_LCDirty;
|
||||||
return i;
|
return i;
|
||||||
@ -81,7 +80,7 @@ void C3D_LightPosition(C3D_Light* light, C3D_FVec* pos)
|
|||||||
{
|
{
|
||||||
// Enable/disable positional light depending on W coordinate
|
// Enable/disable positional light depending on W coordinate
|
||||||
light->conf.config &= ~BIT(0);
|
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[0] = f32tof16(pos->x);
|
||||||
light->conf.position[1] = f32tof16(pos->y);
|
light->conf.position[1] = f32tof16(pos->y);
|
||||||
light->conf.position[2] = f32tof16(pos->z);
|
light->conf.position[2] = f32tof16(pos->z);
|
||||||
|
Loading…
Reference in New Issue
Block a user