diff --git a/GPU/Software/Lighting.cpp b/GPU/Software/Lighting.cpp index 302d1a7055..67e21b4028 100644 --- a/GPU/Software/Lighting.cpp +++ b/GPU/Software/Lighting.cpp @@ -131,7 +131,9 @@ void Process(VertexData& vertex, bool hasColor) { } if (diffuse_factor > 0.0f) { - int diffuse_attspot = (int)ceilf(attspot * diffuse_factor + 1); + int diffuse_attspot = (int)ceilf(256 * 2 * att * spot * diffuse_factor + 1); + if (diffuse_attspot > 512) + diffuse_attspot = 512; Vec4 ldc = Vec4::FromRGBA(gstate.getDiffuseColor(light)); Vec4 mdc = (materialupdate & 2) ? vertex.color0 : Vec4::FromRGBA(gstate.getMaterialDiffuse()); Vec4 ldiffuse = ((ldc * 2 + ones) * (mdc * 2 + ones) * diffuse_attspot) / (1024 * 512); @@ -145,8 +147,8 @@ void Process(VertexData& vertex, bool hasColor) { float k = gstate.getMaterialSpecularCoef(); specular_factor = pspLightPow(specular_factor, k); - if (specular_factor > 0.f) { - int specular_attspot = (int)ceilf(attspot * specular_factor + 1); + if (specular_factor > 0.0f) { + int specular_attspot = (int)ceilf(256 * 2 * att * spot * specular_factor + 1); if (specular_attspot > 512) specular_attspot = 512; Vec4 lsc = Vec4::FromRGBA(gstate.getSpecularColor(light)); diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index 7902e95aff..11eeda3f68 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -227,7 +227,7 @@ VertexData TransformUnit::ReadVertex(VertexReader &vreader, bool &outside_range_ vertex.screenpos = ClipToScreenInternal(vertex.clippos, &outside_range_flag); if (vreader.hasNormal()) { - vertex.worldnormal = TransformUnit::ModelToWorldNormal(vertex.normal).Normalized(cpu_info.bSSE4_1); + vertex.worldnormal = TransformUnit::ModelToWorldNormal(vertex.normal).NormalizedOr001(cpu_info.bSSE4_1); } else { vertex.worldnormal = Vec3(0.0f, 0.0f, 1.0f); }