Hello fellow polycounters.
Thought I'd share a potential solution to how Naughty Dog is having more than the
one set data in their Vertex Painting Setup for the Last of Us part 1.
There is a lot of potential room to play here. And some polish in the area of the Alpha channel (which I explain below). But hope you enjoy, will improve or use this vertex painting tool/ theory. More testing and experimenting is to be had.
This was built it UE4.27 and should work in other engines too.
I am unsure exactly how to post videos on polycount. But there is a video demonstrating it on my artstation. (sorry don't know how to link.
https://www.artstation.com/artwork/9E1Wra)Thanks for looking and have a great day!
Replies
Though i haven't tested down the GB line because of time. Could completely break.
A bit of an offtopic, but first thought I had after reading a title is split UVs of vertex color/alpha to have rough transition between values. Not sure it even makes sense with other software or file formats, but 3dsmax allows for some funky stuff when it comes to vertex color/alpha.
Another setup, this allows 16 textures to be blended by using only one of the three color channels (green) within a single set of vertex color data. If you want texture one, you paint 0-15 green. To get texture 2 you paint 16-31 green. Etc.
https://polycount.com/discussion/174377/witcher-3-blood-and-wine-architectural-material/p1
We have more resources about this on the wiki
http://wiki.polycount.com/wiki/MultiTexture
This is also what the slides suggest they did so I think it's a safe bet.
The simplest option if you only have 4 channels is to do as Eric suggests and handle multiple textures in a single channel.you lose precision but it's unlikely to be an issue in practice.
Storing vertex color in UV sets is a perfectly valid approach - it's more data but if you need the precision it's your best option.
To store the color in UVsets you can use channels in max, I'm not sure if there's a way to do it through the UI in maya
the path of least resistance is to pack it all into the first vertex color set
Black
Red
Pink
Green
Yellow
Blue
Teal
You can also take half the range on colors to get 2 out of 1 color
But do you really need or want so many layers? Its not for free of course.
Id also just put some things with worldspace noises simply
however..
if you use vertex color in most engines (eg. unreal) it's a fixed cost - you don't save anything by using only 2 channels because the data is stored as a vec4.
At worst you have 8-bit precision - giving you a potential total of 1024 unique 1 bit masks.
I've shipped a game using 16 in a single channel for per triangle material masking so I know that works, there's no good reason you couldn't go up to 255 per channel though.
Splitting each channel into 4 is usually good enough to support reasonable blending between materials if you're modulating it with noise/textures - this gives you a total of 16 masks to play with and is approximately the same level of precision you'd get from a packed set of texture based masks.
vertex color isn't inherently more memory-efficient than using textures - the per point cost is at best equal to a single pixel (most likely higher). There's usually less vertices than pixels obvs but it's not a given.
Transfer attributes in maya supports moving vertex color around - there's lots of nice texture to vert data tools in there as well so you could use photoshop/designer to encode your data and push it back into vertex color if you're not comfortable scripting it
1 bit masks are not super useful tho, with the 8 colors you do have pretty good quality still
Its not fully true with the fixed cost, (havent tried nanite compression tho)
I checked the sizes and if your number is 0, it naturally costs less memory than if you have some float in it, at the least on the disc. The more rounded the down the float, the less memory, with 0 taking the least, so you do save some memory if you don't use one channel, but I doubt that it saves any measurable material performance
If you have a higher poly mesh using vertex colors that does make a difference in size
The values assigned are irrelevant because the datatype used to store the information is what determines size in memory
an 8bit number costs 8bits whether the value is 00000000 or 11111111