Materials with vertex color -> Use As Albedo and speed of the 3d engine (Godot 3.0)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By kakoeimon
:warning: Old Version Published before Godot 3 was released.

In godot 2 documentation it was stated in 3D performance and limitations that :

Configuring the properties of every material for every object that needs to be renderer is also slow. To solve this, objects are sorted by material to reduce the costs, but at the same time sorting has a cost.

I read the “godot 3 render design explained” and it seems to me that this is not true anymore but shorting now is something else :

  1. Opaque sort
    Godot uses a 64-bits integer to identify drawing order. This integer mixes render priority, flags, material index, geometry index, and many other variables. When sorted, it minimizes state changes in the render pass.

I also made a test where I had two objects with the same material and in Debug→Monitor→Raster→Mat Changes I got 2.

Does this means that we can use “unlimited” number of materials without performance lose or that limiting our materials does not give any advantage to performance?

If by limitng the Materials we can get some “optimization”, does this means that if in the Material we have checked the Vertex Color→ Use as Albedo and objects with different vertex colors we loose this advantage?