# Matrix multiplication calculation error during Niagara System Update Stage

**URL:** <https://forums.unrealengine.com/t/matrix-multiplication-calculation-error-during-niagara-system-update-stage/490058>\
**Category:** FX\
**Tags:** bug, unreal-engine, question\
**Created:** [October 20, 2021, 3:44pm UTC](https://forums.unrealengine.com/t/matrix-multiplication-calculation-error-during-niagara-system-update-stage/490058 "2021-10-20T15:44:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonymous\_870a19c6ec63fe31b44d0b8d962d84d8](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_870a19c6ec63fe31b44d0b8d962d84d8](https://forums.unrealengine.com/u/Anonymous_870a19c6ec63fe31b44d0b8d962d84d8)\
**Post date:** [October 20, 2021, 3:44pm UTC](https://forums.unrealengine.com/t/matrix-multiplication-calculation-error-during-niagara-system-update-stage/490058/1 "2021-10-20T15:44:52Z")

</div>

Hi,  
When I was studying the PBD system in Content Examples(Niagara\_Advance), there are some custom code got my attention, I replicated the code in my own project, here is the bug(?) I found.  
The Custom Hlsl block returns an identity matrix, and is connected to the RLocal input of Custom Hlsl 002 block.  
my first thought is to remove this useless multiplication(since M \* I), like 001 block under. However, I got different result.

I tried to use Mul(Matrix \* Matrix) node with multiple input node, I got the same wrong result.  
Then I tried to use multiple Mul nodes with two inputs each chained together, I got the correct result this time.  
Liked the MatNodeNoLocalR in the picture ( The green arrow is pointed to the wrong output, it should be MatNoLocalR )

I suspect that there is some issue within the VM? I have no idea how System Update Stage works. Can I get some direction about the cpp files about this problem?

大家好，  
在研究Content Examples的Niagara\_Advance中PBD时候，发现使用custom hlsl或者 mul matrix\*matrix节点进行多矩阵连乘时，会出现计算结果错误的情况，我用自己的工程复现了System Update中 初始化NeighbourGrid模块中的这部分代码，如图  
350685-  
由于这个RLocal是一个单位矩阵，按理001和002的计算结果应该一致，但读取的Attribute中，结果并不相同，

我尝试使用了 自带的Mul节点，进行多个input输入，结果也是错的。

但是，我用多个Mul节点连接，计算结果就正确了。

由于不太明白System Update的更新机制(似乎是用虚拟机进行计算?)，不知道这是不是一个VM的Bug。。想了解下如何解决这个问题，或者有没有大佬可以科普下 Niagara System Update的C++代码在哪个位置，想深入了解下Niagara的更新机制。。 谢谢~
