[Regression] Morph targets reset/flicker with "Set Material"

This is a regression of a [previously reported][1] issue. It appears to have been broken again in 4.17. In previous engine versions (i.e. 4.16 to ~4.7) this was fixed.

Issue: Morph targets are reset to zero for one frame whenever Set Material is called on a skeletal mesh. This causes flickering of the mesh for a frame. Depending on the usecase and mesh, the impact ranges from barely perceptible to very obvious.

Repro image

(borrowed from an Epic staff’s post in the previous report)

For easier testing please increase the timer duration from 2s to something like 0.5s to perceive the issue.

Use “Frame Skip” for Easy Repro

The most precise way to repro this issue is to put a breakpoint in any one of the “Set Material” nodes (in the image above) and then use PIE’s Frame Skip feature to advance a single frame. This way you can catch the precise frame when the morph targets have been reset (this is what causes flickering).

~

Would be great if someone from Epic could take a look at this. My plugin users are directly affected by this bug as well (it’s a blocker for those using morphs), so any attention on this issue is deeply appreciated.

Hi,

I’ve tried to reproduce the issue by using the repro steps from the linked answerhub and the one above. However, I am not seeing the same issue. The older answerhub report mentions only the colors changing, which is what I am seeing on my end. Was that your end goal? Is there a different way that you may have your project set up? Would it be possible to get a gif of the issue that you are seeing? If you can post some screenshots or a repro project of your set up I can take another look at the issue.

-Thank you

Hi Ridley, I’ve prepared both a demo project and a full video demonstration for you:

Repro Video: Morph Flicker Repro (for UE4 staff) - YouTube

Project Download (This is a fresh 4.18 Project)


Thanks for looking into this :slight_smile:

This issue regressed in 4.17. This works perfectly fine in previous versions of UE4 (up to 4.7 around which time it was originally reported)

I can confirm that this is still an issue in 4.18. Though I cannot share a sufficiently contained sample demonstrating the bug, the repro steps are roughly as follows:

-Usecase: custom C++ editor tool with skeletal mesh visualization

  1. Instantiate skeletal mesh on tool initialization.
  2. Set morph targets on skeletal mesh component.
  3. Create a couple UMaterialInstanceDynamic; set some parameters on them.
  4. Apply these dynamic materials to the skeletal mesh component.
  5. Tick the skeletal mesh component to apply the morph target changes.

I have tried swapping the order of events, to no avail. Step 4 consistently clobbers/zeroes out any morph target changes to the skeletal mesh component. Using standard UMaterialInterface instead works fine.

Hi Ridley, just checking whether you got an opportunity to look at the repro project and video.

Any questions, please let me know!

Open the material(s), click on the main material node and you see that on the side tab ( usually bottom left of the window ) you have some properties…scroll until you find “Use with Morph Target”, and its done

Open the material(s), click on the main material node and you see that on the side tab ( usually bottom left of the window ) you have some properties…scroll until you find “Use with Morph Target”, and its done

1 Like

Obviously Morph targets would not work at all if that is not done :slight_smile:

This is not an answer for the question.

This bug report is for a very specific issue concerning use of “Set Material” and morphs in 4.17 and above. Check out the original question again to follow exactly what is being described here.

Hi Ridley, That answer certainly does not answer the question, it is simply a pointer on how to setup morph targets.

Please kindly do investigate this issue!

Hi,

I was looking into your project, but before I continued I wanted to check in and see if the answer below resolved the issue. If not let me know and I will take another look at it.

-Thank you

Hi,

After taking a look at your test project, I’ve gone ahead and logged it as a bug. If you would to keep an eye on the issue, you can do so here in the public bug tracker.

-Thank you

I have the same problem :frowning:

Has anyone found a solution? I have 600+ morph target assets and everytime i change the material it flicks.

Hey Ridley, I see that the UE-54099 has been closed as “Won’t Fix”. Could you comment further on this please?

Multiple users/usecases have been affected as evinced by 10 votes on the JIRA. Incidentally, this popular video by Ryan Brucks from Epic also uses the same intra-frame material switching technique (for capturing positions) which is directly affected by this bug (for meshes with morphs)

Given that this worked perfectly in previous engine versions and is actually a regression of a previously reported issue it would be useful to know more about the reason why it was closed.

PS: In the future it would also be great if devs could add a small comment explaining why a bug is being closed before doing so in JIRA! :slight_smile:

Greetings Epic staff.

As nearly 1 year has passed since this bug was reported and as the Target Fix for this issue has been gradually bumped from one release to another, I’d like to ask whether the latest Target Fix of 4.22 is also provisional or if the bug is indeed scheduled to be fixed for 4.22 :slight_smile:

This issue can be a blocker to upgrading engine version for some people (including myself) and I earnestly hope it will be investigated for 4.22. Many votes have been accrued on UE-54099 so far :slight_smile:

Epic staff,

I see that UE-54099 has been pushed to the next release once again.

It would be great if someone from the rendering team can add some color on the complexity of the bug and the likelihood of it being fixed in the foreseeable future. I certainly understand that bugs like these are tricky to patch and that other priorities may need your attention.

However it would be useful to have more information on the issue given the long tenure of the bug (it is believed to be a regression that was fixed back in 4.7, working up to 4.17 and broken again in 4.18)

Any further information will help me and my plugin users as well, to plan our engine migrations which have been blocked by this bug for quite a while now.

Appreciate any further information on this!

Thank you :slight_smile:

Hi, I’d like a fix to this as well. Could there be some work-around by manually setting the morph target to the right place for one frame?

Thanks. That was the case for me