More than one texture within a mesh

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

More than one texture within a mesh

Post by elander »

I want to have more than one texture applied to different parts of a mesh. For example i have a room block that is a single mesh. I want to apply a texture to the ceiling, a texture to the floor, one different texture for each wall plus a couple of textures just for the bottom of the walls and the top of the walls that will go over the wall textures perhaps with an special blending technique. Is this possible with Irrlicht ?

I have another question when importing a file with several meshes and read it as a IAnimatedMesh how is it possible to iterate over the mesh list ? Im not talking about an animation but, for example a .3ds or a .x containing a scene with multiple meshes. .3ds files can also apply several textures to a single mesh.
cpprules
Posts: 148
Joined: Wed Jul 27, 2005 8:37 pm
Location: on the Pedastal

Post by cpprules »

If you are going to apply textures manualy, you can apply just two. But the good thing is that you can apply as much as you want by using .x format. ( The textures are automaticly loaded if they are in same folder )
CRPG, FRPG, Oblivion Fan
Hater of Counter Strike (i hate it so much damn it)
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

The work im doing involves randomly generating (more like random rearranging) a dungeon from separate parts, so i need to be able to reassign different textures to meshes and change meshes slightly.

An example, i m going to snap a corridor cap to a corridor section so i just copy the cap part to the proper place and align it to the opening of the corridor section. The random dungeon generator has determined that the back wall of the part i have just snaped is going to have a fountain so i replaced a normal wall with a fountain wall an put a water effect in that place. In order for the textures to match (both the corridor section and the corridor cap piece) i must reassign the cap textures to match the ones in the corridor.

I can just separate everything into a one mesh per file and one texture per mesh solution but that would have a huge impact on performance, right ? Is there any other way to do this, like mixing OpenGL commands with Irrlicht code ? Thanks.
cpprules
Posts: 148
Joined: Wed Jul 27, 2005 8:37 pm
Location: on the Pedastal

Post by cpprules »

I dont know about that, what are you making something like Diablo.
CRPG, FRPG, Oblivion Fan
Hater of Counter Strike (i hate it so much damn it)
elander
Posts: 193
Joined: Tue Oct 05, 2004 11:37 am

Post by elander »

cpprules wrote:I dont know about that, what are you making something like Diablo.
Something similar but in 3d. You are an Oblivion fan you must remenber the second episode of the series: Daggerfall. The game had hundreds of generated 3d dungeons. I have a program that extracts the 3d parts into .3ds files and im trying to recreate this algorithm with Irrlicht.

See this thread here and download the demo i made so far. Its only a simple demo to show a dungeon manualy built with Daggerfall pieces. It only contains one texture applied to all pieces. This is my problem i can't handle multiple textures per mesh or multiple meshes per .3ds file.

http://irrlicht.sourceforge.net/phpBB2/ ... php?t=8510
Post Reply