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

LOD: Remove "Raycast Normals" and associated "Normal Split Angle" settings #98620

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

zeux
Copy link
Contributor

@zeux zeux commented Oct 28, 2024

"Raycast Normals" was introduced in 4.4 dev and defaulted to "false". The limited testing results at the time suggested that raycasting generally reduces normal quality compared to native simplifier results, at the same time increasing vertex memory and import time.

To play it safe, we introduced a setting that defaulted to false, with the goal of removing it later in 4.4 development cycle if no regressions are noticed. Since we already had three dev snapshots and no reports, this change removes the setting and associated code.

"Normal Split Angle" was only used when raycast normals were enabled; this change removes it from the settings, but keeps it in the script binding for compatibility.

split_normals helper was only used in this code path and is also removed for simplicity; it is unlikely that this code will be useful as is, as it can only regenerate normals without fixing tangents or updating positions.

Note that documentation was updated to not mention the "suggested" values for merge normals angle in the script binding. The recommendation given by the documentation was reversed from the default (which is 60 and 25, not 25 and 60!), and 60 seems too aggressive to recommend even if that's the current import default.

Tested by importing existing projects (both with default settings and with overridden merge angle per mesh); meshes import the same after this change. If a mesh had "raycast normals" setting enabled, it will now import without it as the setting was removed; this is the same as the transition from any 4.3 project to earlier 4.4 dev builds so no new behavior is introduced unless raycast normals were enabled in 4.4 dev which would be unusual.

…tings

"Raycast Normals" was introduced in 4.4 dev and defaulted to "false".
The limited testing results at the time suggested that raycasting
generally reduces normal quality compared to native simplifier results,
at the same time increasing vertex memory and import time.

To play it safe, we introduced a setting that defaulted to false, with
the goal of removing it later in 4.4 development cycle if no regressions
are noticed. Since we already had three dev snapshots and no reports,
this change removes the setting and associated code.

"Normal Split Angle" was only used when raycast normals were enabled;
this change removes it from the settings, but keeps it in the script
binding for compatibility.

Existing meshes import exactly the same after this change (unless they
chose to override raycasting which would be surprising).

split_normals helper was only used in this code path and is also removed
for simplicity; it is unlikely that this code will be useful as is, as
it can only regenerate normals without fixing tangents or updating
positions.
@zeux zeux requested review from a team as code owners October 28, 2024 17:22
@zeux
Copy link
Contributor Author

zeux commented Oct 28, 2024

Mesh import settings after this change ("10" is the value I've set manually before this PR to check that it persists correctly, the default is still 60):

image

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me.

Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fire fire requested a review from a team October 28, 2024 21:55
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following up on this. Indeed, there have been no complaints about raycast normals defaulting to off. So I agree it is safe to remove!

@clayjohn clayjohn modified the milestones: 4.x, 4.4 Oct 31, 2024
@clayjohn clayjohn merged commit 7187c25 into godotengine:master Oct 31, 2024
20 checks passed
@clayjohn
Copy link
Member

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

4 participants