MeshModel needs a way to update if the bounding box updates

Problem

When making dynamic models you should specify the bounding box properly or you can get various artifacts like incorrect culling (in particular planes disappearing at odd camera angles) and shadow issues (weird rectangles cutting off shadows)

One issue is that the MeshModel node (Also used within DynamicMesh node) sets the bounding boxes of the model within a cache region, which is triggered by the mesh updating.

This will not trigger if you update the bounding box of the mesh.


Request

The model should update its bounding boxes when any child mesh bounding boxes are updated.
Iā€™m not sure of the best way to detect such changesā€¦


Workaround

Simple workaround is to add a force pin on the MeshModel cache region, and then the programmer making the dynamic model monitors upstream for changes that would affect the bounding box.

VL.Stride.ForceUpdateMeshModel.vl (25.1 KB)

image

1 Like

hey toby, thanks for bringing this up.

we made a few changes here:

  • DynamicMesh nodes now return a new mesh, when their BoundingBox input is changed. this should already fix your actual issue
  • DynamicMesh nodes got optional ā€œForce Updateā€ input (since they donā€™t check for a changed on their incoming data)
  • in addition we added optional ā€œForce Updateā€ inputs on all nodes that take meshes as input (MeshDescription, MeshModel, MeshesModel, MeshEntity, MeshesEntity) because there can still be cases where the incoming (mutable) mesh changes and those nodes cannot detect those changes automatically
  • the MeshSplit nodes now also react on a changed mesh and in turn have their ā€œForce Updateā€ inputs also false by default (was: true)
2 Likes