Terrains Regions - Multitexturing

BlitzMax Forums/MiniB3D Module/Terrains Regions - Multitexturing

FBEpyon(Posted 2014) [#1]
Hello All,

I'm sure I have asked this once before, but I'm working on my map editor again for my RPG, and I'm look for suggestions of how I should do the breaking up of the terrain itself.

I have done some research already into larger terrains, and breaking things into chunks, but my major issues have then managing the neighboring vertices. I know its easy for most to understand this, but I just can't seem to get my head around it.

Also I wanted a opinion about the multi-texturing I'm doing and trying to allow for more than just 3 types of textures, It seems that others are using meshes with 16x16 vertices and just assigning the texture to that block which then seems to give you the support for unlimited numbers for texture that can be used long as you do use more than 3 types, and the neighboring chunk has the at least on of the textures to blend with.?

Any help on this matter would be great.

Thanks,

FBEpyon


Krischan(Posted 2014) [#2]
I'm multitexturing a Planet in miniB3D right now. I'm using vertex alpha for this, perhaps you can pull some information out of this code which has been taken from my TPlanet type. Here, the height/alpha information gets calculated from a noise function (which has been already applied to a sphere and is "stored" in the VertexRed value) and adds only "non zero alpha" triangles which gives nice transitions. The vertex alpha values are being added together and stored in a type and when the new triangles are being drawn this information is used again to decide if they need to be drawn. It's not optimized yet but it works (and is simple to code), as you can see in this screenshot - five layers are being used here.

And just to mention - in miniB3D it is only possible to have a maximum of 4 different textures for each surface.




FBEpyon(Posted 2014) [#3]
Thank you for the information.

I have been trying to get mine to work better using multiple chunks, each chunk is 9x9 vertices, and the maps are 256x256 each which seems to be working fine, but I'm now running into the issues of lining up the edges of each chunk, and is only required in realtime during the map making process the game engine itself is just reading the locations of each vertices when the map loads, and currently I have to manually adjust the edges in the editor to make it look correct.

The multi-texturing is working for the most part each chunk reads a part of the alpha map that is loaded using shaders, and works well with the over laps (little weird at times), but works.