I created a new CSGMesh Node in my 3D godot scene with the following Script attached:
extends CSGMesh
func _ready():
var material = SpatialMaterial.new()
material.vertex_color_use_as_albedo = true
#material.albedo_color = Color.green
self.material_override = material
self.material = material
var surfacetool = SurfaceTool.new()
surfacetool.begin(Mesh.PRIMITIVE_TRIANGLES)
for i in [[-1, 1], [-1, -1], [1, -1]]:
surfacetool.add_normal(Vector3(0, 1, 0))
surfacetool.add_color(Color.red)
surfacetool.add_uv(Vector2(0, 0))
surfacetool.add_vertex(Vector3(i[0], 0, i[1]))
self.mesh = surfacetool.commit()

code with syntax highlighting
In line 6 I order the material to use Vertex Colors . material.vertex_color_use_as_albedo = true
And use that spatial Material on the mesh in line 9 and 10
In line 18 I set all the Vertex Colors to be red: surfacetool.add_color(Color.red)
what I get is this triangle: why is it white? All the vertices should have a red color... How do I tell the SpatialMaterial shader to use the vertexcolors .. the flag material.vertex_color_use_as_albedo is already set to true ?

Why is it white and not red as the Vertexcolor set in the code?