Skip to content

#3988 Don't render malformed sculpts#5951

Open
akleshchev wants to merge 1 commit into
developfrom
andreyk/viewer_3988
Open

#3988 Don't render malformed sculpts#5951
akleshchev wants to merge 1 commit into
developfrom
andreyk/viewer_3988

Conversation

@akleshchev

@akleshchev akleshchev commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Not sure if this is a good idea, but malformed sculpts hit performance hard and this change seems to work with the example I have.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to mitigate severe performance impact from malformed sculpt maps by validating generated sculpt geometry and substituting an empty placeholder mesh when the geometry appears pathological. It adds a small per-LOD cache to avoid repeating the validation work.

Changes:

  • Add a per-LOD sculpt validation cache to LLVolume, resetting it when the volume is dirtied.
  • Introduce sculpt geometry validation based on total triangle surface area vs. bounding-box surface area, and replace invalid sculpts with an empty placeholder.
  • Make sculpt_calc_mesh_resolution() local to llvolume.cpp.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
indra/llmath/llvolume.h Adds sculpt validation cache state and resets it on setDirty().
indra/llmath/llvolume.cpp Initializes the cache, validates sculpt faces, and swaps in placeholder geometry for invalid sculpts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indra/llmath/llvolume.h Outdated
Comment thread indra/llmath/llvolume.h
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp
Comment thread indra/llmath/llvolume.cpp Outdated
Comment thread indra/llmath/llvolume.cpp Outdated
Comment thread indra/llmath/llvolume.cpp Outdated
@akleshchev akleshchev force-pushed the andreyk/viewer_3988 branch from f9a4de0 to 60bd303 Compare June 24, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set RenderAutoHideSurfaceAreaLimit to a lower value, and base it on GPU capabilities.

3 participants