https://bugs.winehq.org/show_bug.cgi?id=41827
--- Comment #2 from Matteo Bruni matteo.mystral@gmail.com --- Thank you for the bug report.
(In reply to Axel D from comment #1)
. The fact that when specular is not saturated, wine has the correct behaviour seems to show that the formulat for t is ok. . The fact that when saturated it should be same than diffuse saturated shows that the test "if (t > 0.0)" should be replaced by "if (dot(dir, normal) > 0.0)"
I just checked the FFP lighting equation in the OpenGL spec and it turns out that it contains a factor (fi) exactly matching your proposed change. In general OpenGL and D3D don't entirely agree about how to do FFP lighting (D3D does not even agree with itself between different versions) but this one sounds like it should match.
Then I guess pow(t, ffp_material.shininess) should be replaced by pow(abs(t), ffp_material.shininess), but that is just a guess.
It's more likely that we want max(t, 0.0) there.
Do you want to have a go at extending / modifying test_specular_lighting() to check for this edge case?