Mesh: Add viewport normals simplify option #5

Closed
Hans Goudey wants to merge 1 commits from mesh-normals-simplify-option into refactor-mesh-corner-normals-lazy

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Owner

Before #108014, toggling "Auto Smooth" was an easy way to disable
evaluation of custom normals and face corner normals for faster
viewport playback performance. Now that corner normals are calculated
automatically as necessary, it's helpful to still have a way to disable
expensive normal computation for faster playback.

This commit adds a "Normals" scene simplify setting. To avoid a bunch
of complexity, it just influences which normals are requested from the
object by viewport rendering. In my tests, skipping calculating at
least doubled viewport FPS in a few test files with a large mesh with
custom normals. This works well because normals are cached and lazily
calculated.

Before #108014, toggling "Auto Smooth" was an easy way to disable evaluation of custom normals and face corner normals for faster viewport playback performance. Now that corner normals are calculated automatically as necessary, it's helpful to still have a way to disable expensive normal computation for faster playback. This commit adds a "Normals" scene simplify setting. To avoid a bunch of complexity, it just influences which normals are requested from the object by viewport rendering. In my tests, skipping calculating at least doubled viewport FPS in a few test files with a large mesh with custom normals. This works well because normals are cached and lazily calculated.
Hans Goudey added 1 commit 2023-09-29 20:40:54 +02:00
15143b0eb1 Mesh: Add viewport normals simplify option
Before #108014, toggling "Auto Smooth" was an easy way to disable
evaluation of custom normals and face corner normals for faster
viewport playback performance. Now that corner normals are calculated
automatically as necessary, it's helpful to still have a way to disable
expensive normal computation for faster playback.

This commit adds a "Normals" scene simplify setting. To avoid a bunch
of complexity, it just influences which normals are requested from the
object by viewport rendering. In my tests, skipping calculating at
least doubled viewport FPS in a few test files with a large mesh with
custom normals. This works well because normals are cached and lazily
calculated.
First-time contributor

Looks reasonable to me, and more logical than "simplifying" normals by disabling auto-smooth.

Looks reasonable to me, and more logical than "simplifying" normals by disabling auto-smooth.
Lukas Tönne reviewed 2023-09-30 10:13:08 +02:00
@ -2119,1 +2117,3 @@
R_MODE_UNUSED_27 = 1 << 27, /* cleared */
R_EDGE_FRS = 1 << 25, /* R_EDGE reserved for Freestyle */
R_PERSISTENT_DATA = 1 << 26, /* Keep data around for re-render. */
R_SIMPLIFY_NORMALS = 1 << 27, /* cleared */
First-time contributor

How are these flags assigned? I don't know the usage and history, but why not use the lower bits? Or add a new one if they are somehow reserved? Seems kind of arbitrary.

How are these flags assigned? I don't know the usage and history, but why not use the lower bits? Or add a new one if they are somehow reserved? Seems kind of arbitrary.
Lukas Tönne approved these changes 2023-09-30 10:13:14 +02:00
Hans Goudey closed this pull request 2023-10-20 16:54:22 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HooglyBoogly/blender#5
No description provided.