material Material/TerrainTest { receive_shadows on technique { // base pass pass { // no lighting lighting off texture_unit { // We use the grass texture as the base. other textures are blended over it texture Grass.jpg // Scale the texture so, that it looks nice scale 0.1 0.1 // Only blend colour //colour_op_ex source1 src_texture src_texture } } // dirt pass pass { // no lighting lighting off // blend with former pass scene_blend alpha_blend // only overwrite fragments with the same depth depth_func equal // alpha map for the dirt texture_unit { texture TestAlpha1.png // use alpha from this texture alpha_op_ex source1 src_texture src_texture // and colour from last pass colour_op_ex source2 src_texture src_texture } // detail texture texture_unit { texture Dirt.jpg scale 0.15 0.15 // alpha blend colour with colour from last pass colour_op_ex blend_diffuse_alpha src_texture src_current } } // rock pass pass { // no lighting lighting off // blend with former pass scene_blend alpha_blend // only overwrite fragments with the same depth depth_func equal // alpha map for the dirt texture_unit { texture TestAlpha2.png // use alpha from this texture alpha_op_ex source1 src_texture src_texture // and colour from last pass colour_op_ex source2 src_texture src_texture } // detail texture texture_unit { texture RoughRock.jpg scale 0.15 0.15 // alpha blend colour with colour from last pass colour_op_ex blend_diffuse_alpha src_texture src_current } } // .... further detail passes like the former one // lighting pass pass { ambient 0.8 0.8 0.8 1 diffuse 0.7 0.7 0.7 depth_func equal scene_blend zero src_colour } } }