Texture blending
Grit supports texture blending within a material by using UVW channels to control the sharpness and the weighting of the textures. Diffuse, specular and normal maps are blended together.Setup
- The second UVW channel controls the sharpness of the blend, by using the red channel: 0 red means total smooth blend and 255 total sharp blend.
- The third UVW channel is used for the different texture variation, follows this scheme:
- Black: First texture
- Red: Second texture
- Green: Third texture
- Blue: Fourth texture
Although not yet tested it is possible to blend more than 4 textures but it could be expensive.
To paint the UV Channels, in 3D Studio max, use the vertex paint modifier, selecting channels 2 and 3 respectively. You will need to apply a vertex paint modifier for each channel (one for the sharpness, and another for the textures channel)
Material example
There are different material attributes that are useful for texture blending such as _specularFromDiffuse_ to reduce textures, and _textureScale_ to scale the UVs for each texture (In case one texture should be bigger than others) material "terrainLAY1" {
blend = {
{diffuseMap="textures/grass.dds", normalMap="textures/grass_N.dds", specularFromDiffuse={-0.5,0.2} },
{diffuseMap="textures/dirt.dds", normapMap="textures/dirt_N.dds", specularFromDiffuse={-1.0,0.2}, textureScale={2,2} },
{diffuseMap="textures/rock.dds", normapMap="textures/rock_N.png", specularFromDiffuse={0.0,0.5} },
{diffuseMap="textures/beachsand.dds", normapMap="textures/beachsand_N.dds", specularFromDiffuse={0.5,0.8} },
}
}
Category:Guides?
