Let's Fake It! - Vertex Colors and Nanite
What are vertex colors?
Vertex colors are a very old way to handle different things. It allowed us to add colors into meshes in the early days of 3d graphics. Mobile games utilized them a lot and there are even different visual styles that are heavily relying on vertex colors like the famous “low-poly” style. In the basic form, every vertex can contain RGB and Alpha values and these values are then interpolated together. That’s why vertex colors are used to add gradients and very low frequent details that would not be dependent on limitations that would be there with approaches like texture mapping and such.
Why use vertex colors?
Advantages
Like mentioned before, 3d models consist of vertex data so it might be handy to store some color information with vertex colors. That vertex color information can be used to drive and mask different effects like grass wind, damage, dirt, material IDs etc.. You can even bake down light information like ambient occlusion, shadows, GI… Vertex colors can also reduce the amount of textures we need to use. That will help to optimize texture lookups, memory footprint and overall complexity because all of the data is already stored into a specific mesh.
Disadvantages
Obvious problem or limitation with vertex colors is that the accuracy is bound to the amount of vertices that specific mesh contains. That means you can’t store complex, accurate paint data into low poly meshes. Very high-poly meshes like ZBrush sculpts can have accurate vertex colors but the memory footprint is also very notable. That’s why we usually need to create a mid or low poly version of that by using various retopology workflows or simply decimating that mesh down into a simpler form. Basic real-time engines usually also need to use the LODs (Level of Detail) versions for optimization reasons. That will drop the polycount event further down based on distance or screen size. This will once again drop vertex color accuracy that can appear as a very noticeable popping.
领英推荐
What Nanite allows us to use?
Advantages
More polygons means more accurate meshes. That also means meshes will contain more vertices so we can paint more accurate vertex colors. Nanite allows us to use that inside a real-time engine. This will help to solve most of the issues that we would have otherwise with vertex colors and game ready meshes. We can now use very dense meshes and paint details like edge damage, dirt deposit that can drive various effects in materials. This way it’s possible to avoid using specific, per object texture masks. It’s also possible to automate vertex color generation and store information into r, g, b and alpha channels.
Disadvantages
Nanite is still needing to handle polygons and sort them into different clusters that it will then handle based on camera distance. That’s why we will still be able to see some vertex color popping but the more hi-poly your Nanite mesh is, the less you will be able to see because the distance between vertices is much lower.
That's all for now. Stay tuned for more!
You can also find me here!
CEO | Creative Director
1 年I've been playing with this lately, I'd love to hear about your workflow for baking your vertex color masks to the mesh and your material setup for the blending in-engine. Unreal's modeling tools' vertex baker is fast and easy while iterating on meshes, but very basic (just ao and curvature). Being able to use something like substance painter to make more detailed masks with higher quality edge/cavity /etc bakes and grunge treatments would be far better if possible. Material wise I've stuck to simple blending, but I'd like to see if a material layers setup is worth the extra draw cost as well.