mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-11 13:36:24 +02:00
softgpu: Calc worldnormal a bit less often.
This is clearer anyway.
This commit is contained in:
1 parent
59fb374c38
commit
b5206df04f
3 files changed
+13
-9
No files matched your search
@@ -273,12 +273,9 @@ void ComputeTransformState(TransformState *state, const VertexReader &vreader) {
|
||||
bool canSkipWorldPos = true;
|
||||
if (state->enableLighting) {
|
||||
Lighting::ComputeState(&state->lightingState, vreader.hasColor0());
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
if (!state->lightingState.lights[i].enabled)
|
||||
continue;
|
||||
if (!state->lightingState.lights[i].directional)
|
||||
canSkipWorldPos = false;
|
||||
}
|
||||
canSkipWorldPos = !state->lightingState.usesWorldPos;
|
||||
} else {
|
||||
state->lightingState.usesWorldNormal = state->uvGenMode == GE_TEXMAP_ENVIRONMENT_MAP;
|
||||
}
|
||||
|
||||
float world[16];
|
||||
@@ -412,7 +409,7 @@ ClipVertexData TransformUnit::ReadVertex(const VertexReader &vreader, const Tran
|
||||
vertex.v.clipw = vertex.clippos.w;
|
||||
|
||||
Vec3<float> worldnormal;
|
||||
if (state.enableLighting || state.uvGenMode == GE_TEXMAP_ENVIRONMENT_MAP) {
|
||||
if (state.lightingState.usesWorldNormal) {
|
||||
worldnormal = TransformUnit::ModelToWorldNormal(normal);
|
||||
worldnormal.NormalizeOr001();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user