Skip to content

Conversation

@yunusey
Copy link
Contributor

@yunusey yunusey commented Dec 17, 2023

This pull request addresses an issue with UV mapping in the sample code provided in the Godot Documentation for creating a procedural mesh. The original code resulted in a UV mapping discrepancy, which has been corrected in this update.

Problem: The last radial segment didn't have correct UV mapping.

Solution: Created dummy vertices for the last segment of the sphere, and used those to generate correct UV mapping.

MeshGenerationTest

To test it yourself, you can download this project:
MeshGenerationTest.zip

@skyace65
Copy link
Contributor

I think you might have found an engine bug that was patched in 4.2.1. I booted up your example project in 4.2.1 and this is what I'm seeing:

Screenshot 2023-12-17 202909

The only thing that looks off is on the back of the spheres and it appears for the old and new code:

Screenshot 2023-12-17 203022

@yunusey
Copy link
Contributor Author

yunusey commented Dec 18, 2023

Thanks for the feedback! What you see in the viewport for both spheres is generated by the existing code, so it doesn't reflect the difference. You need to run the program in order to see the difference between the existing code and what this PR proposes.

@skyace65
Copy link
Contributor

Apologies, the new code definitely looks better.

@mhilbrunner mhilbrunner added bug topic:rendering area:manual Issues and PRs related to the Manual/Tutorials section of the documentation cherrypick:4.2 labels Dec 18, 2023
@mhilbrunner mhilbrunner merged commit 833e2c4 into godotengine:master Dec 18, 2023
@mhilbrunner
Copy link
Member

Merged. Thanks and congrats on your first merged contribution!

@yunusey yunusey deleted the dev branch December 18, 2023 21:13
mhilbrunner added a commit that referenced this pull request Jan 25, 2024
Fix UV mapping in ArrayMesh tutorial
@mhilbrunner
Copy link
Member

Cherry-picked to 4.2.

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

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation bug topic:rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants