Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Broken scripts with update 6 -> 7
#12
(11-01-2025, 02:55 AM)hariedo Wrote: Works as expected, noise free.  Does not generate meshes for the ropes until first visible, and meshes disappear when they are all out of camera view which is perfectly acceptable.

Glad to hear, that's the intended behavior. Sonrisa


(11-01-2025, 02:55 AM)hariedo Wrote: Something I am noticing which I think is new in Obi 7 vs Obi 6 behavior (and may go back to my last project to check)... if I pause the game in the editor, both Obi 7 Rope and Fluid meshes disappear on the next Unity OnGUI cycle.  If I single-step, they reappear and then disappear again.  Everything else renders normally, it's just the Obi generated meshes disappearing.  I don't recall that in Obi 6.  It can make it tough to really monitor things closely such as particle-to-obicollider interactions.

This is a bug/omission in Unity's Graphics.RenderMesh API. . Also: https://issuetracker.unity3d.com/issues/...-is-paused

In Obi 6, actors (ropes, cloth, fluid, etc) each generate their own mesh in the main thread, and feed it to a MeshRenderer, SkinnedMeshRenderer, or whichever Unity stock component would render it. Upon pausing the game, Unity's own Renderer components kept drawing the meshes even if they were no longer updated.

Obi 7 performs its own mesh batching, merging multiple mesh actors dynamically and multithreading mesh update/generation/rendering. This is considerably more performant, but forces us to render meshes using Unity's RenderMesh family of functions (RenderMeshIndirect, RenderPrimitivesIndexed, etc). However when you pause the editor, our code is no longer called and since Unity stops being asked to render these meshes they disappear as soon as the scene view is redrawn.

Ideally, Unity should cache RenderMesh draw calls internally so that when game/user code is no longer called, the editor keeps drawing whatever was asked to draw during the last unpaused frame. I guess this is what the older DrawMesh methods did (as they don't seem affected by this) and what RenderMesh does in 2023.2 and up as it's seemingly fixed there.

kind regards,
Reply


Messages In This Thread
Broken scripts with update 6 -> 7 - by hariedo - 21-12-2024, 10:35 AM
RE: Broken scripts with update 6 -> 7 - by josemendez - 11-01-2025, 01:47 PM