Hello everyone,
I just met Panda3D and saw its potential. Now im learning Panda and making my dream-game in C++.
I just wanna ask something to you guys, im learning about terrains in panda and i can load GeoMipTerrain from a heightmap file. Also i can apply texture to it. Here is some code and screenshots;
void Background::LoadTerrain(string _mapname) {
GeoMipTerrain terrain("terrain");
const string _heightmap_file = "bin/neuera/maps/" + _mapname + "/height.png";
terrain.set_heightfield(Filename(_heightmap_file));
terrain.set_bruteforce(true);
terrain.generate();
terrain.get_root().set_sz(150);
terrain.set_auto_flatten(GeoMipTerrain::AFM_strong);
NodePath terrainNP = terrain.get_root();
PT(Texture) sandTexture = TexturePool::load_texture("bin/neuera/tex/dirt.png");
sandTexture->set_minfilter(SamplerState::FT_nearest_mipmap_linear);
sandTexture->set_magfilter(SamplerState::FT_linear);
PT(TextureStage) sandStage = new TextureStage("sandStage");
sandStage->set_sort(1);
sandStage->set_texcoord_name("terrain");
terrainNP.set_texture(sandStage->get_default(), sandTexture);
terrainNP.set_tex_scale(sandStage->get_default(), LVector2(5, 5));
terrain.get_root().reparent_to(window->get_render());
}
But its applying one texture to entire terrain. I found @wezu 's level editor and its amazing!
Im just wondering is it possible to apply multiple texture to GeoMipTerrain like this? ;
Im searching but could not found too much information about this (especially in C++)
Thanks for your time and im sorry about my english…