1- we can paint vertex color on model and blend them using vertex color. with/without mask texture in blend edges.
this way when we want to export model to game engine, it should export vertex color with model. and used textures.
2- we can make an mask texture and blend textures using that mask. where is black will be texture1 and where is white will be texture2.
we can paint every way we want on mask texture.
for tile-able UVs we can use second channel and non-tileable uv to paint on any parts of model. this way when you want to export model to game engines, it does not need vertex color, but maybe some times one more UV channel.
so..
- which way has more performance in game engines?
- is there any other way?
- which way is easier to use in your pipeline?
- may you suggest any related things or points to increase performance?
Replies
The first technique is also alot easier to apply on a large scale, and easy to work with with current tools.
does anyone know if there is a shader for max to show 4 texture blend by vertex colors with mask?
Well, you don't have to have one black and white texture for every mask, I suppose you could use a RGBA texture and have 4 b/w masks on the same texture.
@JostVice: I don't know how viable that would be in a real game but I quickly set up a shader at work using ShaderFX for 3dsmax that mixed 6 textures (2 diffuse, 2 normal, 2 spec) according to R and G vertex channels, and I could add 6 more to use with the B and Alpha channels. I don't know if that's too many instructions or whatever cause it was just a quick prototype but as far as I know it can be done.
Starcraft 2 allows 7... so I dunno
I don't know about the performance side of it, but theoretically you should be able to blend 16 different textures by using vertex colors to mask each other. Basically, instead of R = Texture 1, B = Texture 2, etc think of the channels in terms of combinations.
RGBA
0000 = Texture 1
0001 = Texture 2
0010 = Texture 3
0011 = Texture 4
...
1110 = Texture 15
1111 = Texture 16
Here's a mockup I did in UDK; didn't bother with texture masking since this is simply conceptual. Also, I guess UDK caps your texture samples for a material at 12 (is there a way around this?) so I did 8 unique maps and inverted them for the other 8 to make 16 textures.
I wouldn't know how to set this up from program to program, but I think the concept is sound. Also, please excuse how terrible it looks, but the material is working.
Then end result there would be 100,000,000 possible unique textures. I just set up a small portion of this system to test the concept which appears to be working. The method right now eliminate gradients between textures so it's a harsh, ugly transition, but I think that gradients would cause the transition to go through a bunch of the textures rather than smoothly blending from A to B. However, I would think that the blend could be modified elsewhere in the material. Of course none of this is really practical, but it's fun to think about. Note: You should never put a hundred million textures on any mesh.
Edit: A slightly less ridiculous way of look at it would be to use 0.0, 0.5, and 1.0 as your vertex color values. This would give 3 possible textures per vertex color as opposed to the original two. That would result in 81 unique textures.