xqemu
xqemu copied to clipboard
Lighting regressions (Black objects)
Current revision is 1d968aa47b861bc4ae07ecee8fd9820dafa8562f Caused by / See https://github.com/espes/xqemu/pull/46#issuecomment-307204451
Objects which used to look fine are black now.
I've looked a bit into the Smashing Drive issue:
- Fixed function shading is turned on.
- Lighting is turned on.
- Only one light is enabled (Light 0, Infinite light type).
- No normals supplied (
glVertexAttrib4fv(index = 2, v = [0, 0, 0, 0])).
I did not verify if NHL Hitz 2002 runs into the exact same issue / situation. However, it still worked prior to #46 and doesn't work anymore now.
Affected games:
- Smashing Drive (Logos and sky + a lot of objects in intro are black)
- NHL Hitz 2002 (Ice / Stadium are black)
(Thanks to @JohnGodgames for testing + reporting the issue with NHL Hitz 2002; the Smashing Drive report is mine)
Perhaps it's because lightInfiniteHalfVector and it's sibling aren't initialized?
Edit: nevermind. It seems those are bound in nv2a.cpp
A possible cause could be that some nv2a registers are written outside their bounds, perhaps eye position, perhaps something else
The cause is that a lamberts term with a zero-vector (= Normal here) is: 0.0 * x + 0.0 * y + 0.0 * z = 0.0. So there is no light contribution in the scene. No light means that everything is not lit / black.