It's been a wile since I promised to do this tutorial so I finally decided to write it.
Sometime ago I came across a feature in the Source engine games that is called Blend Modulate Textures, they are a 2 channel texture that tells the LightmappedGeneric shader how to blend from $basetexture to $basetexture2.
Ok, so every texture has 4 channels Red Green Blue Alpha, blend modulate textures only uses the first 2 of those.
The Red channel controls the roughtness/smoothness of the blending, the more white the more soft the transition is. Try to avoid completelly black because that causes the shader to not have transition at all directly making a cut between the basetextures.
The Green channel is a multiplier texture of the blend, so the whiter it is the more $basetexture is going to be in that area, the darker more $basetexture2 is used.
So let's see how this can be used for improving a lot you level.
This is valve's most used blend modulate texture, it's pretty good and works nicely in most cases.
To blend dirt, grass, gravel, etc use the valve stock one. But if you are going to blend something with a bit more complexity, you may want to create a custom blend modulate texture.
This is one I made for one of the maps I'm working on:
Here is how the material looks in the game without any blendmodulatetexture.
Here it's how it looks with the valve stock one.
And finally here it's with the custom blend modulate texture made by me:
Take a closer look and you can see how the moss gets inside the cracks of the stone blocks, this really makes the transition to look a wole lot more natural.
This textures can be autored in any image editing software.
I suggest you to use for the Red channel some noise as base and then overlay like a height map of the texture if you have it so the deeper parts get a more easy/rought transition(remember to not go totally black).
In the Green channel again use as a base a heightmap from the basetexture if you have it, or an ambient occussion map that can be taken from the blue channel of your normalmap, blur it a little to smooth the transition and then add some noise to it.
It's a matter of testing it in the engine, I recomend making a small test map and when you create the material use the measurement orange texture as basetexture2 so you can see more clearly how your textures are mixing.
Here are some previous experiments I made on the matter:
Ya pasó un tiempo desde que prometí este tutorial, así que finalmente me decidí a escribirlo.
Hace ya tiempo me cruce con un tipo de texturas que tienen los juegos con motor gráfico Source que son llamadas Blend Modulate Textures, ellas usan 2 canales que le indican a el shader LightmappedGeneric como “modular” desde $basetexture a $basetexture2.
Bien, cada textura tiene 4 canales Rojo Verde Azul y Alfa, las texturas de modulación solo usan los primeros 2 de esos.
El canal Rojo controla la dureza/suavidad de la mescla, cuanto más blanco más suave la transición es. Trata de evitar el negro absoluto ya que causa que el shader no tenga nada de transición haciendo un corte vectorial entre las texturas base.
El canal Verde funciona como multiplicador, así que cuanto más blanco más $basetexture habrá en esa área, cuanto más oscuro más $basetexture2 será usada.
Así que veamos como esto puede ser usado para mejorar tus niveles.
Esta es la textura de modulación más usada por VALVe, es bastante buena y funciona bien en la mayoría de los casos.
Para mesclar tierra, pasto, grava, etc. Usa la textura provista por VALVe. Pero si vas a mesclar algo con un poco más de complejidad, quizás necesites crear una textura de modulación.
Esta es la que cree para uno de los mapas en los que estoy trabajando:
Aquí una vista del mapa sin ninguna textura de modulación:
Aquí como se ve con la textura de modulación provista por VALVe:
Y aquí con la textura de modulación que cree para el material:
Si miras con atención podrás ver como el musgo se mete en los espacios entre los bloques de piedra, esto hace que la transición se vea mucho más natural.
Estas texturas se pueden crear en cualquier aplicación para edición de imágenes.
Yo sugiero para la creación del canal Rojo usar una imagen de ruido como base y después oscurecer montando arriba una textura como un heightmap(mapa de profundidad) basado en la textura base así las partes mas profundas tienen una transición más abrupta (recuerda no ir a negro absoluto).
En el canal Verde nuevamente usa como base un heightmap si lo tienes o un Ambient Oclussion Mask, que puede ser tomado del canal Azul de tu Normal Map, Difumínalo un poco para hacer la transición más suave y después agrega algo de ruido.
Es una cuestión de probarlo dentro del juego, recomiendo hacer un pequeño mapa de prueba y cuando creas el material usa las texturas de alineación naranjas como $basetexture2 así puedes ver con claridad como tus texturas están siendo mescladas usando tu textura de modulación.
Aquí varios experimentos previos que desarrolle:
Well. I think that's it for now. I will try to post again soonish.
Bueno, creo que eso es todo por ahora. Tratare de escribir nuevamente más pronto.
No hay comentarios:
Publicar un comentario