Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighting regressions (Black objects) #101

Open
JayFoxRox opened this issue Jun 11, 2017 · 3 comments
Open

Lighting regressions (Black objects) #101

JayFoxRox opened this issue Jun 11, 2017 · 3 comments

Comments

@JayFoxRox
Copy link
Collaborator

Current revision is 1d968aa
Caused by / See #46 (comment)

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)

@PatrickvL
Copy link

PatrickvL commented Jun 11, 2017

Perhaps it's because lightInfiniteHalfVector and it's sibling aren't initialized?

Edit: nevermind. It seems those are bound in nv2a.cpp

@PatrickvL
Copy link

A possible cause could be that some nv2a registers are written outside their bounds, perhaps eye position, perhaps something else

Repository owner deleted a comment from PatrickvL Jun 11, 2017
@JayFoxRox
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants