How to create 4 texture layers (multitexturing)?

Blitz3D Forums/Blitz3D Programming/How to create 4 texture layers (multitexturing)?

Braincell(Posted 2005) [#1]
Hi,

i'm having some troubles creating 4 texture layers. I know about multitexturing 2 textures one over the other but using 3d max i just cant seem to work out how to get 4 textures layered properly. Has anyone done it in 3d max or any other 3d modeling software? If not, how should i layer them, would anyone be able to help me out?

All i found online was some code on multitexturing but not instructions on how to apply masks in order to have 4 layers, i think thats whats confusing me quite a lot.

Any help or hint will be highly appreciated. I need this to continue making my terrain.


sswift(Posted 2005) [#2]
It depends on what you want to do.

You'll need to specify which layers you want to be masked, which blending mode you want each layer to use, which layers to want to be able to adjust the alpha on, which layers have alpha, and which layers you want to be affected by light.

If you want masks or alpha and want it to be affected by light, you need to create a second surface with the same polygons and turn on the vertex alpha flag for the surface.

I gotta go eat dinner though so I can't explain more right now.


Braincell(Posted 2005) [#3]
Yea thanks sswift. I went to IRC and got heaps of help from our friendly neighbour morduun. He dug up a vertex alpha demo by worldcreator that demonstrated it. But the problem is i already created a huge terrain divided into 20x20 sections in 3d max, and i planned to hold each of the 400 sections as a separate b3d file (or children of 1) and hide/show them to get good fps ingame etc. I did this because i read in blitz that multitexturing is possible for 4 layers, and i glanced over some multitexturing demos and thought it must be easy to apply to premade terrain. Thats where i was wrong. I saw worldcreators terrain demo (kindly uploaded by mordun to his own server since BC is down) and basically each layer has to be a 3d model of its own in a way with vertex alpha specified for each vertex. Doing that for my existing and highly detailed terrain would be impossibly tedious, so i dont think i will do it.

I will either scrap this terrain and make a new one using some sort of editor (doubt it), or use only 2 textures per section to create some variety (more likely).

Oh, and if i wasnt clear enough i need 4 differnt terrain types (forest, rocky, grass, sparse grass) to be tiled as detailed textures on the terain and blend into eachother gradually.

I learned something so it was all good. I'm not working on anything serious, just a learning project.


AdrianT(Posted 2005) [#4]
hmm, I do the alpha masking thing for terrains by moving the local pivot of the object to change it's sort order. So whatever alpha object is drawn closer gets the local pivot closer to 0,0,0

Worlks pretty well for most things and is what I did in the racing game.