There is any solution to get GI properly working with vertex colors as diffuse shader?
Enlighten GI is not taken into account the vertex colors when used as diffuse, the result is that all bonced light is pure white. Any solution about that? Using textures is the only way to get the color information for GI?
Yes, the feature will be available in beta 20. A new ‘meta’ pass will be used to generate albedo and emissive to be used as input to Enlighten. You can make your own shader pass or use the standard shader one.
Finally vertex colors are working with the new “meta” pass. Thanks allot for your support. The problem now is that I cant get the same results with Surface Shaders as using “Standard” shader. There is some AO missing, take a look at the screenshots (meshes are marked as static):
The meta pass shouldn’t affect AO; I think it is because your shader outputs a different albedo than the Standard shader. Try calculating your albedo like this UnityLightmappingAlbedo (IN.color.rgb, _Spec.rgb, oneMinusRoughness /you have to come up with some roughness value that makes sense for your material/);
You can see the generated albedo in the GI - albedo scene view mode.
As you say, its somthing that makes Standard shader, not GI.
I cant get the same result with the surface shader, but tested with the legacy shaders and its doing the same (no AO). So I will wait till the documentation, because for the moment nobody knows to solve it.
Tested what you say and included lightmaping properties [LM_Specular] and still not getting the AO.
But thanks KEngelstoft for the help.
@Project-Mysh why don’t you grab the standard shader code and modify it so that it uses vertex colors? That’s what I did and it works pretty well. This way you’ll get the exact same results as the standard shader
I can post my shader if you want - it’s for beta 20.
I’d like to see that if you don’t mind. I tried to modify the standard shader to turn it into a dissolve shader but it never quite matches the look of the standard.
Unzip this file in your Assets/Shaders directory (o if you put this somewhere else, update the hardcoded #include paths in the shaders) and create a new material that uses “Custom/Standard - VertexColor”
Vertex colors are multiplied with the Albedo and the texture, so you can also use this same shader for non-vertex colored meshes because by default Unity sets your vertex colors to white. In this case, you just adjust the Albedo property as usual. And of course you can also use textures if you want.
This is for beta 20. If you want to use this in a later beta, you’ll have to diff this code against upstream and merge the changes. It’s not hard - in fact, I’ve just done it yesterday as I was upgrading from beta 16.
@Silly_Rollo_1 : I suspect this code won’t help you too much, because it doesn’t touch the way the color is calculated at all. My changes simply change from where the diffuse color comes from, but after that everything else stays exactly the same, which is why I get the exact same look as the stock Standard shader.
Thanks for the shader, but I already did it. The problem is performance. This is actually a solution, but not if you want custom shaders with less Draw calls or functions, and the most important: custom shaders with the same lighting model than Standard shader.
Vertex Colors shader was only the start, I have my own surface shaders with vertex modifiers and more, simply I’m trying to port them to unity 5 standard PB lighting model.