Ah yes sorry my bad!
There’s a matrix per bone, so 4 reads per bone. I have fixed the doc.
Ah yes sorry my bad!
There’s a matrix per bone, so 4 reads per bone. I have fixed the doc.
What was the consensus here? Is there anything that’s being done in the UFO demo that’s fundamentally different than what babylon.js already does?
Hi @arcman7
There are some good findings guided by @Evgeni_Popov. But still many things need to be done to make sure a fair apple vs apple comparison. Just I don’t have enough time for it.
My findings:
Is three.js faster as shown in the UFO demo? I don’t know yet because of the following need to be answered, but I don’t have time. I would love to have full time job working on WebGL (#opentowork ).
My assumption:
Yeah I have no idea what’s going on with those .buf files. I would take a better look, but it’s all just minified code, I don’t see any sort of source-map. I’m with you in that this would take a while to sort through in getting a fair comparison going
Their mesh size is 260 triangles while the arachnid is 1794.
In addition, they optimized the calculation for their use case:
So they do 2*2=4
texture reads in total, while we do 4*4=16
because the arachnid has NUM_BONE_INFLUENCERS = 4.
Thanks @Evgeni_Popov. I think the samurai model I used has 740 triangles. So the performance sits in between of the UFO victims and arachnid.
- only rotation and position for bones (no scaling). So they only do two texture reads to get the quaternion and position values, while we do 4 reads to build a 4x4 matrix.
This is very interesting. I assume most scenario only rotation and position are required? So I can also try 2 reads instead of 4 reads in my custom shader?
- only two bones max
Do you refer to how many weighted bones can influenced a vertex?
Yes, if you are using a custom shader, you can do the texture reads and the math yourself. You can have a look at what they are doing with Spector.js.
Yes indeed.