Hello, everyone!
I needed to use vertex colors in materials for my current project, with flexibility of Unity 5 standard shader.
So here it is in action: Standard shader modified to support vertex colors of your models. Latest version (0.91) with additive pass (multiple lights supported) Version for Unity 5.4.0 (0.92) with vertex alpha in shadows support
Any ideas on adding per vertex fading like the fade rendering mode but controlled by the vertex alpha? I can’t figure out where in the shader the SurfaceOutput alpha is being set.
It’s not a surface shader, thats why it has no SurfaceOutput. I’ve modified shader to support transparency, but I need to figure out proper shadow rendering for transparent areas. And for some reason vertex alpha is not working with Cutout rendering mode.
So, I’m pretty new to custom shaders and very new to vertex colors. I’m wondering if someone can explain what I may be doing wrong here? I’m modelling in 3DS Max and exporting an FBX with a Vertex Color Map to use in Unity 5.
When I import the model into Unity and apply the vertex color shader, the colors are all smeared instead of clean. Any ideas as to why this is happening?
Thanks for this shader, it’s working great for me in the Unity player. The transparency doesn’t seem to be working on Android. Can you think of any reason why?
Only change the intensity, if Vertex Color factor is modified in the material.
Adding this test project, if the problem is not the script (I have installed Unity 5.0.1f1 Personal Edition, the graphics card is something old, Nvidia GeForce 9500GS)
That’s because unity primitives don’t have vertex colors by default (uninitialized arrays) so you first need to create it.
Note that if you use imported model with vertex colors this script will overwrite those colors.