godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.11k stars 21.18k forks source link

Weird rendering results in godot 4.x #88619

Closed dszhblx closed 8 months ago

dszhblx commented 8 months ago

Tested versions

Reproducible in 4.3dev3,4.2.1.stable.Not reproducible in 3.5.stable

System information

Windows 10 - Gotdot 4.3Dev3

Issue description

I used some Glb models to stitch the map. One of the models is rendered a little strangely in Godot4.3Dev3. Make two copies of this model, rotate one of them -90 degrees along the Y-axis and join them together. At this time, the surface colors of the two instances are inconsistent. But I used the same method to test in Blender and Godot3.5, and the surface colors obtained were consistent.

the surface colors of the two instances are inconsistent: glb_4 3

the surface colors obtained were consistent: glb_3 5

Steps to reproduce

unzip TestGlb.zip and open the project using godot 4.3dev3 or 4.2 open main.tscn

Minimal reproduction project (MRP)

TestGlb.zip

dszhblx commented 8 months ago

Blender test: blender

U3D test: u3d

Saul2022 commented 8 months ago

This is likely to be , because of the lighting defaults, because in 4.x they were modifed to archieve a better default look. Try tweaking the world enviroment node that is in the 3 dots in the top and https://docs.godotengine.org/en/stable/tutorials/3d/environment_and_post_processing.html

Screenshot_2024-02-21-14-49-58-42_40deb401b9ffe8e1df2f1cc5ba480b12

Edit: It may also might be , because 4.2 uses a optimized, try dissabling it, if something changes.

dszhblx commented 8 months ago

This is likely to be , because of the lighting defaults, because in 4.x they were modifed to archieve a better default look. Try tweaking the world enviroment node that is in the 3 dots in the top and https://docs.godotengine.org/en/stable/tutorials/3d/environment_and_post_processing.html

Screenshot_2024-02-21-14-49-58-42_40deb401b9ffe8e1df2f1cc5ba480b12

Edit: It may also might be , because 4.2 uses a optimized, try dissabling it, if something changes.

Completely disable environment settings and only use a Directionallight to illuminate the models, the problem still exists. It looks like the lighting calculation for the model on the right is wrong.

light TestGlb_light.zip

clayjohn commented 8 months ago

Running locally, it looks like the normals are getting compressed wrong

This is how the normals look Screenshot from 2024-02-23 11-14-58

This is how the normals should look (captured by disabling mesh compression) Screenshot from 2024-02-23 11-15-04

dszhblx commented 8 months ago

Godot 4.3 dev 4 fixed this bug. Thanks.