I’m working with UInstancedStaticMeshComponent. I’ve been getting some very bizarre behaviour. My instances ‘snap’ to certain angles and exhibit shearing. Therefore, I’ve double checked the instance transforms — they have uniform scaling and valid rotations. I then dug into the unreal code and verified the matrix transform in the instance data is also correct.
I’ve concluded that the problem is in FInstanceStream. It stores the transform matrix using low-precision 16-bit floats. While this is probably okay for many cases, the scales in my situation run into the precision issue.
Attached is a screenshot of some simple cubes that illustrate the problem clearly.
To get around the problem, I am duplicating the instanced meshes and scaling them down. However, duplicating UStaticMeshes is a little tricky and I haven’t got the code working yet.
What do people suggest?
Are there plans to support 32-bit floats for instances as well?
Should I rewrite UInstancedStaticMeshComponent to support 32-bit?