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 not changing on model when rotated. #1

Open
ActingBadly opened this issue Oct 8, 2024 · 0 comments
Open

Lighting not changing on model when rotated. #1

ActingBadly opened this issue Oct 8, 2024 · 0 comments

Comments

@ActingBadly
Copy link

ActingBadly commented Oct 8, 2024

Lighting does not change on the model when it is rotated. I corrected this by adding the following at the bottom on your default.vert shader replacing "normal = updatedNormal;" Seems to work nicely now. Great work, this really helped me get my code working. Cheers.

mat3 normalMatrix = transpose(inverse(mat3(M)));
normal = normalize(normalMatrix * updatedNormal);

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

1 participant