texture files seem to be hard-coded?

Captain_Deathbeard

22-11-2005 18:29:48

No matter what textureFormat I use I only ever get 2 results; either by terrain is completely white, or it is splatted with the demo textures (rock,grass,sand,snow). I cannot get it to use my own textures.

So then I noticed all the .material files in the paginglandscape directory, they seem to have the texture filenames coded into them.

Even though I have my own textures coded into both .cfg and .gen.cfg:
SplatFilename0=sand1.png
SplatFilename1=sand2.png
SplatFilename2=earth23a.png
SplatFilename3=SandRed01.png


the terrain still has the same textures. The simplest example is in IPLSM_Image.material:
// This material will be used with splatting
material IPLSM_Image
{
technique
{
pass
{
ambient 0.3 0.3 0.1
diffuse 0.8 0.8 0.6 1.0

texture_unit
{
//texture none
tex_address_mode clamp
colour_op_ex modulate src_texture src_diffuse
}

texture_unit
{
texture rockDetail.jpg
filtering bilinear
tex_address_mode mirror
colour_op_ex modulate_x2
scale 0.03 0.03
}
}
}
}


It has no texture specified (dunno what "tex_address_mode clamp" does), and then a detail texture rockDetail.jpg. So if I put:
TextureFormat=Image
ImageFilename=sand1 <--(my own texture)
I get a plain white terrain with a slight detail texture.

So how do I use my own textures?
Do I edit the .material files there? But then how would I have different levels with different textures? I cant just hardcode them in.
And then what is the purpose of the "SplatFilename0=..." in the .cfg's if they have no effect?

tuan kuranes

22-11-2005 18:40:39

Forgot this one on my todo list.

Easy to do, still.
Take the texturemode you use and just replace the names in the load method.

SplatFilenameX is used to compute base texture now. But I'll soon add the dynamic.