I just tried to find out for some hours why some of my Instanced Static Meshes stopped working.
After trying out a lot of things I noticed there is this new bool “Mark Render State dirty” in the “Update Instance Transform” Node. There is no documentation on what this bool does, because it’s new in 4.8. I guess it’s for performance reasons. The problem with this is that all the old nodes from 4.7 which were placed without this bool behaved in 4.7 and older as if this bool would be true. Now all the nodes have this bool and it is false, which makes the nodes not work.
So the nodes from 4.7 and earlier should get updated with this bool being set to true, not false, the current setting breaks all the placed nodes.
Now regarding this bool, what exactly is it doing? I know that I get 4.7 behavior if I set it to true. But when should it be true? When should it be false?
With my basic understanding of instances I think that with disabled “Mark Render State dirty” it is doing something like updating the Instance Transform in the memory (RAM), but not send the new information to the GPU because all the Instance transforms have to be saved in the GPU memory to get the performance improvements of instances. So the transform get’s updated internally, but the GPU does not process the change. This improves performance a lot if multiple instances get updated in one frame, because it does not make sense to let the GPU update the instances multiple times per frame. I’m only guessing since I can’t find any info on this, so it might be completely wrong what I write.
So if I update multiple Instances a frame (what I do) then this is a really nice feature, but if my assumption on how this works is true then I don’t understand why the engine is not just automatically “batching” the commands at the end of a frame?
So I update a lot of instances in one frame, and if I have “Mark Render State dirty” disabled to get better performance I have to manually make the GPU get the updates. I have no idea how to do it, I guess there has to be a function to “Mark the Render state dirty” without updating an instance transform. The updating of the transform is happening in a loop, so I can’t define the last instance to have “Mark Render State dirty” enabled and instead I need a way to manually make the “Render state dirty”. But how?
I actually think this tiny little bool is super useful, especially for me because I need to update a lot of Instances in a Hierarchical Instanced Static Mesh Component in one frame and this is a really great performance saver for me (if it works the way I suppose it works)!
But now the other problem is: It does not seem to have any impact on Hierarchical Instances Static Mesh Components (HISMC), only on regular Instanced Static Mesh Components (ISMC). If I update the transform of a ISMC with this bool disabled, I see nothing. So the transform does not update. If the bool is set to true, the transform is updating and I see the new size. I guess this is the way it is supposed to work.
In a HISMC I even see the new transform with the bool disabled, same as if the bool would be enabled. So it does not affect the way HISMCs are updated on the GPU, although HISMCs are the most important ones for me…