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

Surfacetool generated mesh has lighting problem in final triangle #56026

Closed
goatchurchprime opened this issue Dec 17, 2021 · 4 comments
Closed

Comments

@goatchurchprime
Copy link

goatchurchprime commented Dec 17, 2021

Godot version

3.4-stable

System information

Windows10/Quest2(Android) and GLES2/GLES3

Issue description

This problem shows up in my App where I have a sequence of points between which I draw thin rectangles so it looks like a series of line segments.

For some reason the lighting is calculated from the other side of the surface in a way that is not consistent with the triangles.

The triangles are complete diagonals from one corner to the opposite corner of the rectangle.

The lighting goes wrong in half of one of the triangles.

image

In fact the problem always occurs in part of the final triangle that is added to the SurfaceTool.

image

Steps to reproduce

see below.

When you run the minimal project it prints out the value of SurfaceTool.commit_to_arrays() to show that the normals are all correctly oriented:

ARRAY_FORMAT_VERTEX: [(0, -0.2, 0), (2, -0.2, 0), (0, 0.2, 0), (0, 0.2, 0), (2, -0.2, 0), (2, 0.2, 0)]
ARRAY_FORMAT_NORMAL: [(-0, -0, -1), (-0, -0, -1), (-0, -0, -1), (0, 0, -1), (0, 0, -1), (0, 0, -1)]

Minimal reproduction project

surfacetoolproblem.zip

@lawnjelly
Copy link
Member

Posting this issue just in case related, as that was to do with final triangles also: #52399

@clayjohn
Copy link
Member

Yes, looks like a duplicate of #52399 which was fixed by #54768 which will be in the upcoming 3.4.1 release.

@goatchurchprime Can you please try RC3 and let us know if the issue is fixed for you. You can download RC3 here: https://downloads.tuxfamily.org/godotengine/3.4.1/rc3/

@goatchurchprime
Copy link
Author

goatchurchprime commented Dec 17, 2021

Yep, it's not there in 3.4.1/rc3

Do I just close it? Is there a way to merge it in as a duplicate?

@akien-mga
Copy link
Member

Duplicate of #52399

@akien-mga akien-mga marked this as a duplicate of #52399 Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants