Skip to content

ArrayMeshes converted from Godot 3.x display incorrectly in 4.0 #63550

@TokisanGames

Description

@TokisanGames

Godot version

4.0alpha 12-15

System information

Win 10/64 NVIDIA GeForce GTX 1060/PCIe/SSE2

Issue description

I've converted over a thousand meshes to GD4 for my game. Countless objects respond to light as if their faces have inverted normals. However, that isn't the case as demonstrated by exporting from Godot and viewing in blender. There's nothing wrong with the normalmap. Inverting it does not help.

Maybe 50% 100% of them are messed up! Hundreds of assets. They previously looked the same as all the other pieces in GD3. I have assets from the same asset pack, the same artist, that were imported using the same version of Godot, through the same process, around the same time, and even using the same material, yet some pieces from the pack are messed up and others are fine.

I also have other objects that flicker and invert depending on camera angle, though it's the same wood material that everything in the village uses. I'm still testing this. It may be another issue.

We imported our meshes with the default settings in GD3 and saved them in Godot's native arraymesh format in tscn files so git isn't overwhelmed by minor updates on binary files. They were converted to GD4 using aaronfranke's script https://gist.github.com/aaronfranke/79b424226475d277d0035b7835b09c5f, which basically just renames poolarray to packedarray and some other renames. The array data should have remained the same until modified by Godot.

The only way I've found to fix this so far is to reimport from the original fbx/glb. But we're talking over 1000 assets need to be audited, hundreds of assets that need to be reexported from our source again, processed through blender, reimported into Godot, then setup in our complex master scenes (eg static bodies, collision shapes, custom materials, LOD, and other scripts). That's several weeks of work if not a couple months.

Examples:

Foot bridge

Here's a bridge with an empty standard material, albedo at 50V. You can see the sun is at X=-30 and the bridge is lit up normally.

image

Now the sun is at X=-150 (30 degrees off of 0). The top of the bridge should be lit up exactly the same as above. Look at the sphere and the ground.

image

I have to rotate it this far (-120 or 50 degrees off 0) to get the top of the bridge to light up when the rotation is on that side.
image

In addition to this strange light angle needed for normal light, the light changes depending on camera angle. It reminds me of this issue #58592 as the brightness of materials shifts a bit when I move the camera around, though it is much more subtle than that issue.

Beams

These two objects are using the exact same material. You can see the light wood on the top faces of the left beam. But the side faces are all dark. They should be as light a the right piece. They are from the same asset pack and were imported the same way.

image

Standard white material

image

Exporting the beams from Godot to blender, the colors look messed up there too. However, the normals point outside. If I recalculate normals, it messes up the mesh even worse. The faces are likely separate.

image

If I bring in the original asset into Godot 4, it looks completely fine. So it appears Godot 4 messed up the arraymesh, requiring reimporting the asset to fix it.

Minimal reproduction project

test_gd4_mesh.zip
(Updated 8/1)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions