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

strange normal map behaviour on some meshes #71571

Closed
djmaesen opened this issue Jan 17, 2023 · 5 comments · Fixed by #73265
Closed

strange normal map behaviour on some meshes #71571

djmaesen opened this issue Jan 17, 2023 · 5 comments · Fixed by #73265

Comments

@djmaesen
Copy link

Godot version

4.0 beta 12

System information

windows 10

Issue description

im getting artifacts on some meshes. the normal map isnt applied correctly.
189929140-9ea8b81f-4727-4c92-9e0c-93c0b6d4834c
212738089-7ecb8db8-8829-4f03-a9e4-6467d37dc2b7

Steps to reproduce

ive attached the barrel model to reproduce the issue.

import the model and apply a standard material with the maps provided.

Minimal reproduction project

exploBarrel.zip

@Calinou
Copy link
Member

Calinou commented Jan 17, 2023

Is the mesh triangulated on export, either by using a Triangulate modifier in Blender and ensuring Apply Modifiers is enabled in the export dialog, or by checking an appropriate triangulate option in the exporter?

This is more reliable than letting the game engine do it. (This advice is not specific to Godot; it applies to any 3D application you'd export a mesh to.)

@djmaesen
Copy link
Author

Is the mesh triangulated on export, either by using a Triangulate modifier in Blender and ensuring Apply Modifiers is enabled in the export dialog, or by checking an appropriate triangulate option in the exporter?

This is more reliable than letting the game engine do it. (This advice is not specific to Godot; it applies to any 3D application you'd export a mesh to.)

the barrel isnt
but the weapon and arms are triangulated

@djmaesen
Copy link
Author

Is the mesh triangulated on export, either by using a Triangulate modifier in Blender and ensuring Apply Modifiers is enabled in the export dialog, or by checking an appropriate triangulate option in the exporter?

This is more reliable than letting the game engine do it. (This advice is not specific to Godot; it applies to any 3D application you'd export a mesh to.)

i just tried the barrel with triangulation applied before import, same result.

@Flavelius
Copy link
Contributor

i had a look at the file and it actually seems to be a godot issue (i also tried exporting with different modifications (like merged verts, non-sharp, non/autosmooth, normal edit modifier etc) and export options. Blender's mesh analysis tools also confirm that there are no normal issues or overlaps etc. And when importing the barrel in a different orientation, those artifacts even occur in different locations in godot.

@tagcode
Copy link

tagcode commented Apr 14, 2023

On Godot 4.0.2, I'm having issue with normal mapped materials and normals that point at (0, 0, -1).

normalmap-bug

When I adjust normals near Z=-1, the normalmap issues goes away:
float dot = normal.Dot(Vector3.Forward); if (dot > 0.99f) normal = new Vector3(0.1f, 0.1f, -0.9f).Normalized();

normalmap-bug-With-workaround

EDIT!: The issue goes away when I calculate tangents manually. It seems to be in the ArrayMesh's automatic tangent calculation.

I've ran this exact same mesh procedure on Unity3D and Stride3D. This automatic tangent issue appears only on Godot.

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

Successfully merging a pull request may close this issue.

5 participants