mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
softgpu: Fix worldpos skipping.
Oops, was reversed. We need worldpos for non-directional lights.
This commit is contained in:
parent
112d0adde9
commit
d6a5e84db5
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ void ComputeState(State *state, bool hasColor0) {
|
|||
bool anyAmbient = false;
|
||||
bool anyDiffuse = false;
|
||||
bool anySpecular = false;
|
||||
bool anyDirectional = false;
|
||||
bool anyNonDirectional = false;
|
||||
for (int light = 0; light < 4; ++light) {
|
||||
auto &lstate = state->lights[light];
|
||||
lstate.enabled = gstate.isLightChanEnabled(light);
|
||||
|
@ -120,9 +120,9 @@ void ComputeState(State *state, bool hasColor0) {
|
|||
lstate.directional = gstate.isDirectionalLight(light);
|
||||
if (lstate.directional) {
|
||||
lstate.pos.NormalizeOr001();
|
||||
anyDirectional = true;
|
||||
} else {
|
||||
lstate.att = GetLightVec(gstate.latt, light);
|
||||
anyNonDirectional = true;
|
||||
}
|
||||
|
||||
lstate.spot = gstate.isSpotLight(light);
|
||||
|
@ -183,7 +183,7 @@ void ComputeState(State *state, bool hasColor0) {
|
|||
state->baseAmbientColorFactor = LightColorFactor(gstate.getAmbientRGBA(), ones);
|
||||
state->setColor1 = gstate.isUsingSecondaryColor() && anySpecular;
|
||||
state->addColor1 = !gstate.isUsingSecondaryColor() && anySpecular;
|
||||
state->usesWorldPos = anyDirectional;
|
||||
state->usesWorldPos = anyNonDirectional;
|
||||
state->usesWorldNormal = gstate.getUVGenMode() == GE_TEXMAP_ENVIRONMENT_MAP || anyDiffuse || anySpecular;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue