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

2D normal mapping rotations incorrect #41324

Closed
lawnjelly opened this issue Aug 17, 2020 · 1 comment
Closed

2D normal mapping rotations incorrect #41324

lawnjelly opened this issue Aug 17, 2020 · 1 comment
Assignees
Milestone

Comments

@lawnjelly
Copy link
Member

Godot version:
3.2.2

OS/device including version:
All (GLES2 and GLES3)

Issue description:
Note this is a stub issue for reference, to illustrate the problem which is now hopefully fixed with 2 PRs.

When using normal mapping in 2D, flips and rotations only produce correct results in the old TEXTURE_RECT (uniform draw) method. The results are incorrect with GLES2 and GLES3 nvidia workarounds, and with GLES2 batching.

i.e. If you rotate a sprite, or flip, the normal mapping will not adjust according to the new orientation with the light.

In GLES2 and GLES3 nvidia workaround, rotations work but flips do not.
In GLES2 batching, both flips and rotations do not work.

Steps to reproduce:
Add a normal mapped sprite using GLES2 or GLES3 using nvidia_workaround project setting, or GLES2 batching.
Add a 2D light so you can see the normal map lighting.

Flip and rotate the sprite. Note that the normal maps do not rotate correctly to match the lighting.

@akien-mga
Copy link
Member

Fixed by #41323 and #41254.

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

No branches or pull requests

2 participants