Skip to content

Implemented frustum culling support for skinned meshes#673

Merged
adriengivry merged 6 commits intoOverload-Technologies:mainfrom
Gopmyc:654
Apr 9, 2026
Merged

Implemented frustum culling support for skinned meshes#673
adriengivry merged 6 commits intoOverload-Technologies:mainfrom
Gopmyc:654

Conversation

@Gopmyc
Copy link
Copy Markdown
Contributor

@Gopmyc Gopmyc commented Apr 9, 2026

Description

This PR implements frustum culling support for skinned meshes.

Main changes:

  • Added a configurable Skinned Bounds Scale on CModelRenderer.
  • Serialized/deserialized the new setting (skinning_bounds_scale) with safe clamping (>= 1.0).
  • Enabled frustum culling for skinned drawables in SceneRenderer.
  • Applied the skinning bounds scale to computed bounds (mesh/model bounds) during frustum tests.

This keeps culling effective for animated meshes while allowing a safety margin to avoid early popping.

Related Issue(s)

Fixes #654

Review Guidance

Please review commit-by-commit:

  1. Added skinned bounds scale settings to model renderer
  2. Implemented frustum culling support for skinned meshes (#654)

Focus points:

  • Culling behavior of skinned meshes near frustum edges.
  • Correct handling of Mesh Bounds/Model Bounds vs Custom Bounds.
  • Backward compatibility of scene/component serialization.

Screenshots/GIFs

N/A (behavior/performance change, no UI layout change beyond one inspector scalar).

Checklist

  • My code follows the project's code style guidelines
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes don't generate new warnings or errors

Copy link
Copy Markdown
Member

@adriengivry adriengivry left a comment

Choose a reason for hiding this comment

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

I'm not sure how I feel adding the concept of skinning to the model renderer. Maybe that setting should live in the CSkinnedMeshRenderer?

This could be added to the SkinningDrawableDescriptor and retrieve by the SceneRenderer to scale the frustum bounds.

It's important to keep functionalities decoupled as much as possible.

Also, if we add this setting in a component, it might be worth it to expose it in Lua as well by adding it to the correct file here:
https://github.com/Overload-Technologies/Overload/tree/main/Resources/Engine/Lua

@Gopmyc
Copy link
Copy Markdown
Contributor Author

Gopmyc commented Apr 9, 2026

I'm not sure how I feel adding the concept of skinning to the model renderer. Maybe that setting should live in the CSkinnedMeshRenderer?

This could be added to the SkinningDrawableDescriptor and retrieve by the SceneRenderer to scale the frustum bounds.

It's important to keep functionalities decoupled as much as possible.

Also, if we add this setting in a component, it might be worth it to expose it in Lua as well by adding it to the correct file here: https://github.com/Overload-Technologies/Overload/tree/main/Resources/Engine/Lua

I agree with the decoupling concern
I updated the implementation accordingly:

  • Removed the skinning bounds scale setting from CModelRenderer.
  • Added the setting to CSkinnedMeshRenderer (GetSkinningBoundsScale / SetSkinningBoundsScale), with serialization + inspector support.
  • Added boundsScale to SkinningDrawableDescriptor.
  • SceneRenderer now reads the scale from SkinningDrawableDescriptor when applying skinned frustum bounds scaling.
  • Exposed the setting in Lua:
    • C++ binding: LuaComponentsBindings.cpp
    • Lua API stub: Resources/Engine/Lua/Components/SkinnedMeshRenderer.lua

This keeps skinning-specific behavior inside skinning-specific systems/components.

Commits:

Copy link
Copy Markdown
Member

@adriengivry adriengivry left a comment

Choose a reason for hiding this comment

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

Much better! Last change (promise :p) would be to rename m_skinningBoundsScale to m_meshBoundsScale, which makes the intent clearer. The methods will need to be adjusted too (GetMeshBoundsScale, etc...).

@Gopmyc
Copy link
Copy Markdown
Contributor Author

Gopmyc commented Apr 9, 2026

Much better! Last change (promise :p) would be to rename m_skinningBoundsScale to m_meshBoundsScale, which makes the intent clearer. The methods will need to be adjusted too (GetMeshBoundsScale, etc...).

Hahaha, ask for as many changes as you want

@Gopmyc
Copy link
Copy Markdown
Contributor Author

Gopmyc commented Apr 9, 2026

Much better! Last change (promise :p) would be to rename m_skinningBoundsScale to m_meshBoundsScale, which makes the intent clearer. The methods will need to be adjusted too (GetMeshBoundsScale, etc...).

Ah yes, indeed, I forgot to do it !

@Gopmyc
Copy link
Copy Markdown
Contributor Author

Gopmyc commented Apr 9, 2026

Much better! Last change (promise :p) would be to rename m_skinningBoundsScale to m_meshBoundsScale, which makes the intent clearer. The methods will need to be adjusted too (GetMeshBoundsScale, etc...).

Done, I renamed the setting to improve clarity:

  • m_skinningBoundsScale -> m_meshBoundsScale
  • Get/SetSkinningBoundsScale -> Get/SetMeshBoundsScale

I also aligned Lua bindings/docs with the new names and updated serialization to mesh_bounds_scale while keeping backward compatibility by still reading skinning_bounds_scale.

@Gopmyc
Copy link
Copy Markdown
Contributor Author

Gopmyc commented Apr 9, 2026

Done, I addressed all remaining points:

  • removed legacy skinning_bounds_scale deserialization
  • removed the redundant SetMeshBoundsScale(...) call in inspector
  • updated C++ and Lua docs to mention values are clamped to >= 1.0

@adriengivry adriengivry merged commit 9b58581 into Overload-Technologies:main Apr 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Implement frustum culling support for skinned meshes

2 participants