My computer configuration: i7 6700 GTX 1060 6G 16g RAM.
Scene Description: the wall is generated by extrudepolygon, the floor is created by createpolygon, other devices are 3D Max exported gltf, and cabinets and doors are animated.
The necessary functions of the scene: highlight, change color and translucency of the device.
Here are the optimization methods I used:
- Device clone(), material. Freeze(), donotsyncboundinginfo = true, freezeworldmatrix().
Finally, FPS: 10. Although unfreeze() can meet the necessary functions, FPS is too low to run smoothly.
- Device createinstance(), material. Freeze(), donotsyncboundinginfo = true, freezeworldmatrix().
Finally, FPS: 35-40, which can basically run smoothly, but can not meet the necessary functions (highlight, change color, translucence). The 4.1 beta has been able to change color with instancedbuffers.
- Combined all the walls on the basis of 2
Finally, FPS: 53-60, running smoothly. However, the required functions cannot be met, and the loading time is increased by 50%.
Where Babylon is not friendly: all operations are based on mesh, which is very tedious for complex objects such as cabinet (with power on cabinet door animation, multi grid combination). Here are some tedious Codes:
Although it’s not so troublesome to create instance now, it’s still tedious to operate complex objects.
What I want to solve now:
How to set highlight and translucency for the instance? With hasvertexealpha = true, instancedbuffers can be translucent but only valid for blue, and opaque is invalid.
How to speed up the merging of meshes?
Can my scenario be optimized with SPS? Multi mesh composition, how to use SPS for animated objects?
Are there any other optimization methods for my scenarios and the functions I need?
Finally, thank you very much to the team of Babylon for realizing such a beautiful computer room on HTML5