# Instanced mesh rendering and motion/velocity vectors for TAA/TSR

**URL:** <https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [March 18, 2024, 2:53pm UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534 "2024-03-18T14:53:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jmu757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmu757](https://forums.unrealengine.com/u/jmu757)\
**Post date:** [March 18, 2024, 2:53pm UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/1 "2024-03-18T14:53:06Z")

</div>

Hi folks.

I’m experimenting with instanced mesh rendering via UInstancedStaticMeshComponent and UHierarchicalInstancedStaticMeshComponent and running into some problems with instanced meshes smearing due to TAA and TSR antialiasing options.

In my project I have a large number of entities which I simulate, and then use their location/rotation data to batch update instanced static mesh components. This works fine except for severe visual artifacts when the instanced meshes are moving, if I have temporal AA options enabled.

If I visualize motion blur I can see that the instanced meshes are detected (they show up as yellow in the motion vector visualization) but their motion vectors are zero.

I’m not currently doing anything to supply instance velocity information to the instanced static mesh components, so maybe I need to do that?

Before I investigate further, I thought I should ask the community because this seems like it would be a very common and major issue with instanced meshes. Is this a known issue, and is there a standard solution?

Thanks in advance for any assistance.

---

<div class="post-metadata">

**Author:** ![jmu757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmu757](https://forums.unrealengine.com/u/jmu757)\
**Post date:** [March 19, 2024, 2:07am UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/2 "2024-03-19T02:07:19Z")

</div>

A simpler question to ask perhaps is, do UInstancedStaticMeshComponent (and UHierarchicalInstancedStaticMeshComponent) support moveable instances, or are they only used for instancing static/stationary objects?

---

<div class="post-metadata">

**Author:** ![Countsie](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/countsie/32/1194632_2.png) [@Countsie](https://forums.unrealengine.com/u/Countsie)\
**Post date:** [March 19, 2024, 2:51am UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/3 "2024-03-19T02:51:53Z")

</div>

Maybe a fix here?:  
[[UE 5.0] Ghosting Issues with Instanced Static Meshes and TSR/Temporal AA - Development / Rendering - Epic Developer Community Forums (unrealengine.com)](https://forums.unrealengine.com/t/ue-5-0-ghosting-issues-with-instanced-static-meshes-and-tsr-temporal-aa/835073)

---

<div class="post-metadata">

**Author:** ![jmu757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmu757](https://forums.unrealengine.com/u/jmu757)\
**Post date:** [March 20, 2024, 1:56pm UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/4 "2024-03-20T13:56:21Z")

</div>

Thanks, but unfortunately that didn’t help me.

---

<div class="post-metadata">

**Author:** ![jmu757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmu757](https://forums.unrealengine.com/u/jmu757)\
**Post date:** [March 20, 2024, 1:59pm UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/5 "2024-03-20T13:59:48Z")

</div>

I’ve investigated further and realized that UInstancedStaticMeshComponent has an interface that takes current and previous transforms when batch updating instances, so I switched to using this, but unfortunately it made no difference.

I’m going down a rabbit hole debugging UInstancedStaticMeshComponent and it seems like it must be an internal bug, as far as I can see the previous transforms are being passed down correctly, so it should be calculating correct motion vectors but I still don’t see any when visualizing motion blur.

If anyone has encountered this and found a solution I’d love to hear about it.

---

<div class="post-metadata">

**Author:** ![jmu757](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jmu757](https://forums.unrealengine.com/u/jmu757)\
**Post date:** [March 21, 2024, 12:25am UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/6 "2024-03-21T00:25:25Z")

</div>

OK, I solved it. I was still using the wrong interface, I think. Using the function UInstancedStaticMeshComponent::UpdateInstances that takes instance IDs as well as transforms and previous transforms works for me. I was previously using BatchUpdateInstancesTransforms which did not take instance IDs.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [April 20, 2024, 12:25am UTC](https://forums.unrealengine.com/t/instanced-mesh-rendering-and-motion-velocity-vectors-for-taa-tsr/1760534/7 "2024-04-20T00:25:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
