Is there a way to ignore or replace vertexColors for Fragment Shader in Standard or Custom Material?

Hi! I ran into a problem, I use VertexColor buffer for calculations in my Vertex shaders. But these same colors are added to the Fragment shader as an overlay for my textures. Is there any way to disable this? Or possibly replace the value of the vertex color to white in the fragmented shader? So that the colors of the mesh vertices do not affect its appearance. Thx!

You can override the vertex color passed to the fragment with a custom material:

const mat = new CustomMaterial("mat", scene);
mat.Vertex_MainEnd("vColor=vec4(1.);");

Note: I have not tested this code.

1 Like

Thank you Evgeni, if vColor is not a uniform, then this should work! :slight_smile: I will test it tomorrow morning and report the result.

Works like a charm! Thank you, you saved my day again!:slight_smile:

2 Likes