- Home /
solved
How to mask textures by vertex color?
I want to know if one can apply a decal texture to a vertex, just like a mesh can have vertex color on every vertex. This could be useful for simulating damage using another texture that will be visible on specific vertices, usually the contactPoints[] from the collision.
.
My approach would be to use vertex colors as a mask to determine which vertices will get the secondary texture (white color = MainTex, black color = SecTex) and then map the textures on the mesh, giving their visibility based on the color of each vertex.
.
A cool effectwould be that the textures would nicely blend due to the resulting grayscale blending of the vertex colors.
Can this work? And how can I write this kind of vertex-shader.
Any help appreciated!
Follow this Question
Related Questions
Real time vertex paint (or similar solution) possible? 2 Answers
Vertex Color Shader 0 Answers
Surface Shader, run vertex multiple times 0 Answers
Vertex Color Shader Non Linear Blending 0 Answers
Decal Alpha Blend 0 Answers