Skip to content
New issue

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

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

Already on GitHub? # to your account

[rmodels] Improve default normal and tangent values (UploadMesh) #4763

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

Bigfoot71
Copy link
Contributor

@Bigfoot71 Bigfoot71 commented Feb 13, 2025

Description:

This PR updates the default normal and tangent values used when a mesh lacks corresponding buffers.

Changes:

  • Default normal: Changed from (1, 1, 1) to (0, 0, 1) to ensure a properly normalized default normal, aligned with the standard convention of pointing out of the surface.
  • Default tangent: Changed from (0, 0, 0, 0) to (1, 0, 0, 1) to provide a valid and reliable fallback for constructing the bitangent in shaders.

Benefits:

  • Avoids potential problems when calculating the bitangent from a tangent that has a zero value.
  • You can achieve optional normal mapping without requiring extra checks/shaders or conditional branches in shaders.

@Bigfoot71 Bigfoot71 changed the title Improve default normal and tangent values [rmodels] Improve default normal and tangent values (UploadMesh) Feb 13, 2025
@raysan5 raysan5 merged commit c647d33 into raysan5:master Feb 14, 2025
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Feb 14, 2025

@Bigfoot71 Looks good! Thanks for the improvement!

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

Successfully merging this pull request may close these issues.

2 participants