Why vColor is undeclared identifier?

it’s my BABYLON.PBRCustomMaterial code:

this.Vertex_MainEnd(VertexToColorForFragment);

const VertexToColorForFragment = `
vColor =  vec4(vec3(mix(1.,vColor.x,_ao)),1.);
 `

Error :BJS - [14:41:37]: Error: VERTEX SHADER ERROR: 0:358: ‘vColor’ : undeclared identifier
At pbr.vertex.fx file:
// Vertex color
#include ,
vColor is existent

vColor will only be defined if your mesh uses vertex colors: mesh.useVertexColors = true.

2 Likes