I have a general question of which path to take in regards to optimization. We’re building a 3D World not very unlike this one: www.simsmining.eu (which is also made in playcanvas). But this time it’s larger and will have close to 50 unique little mining machines of sorts, together with many more details.
I wonder if there are there any performance or optimization tips that you have right of the bat, and also I wonder specifically about the strategy to take when colorizing these vehicles. I’m thinking out loud, just these two paths to take and wonder if you’d recommend any of them - or a third one - based on performance wins/problems?
The all share pretty much three colors, so one way would be to divide their meshes up in three groups that have three materials assigned to them - yellow, grey and black. Would that create 3 draw calls per machine? Then that same yellow material could be assigned to all the yellow parts of all machines etc.
Or, they could all have 1 unique material per machine - which in turn has a diffuse texture where these colors are defined. 1 draw call per machine + the additional overhead of a texture?
I also saw this technique on a model I bought of Cgtrader.com, that all models share on big rainbox texture 2048px. then in order to change the color of some detail one would drag those UV faces to the right coordinatet. Wicked. Smart? Have no clue. Still need non-overlapping UV’s if to do any lightmapping work.
How does batching come into the picture? Does it do atlasing as well?
I realize we probably want the UV mapped somehow in order to at least make use of light baking, either inside playcanvas or before imported.