Maniphest T76102

Mirror modifier with mirror object updates slowly
Confirmed, NormalKNOWN ISSUE

Assigned To
None
Authored By
Matt (Kickflipkid687)
Apr 25 2020, 6:44 PM
Tags
  • BF Blender
  • Modifiers
  • Modeling
Subscribers
Ankit Meel (ankitm)
Brecht Van Lommel (brecht)
Henrik Dick (weasel)
Matt (Kickflipkid687)
Richard Antalik (ISS)
Sergey Sharybin (sergey)
Serhiy Striletksy (Striletsky)
Tokens
"Heartbreak" token, awarded by Striletsky.

Description

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 980 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 445.75

Blender Version
Broken: version: 2.83 (sub 15), branch: master, commit date: 2020-04-24 15:23, hash: rBa8441fc90086
Worked: Never (2.79+)

Short description of error
Adding a Mirror Modifier and using an empty or another object to mirror across, causes slow viewport performance.

Exact steps for others to reproduce the error

  1. Open file
  2. Move Suzanne - Notice performance
  3. Remove Mirror Object from mirror modifier
  4. Move Suzanne - Performance much better

You can apply subdiv modifier, it shouldn't have an effect.

Event Timeline

Matt (Kickflipkid687) created this task.Apr 25 2020, 6:44 PM
Ankit Meel (ankitm) closed this task as Archived.Apr 26 2020, 9:06 AM
Ankit Meel (ankitm) claimed this task.
Ankit Meel (ankitm) added a project: Modifiers.
Ankit Meel (ankitm) added a subscriber: Ankit Meel (ankitm).

Seems to be a limitation. You see similar performance issue if you apply two subsurf with 6+2 or 6+3.
Thanks for the report. While we do continue to work on improving performance in general, potential performance improvements are not handled as bug reports.

Henrik Dick (weasel) added a subscriber: Henrik Dick (weasel).Apr 27 2020, 11:21 AM

Also I can NOT confirm that changing the mirror target changes the performance at all. You might have a special object where you have different amounts of geometry based on the mirror target position because of merging or bisecting.

Matt (Kickflipkid687) added a comment.Apr 27 2020, 4:41 PM

Did you try to open the uploaded blender file and select the object and start to move it with G key? I am seeing bad lag in that case.
If I turn OFF SubD display in the viewport, in that case, it's fine. Or if i clear the mirror target and use only the object itself as mirror, it's fine.

Something with SubSurf Display/Dense geo and mirror mod with a target kills perf for me.

I've had this same perf. "issue" on many objects in diff scenes, with this setup. Not specific to this object/scene or even blender version. 2.82 i saw the same.
Unless it's something else going on, but not that I can tell. Seems very specific to this setup, which is why I thought a bug.

Ankit mentioned dual subSur Mods doing that, but that would make more sense to me, from raw geo standpoint. But just the fact of using a mirror target and getting much lower viewport perf, seems odd to me.

Henrik Dick (weasel) added a comment.Apr 27 2020, 5:10 PM

Exactly that is not the case. The mirror target changes nothing. I tried your file and my own files. The mirror target changes nothing about the performance. Your explanation of the effect is correct, but nothing odd. What happens is that when you change the position of either the object or the target object (or both no matter if they keep the offset or not), when mirror target is set it will update the geometry (cause it needs to). That update is always slow no matter if you have a mirror target or not. You can check that by adding a Wave Modifier to your stack and testing playback. You should just set your origin correctly for performance.

Ankit Meel (ankitm) added a comment.Apr 27 2020, 5:13 PM

I had checked on default cube with the steps provided, not the file given. I can get the numbers if you could tell me how to enable fps in the viewport.

Henrik Dick (weasel) added a comment.Apr 27 2020, 5:16 PM

you can start playback and it will be visible at the top left corner (best to choose 60fps for playback). If you add a wave modifier to the model it will get updates on every frame (you can even disable it from viewport)

Ankit Meel (ankitm) reopened this task as Needs Triage.Apr 27 2020, 5:35 PM
Ankit Meel (ankitm) removed Ankit Meel (ankitm) as the assignee of this task.
Richard Antalik (ISS) renamed this task from Mirror Modifier via other object causes slow viewport performance with subSurf Modifier Enabled. to Mirror modifier with mirror object updates slowly.Apr 27 2020, 7:03 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.
Richard Antalik (ISS) updated the task description.
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

I have tried to extract single underlying issue there, I hope I got it right.

If there are different issues in play, make new report for each issue.

Richard Antalik (ISS) updated the task description.Apr 27 2020, 7:12 PM
Richard Antalik (ISS) updated the task description.Apr 27 2020, 9:03 PM
Henrik Dick (weasel) added subscribers: Sergey Sharybin (sergey), Brecht Van Lommel (brecht).Apr 27 2020, 9:23 PM

The problem is in the Dependency Graph. It updates the geometry when the transform of the object or its target is changed. The related code in MOD_mirror.c is:

static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphContext *ctx)
{
  MirrorModifierData *mmd = (MirrorModifierData *)md;
  if (mmd->mirror_ob != NULL) {
    DEG_add_object_relation(ctx->node, mmd->mirror_ob, DEG_OB_COMP_TRANSFORM, "Mirror Modifier");
    DEG_add_modifier_to_transform_relation(ctx->node, "Mirror Modifier");
  }
}

A solution would be to add a relation to the relative transform between the two objects instead, but I don't know if there exists a function for that yet (or if it is feasible or not). (@Brecht Van Lommel (brecht), @Sergey Sharybin (sergey))

Sergey Sharybin (sergey) changed the subtype of this task from "Report" to "Known Issue".Apr 28 2020, 9:34 AM

If I am understanding "relative transform" correctly, then there is no such a thing in Blender as an entity on its own. The code uses two objects and uses their transforms to calculate something interesting. Trying to optimize this on a tagging or update propagation level will just add a whole lot of complexity and will make code way more fragile than it should be.

In a more ideal world you can think of a more granular update functions which will not have any side-effects than the intended function, and then it becomes plausible to stop update propagation if value did not change. This comes with a performance hit for regular cases, so not sure if it's something we want to do.

As for the initial report -- this is an expected behavior of the current system. All the other issues are to be submitted as separate reports.

Matt (Kickflipkid687) added a comment.Apr 28 2020, 7:07 PM

Hm.. ok. Yeah, i just noticed this when i was working with highpoly mesh/weapon and tried to move stuff around to test animation clearance/etc, and noticed horrible lag. Almost un-useable.
So i guess i will have to use my script/hotkey i made to turn OFF all subD displays on selected objects so i can move stuff without 1FPS.

Henrik Dick (weasel) added a comment.Apr 28 2020, 7:22 PM

@Matt (Kickflipkid687) No, you can just

  1. use one subdivision level less
  2. Don't use mirror object origin if you don't need to. Set the object origin to the mirror origin with RMB > Set Origin > Origin to 3D Cursor
Matt (Kickflipkid687) added a comment.Apr 28 2020, 7:39 PM

Yeah, i could do the pivot thing. Although I was mainly using it because i had a local pivot where i was mirroring across that, but then also wanted to mirror over world space across the weapon in some cases/have both. But I will figure something out.

still learning the quirks in here, after using 3ds max for 15 years.

thank you!

Richard Antalik (ISS) added a project: Modeling.May 21 2020, 1:17 PM
Campbell Barton (campbellbarton) moved this task from Backlog to Known Issues on the Modeling board.Sep 21 2020, 1:34 PM
Serhiy Striletksy (Striletsky) awarded a token.Jun 10 2022, 1:20 AM
Serhiy Striletksy (Striletsky) added a subscriber: Serhiy Striletksy (Striletsky).Jun 10 2022, 1:34 AM

During sculpting mirror modifier is painfully slow and laggy. With i7 6700K and GTX 1660S I'm getting like 3-5 updates a second depending on a subdivision level. Hardly usable at all and extremely painful. And uneven jitter makes it even worse.
This is a core feature in modelling tools and seeing that this issue doesn't receive any attention for years is a sad state of affairs.