Greetings,
I used to post on Steemit quite fanatically. In fact, there was a time I think I was ranked within the top 20 for posters in terms of quantity. With that stated it has been a couple of years since I posted anything. I thought I'd come back with a post about something interesting I've been working on awhile related to game development.
If any of you have developed games you know that textures and materials can be the bane of your game for several reasons. Every material you need tends to result in additional draw/setpass calls. These can impact FPS. As non-developers this typically translates to the install sizes of games getting larger and larger. Do you want really lush environments and a lot of great textured people and creatures? If the answer is yes then understand that this translates to a lot of textures. In my experience the only thing that tends to use up more space than textures in development is using video. Audio can use up space as well but if you convert it to OGG Vorbis format or something like that it is generally not as big a deal as textures.
One trick many developers use is finding out the smallest texture they can get away with that still looks acceptable. Then they will often put multiple textures on a single texture which is known as a texture atlas and be able to use a single material rather than many materials. This can and does help. It is a very common go to technique.
Awhile ago when I believe I was still using Steemit regularly I came up with this idea I was calling a Color Swatch. I thought what if I were to average the colors of all the pixels on each triangle of a model and then map that triangle instead to a square color on an atlas of color boxes? If it actually worked well and looked good enough then in theory I'd only need a single texture, and a single material to make any number of models. I was also curious if that would make art that had it's textures made by different artists look well together with less of the uncanny valley problem.
The end result was YES it does work. It has use cases where it works great and provides a distinct look of its own. It also has some cases where it does not work so well. In this initial post I am going to simply show you some of my findings. The thing to keep in mind is in these screenshots every single model shares a single material (one setpass call) and a single texture. There are more cool details I'll go into if people seem to be interested after trying out this initial post.
HERE IS A SCREENSHOT FROM ONE OF MY EARLIEST EXPERIMENTS: These are models made by different artists with very different texturing. They have all been converted to my earliest attempts at Color Grid (Color Swatch).
The head there is a DAZ Studio Head (I believe Michael 7 or Michael 8) that I also decimated it a little bit.
More recently I've been working on a complete character system for a couple of games I am working on and that my son will likely use for some of his projects.
I have been converting DAZ Studio Genesis 8 Male and Female characters to the Color Grid format and have 4 LOD levels. I'll show you some of the LOD 0 levels here.
Now one of the things you will notice here is the faceted hard edge look. At the moment that is one of the requirements I've found for converting to this style. When the edges are smooth with triangles often sharing vertices the color mapping technique does not work as clean because where one triangle may be one color it's neighbor may not flow smoothly on the actual texture. Therefore I convert every triangle to have unique vertices. This results in this faceted look. I kind of like it. It is unique.
Now if you are a modeler or developer you may look at this and say "Why don't you just use vertice colors?" Well. Using this technique I actually can add some PBR techniques in and the end result responds to dynamic lighting better than vertice color based models do. If not for that then I probably would just use vertice colors.
In this current figure that is a default skin. The hair is a default white color.
I am using another technique I may explain later. For now I'll share some insane statistics (at least to me) which you developers will likely understand.
That female there...
- Base LOD 0 Model = 13.37MB
- Number of Different UV Mapped Skins = 304
- Space used up by Skins = 27.39 MB
- Total Space = 40.86 MB
Yes, that is 40.86 Megabytes for that model plus over 300 skin variations. One variation (the default) is showing in that screenshot. Normally that would take over 300 textures, and might be reduced some by atlasing.
Please let me know if this interests you. There are some tricks I use to get things that reduced that I didn't describe. Oh, I also have 552 blendshapes (morphs) for that body. The technique I use for those takes up 36.2MB. I can make her fat, skinny, old, young, into an alien, into a werewolf, etc.