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

Fix PlaneMesh tangents for 'Face X' orientation #84097

Merged
merged 1 commit into from Oct 30, 2023

Conversation

stoofin
Copy link
Contributor

@stoofin stoofin commented Oct 28, 2023

PlaneMesh currently uses tangent (1, 0, 0) for all orientations. But the normal for the FACE_X orientation is also (1, 0, 0) so normal maps don't currently work. This pull request would change it in the FACE_X case to (0, 0, -1) which makes it match the others AFAICT.

Before, with Z, Y, X orientations, and a second set all rotated to face Z:
plane-mesh-tangent-bug

After:
plane-mesh-tangent-bug-fixed

Copy link
Member

@kleonc kleonc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pull request would change it in the FACE_X case to (0, 0, -1) which makes it match the others AFAICT.

Can confirm, for other primitive meshes their tangents are into the right (+U) of the texture. For PlaneMesh tangents for FACE_Y/FACE_Z orientations are already consistent with that, and for FACE_X tangent should indeed be -Z. 👍

FACE_Y FACE_Z FACE_X
This PR godot windows editor x86_64_niE1y8862B drA2pLo0ox iXjDOeqfIQ
v4.2.beta3.official [e8d57af] the same the same 24rXewEPUl

@clayjohn clayjohn added the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Oct 29, 2023
@akien-mga akien-mga merged commit ad9297e into godotengine:master Oct 30, 2023
15 checks passed
@akien-mga
Copy link
Member

Thanks!

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Jan 23, 2024
@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.4.

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

Successfully merging this pull request may close these issues.

None yet

5 participants