mirror of
https://github.com/libretro/ppsspp.git
synced 2024-11-24 00:29:57 +00:00
Support reversing normals in software transform.
This commit is contained in:
parent
d4c416a437
commit
171a865b37
@ -213,6 +213,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
||||
Vec3ByMatrix43(out, pos, gstate.worldMatrix);
|
||||
if (reader.hasNormal()) {
|
||||
reader.ReadNrm(normal.AsArray());
|
||||
if (gstate.areNormalsReversed()) {
|
||||
normal = -normal;
|
||||
}
|
||||
Norm3ByMatrix43(worldnormal.AsArray(), normal.AsArray(), gstate.worldMatrix);
|
||||
worldnormal = worldnormal.Normalized();
|
||||
}
|
||||
@ -242,7 +245,10 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
|
||||
Vec3ByMatrix43(out, psum.AsArray(), gstate.worldMatrix);
|
||||
if (reader.hasNormal()) {
|
||||
normal = nsum;
|
||||
Norm3ByMatrix43(worldnormal.AsArray(), nsum.AsArray(), gstate.worldMatrix);
|
||||
if (gstate.areNormalsReversed()) {
|
||||
normal = -normal;
|
||||
}
|
||||
Norm3ByMatrix43(worldnormal.AsArray(), normal.AsArray(), gstate.worldMatrix);
|
||||
worldnormal = worldnormal.Normalized();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user