I was integrated MRT in my project recently, and I found that the frame rate drops down a lot mainly because of I used InstancedMesh for some objects, these objects have all kinds of different geometry data, but every of these instancedMesh just has 2 or 3 count.
Before I add MRT, the model contains these objects can be renderered with frame rate keeps around 60. It’s good! But now frame rate is only around 22. If I filtered out these objects in js code, then frame rate cames to the same level with before.
Is there any difference between renderering InstancedMesh to MRT and to normal WebglRenderTarget? I am not sure what slows the frame rate down, anyone has advice? Thanks!
Will renderering a lot of instancedMeshes which every of them has a small count to MRT makes a performance problem?
Huh. That is very interesting, I too am using instanced meshes heavily and some of them only include a small number of instances. I’ll have to see if I’m having the same issues.
For my engine, I actually hide the difference between instanced and non-instanced meshes behind an abstraction layer - I basically tell it “make me N of these, with these parameters”, and if the parameters include something that can’t be instanced (like animation data) it goes ahead and builds them as separate objects. I could probably add a threshold value to this algorithm telling it to use separate objects when N is small.