Page 1 of 1

Textures in Maya looks different in irrLicht

Posted: Sun Nov 04, 2007 10:15 am
by ibax
Hi all!

I have a little problem. I have a Maya project, a modeled house. Now I want to texture the walls, floors, etc.
I'm doing the following steps:
1) select one room (cube) -> assign new material -> (for example) lambert -> Color -> file -> texture.jpg
2) the texture file is loaded, but it is not on the good position, it is upside-down, etc...
3) I'm selecting the faces on one wall, make a planar projection, and now I can resize, rotate, transform the texture file on each wall. I do this for each wall in the "room" (the normals are pointing inside the cube)
4) when the room is ready, I export the project to obj (to use in irrLicht)

BUT, when I open the obj file in irrLicht, de texture file is loaded, but I think, the planar projection settings aren't. why is it??
how should I assign a texture for each wall, for each face in maya, if I want to use it in irrLicht????

The size of texture file is: 512x512 or 1024x1024

can somebody help me??

Posted: Sun Nov 04, 2007 12:23 pm
by Virion
Have you uv-mapped the model?

Posted: Sun Nov 04, 2007 1:02 pm
by CuteAlien
I think .obj files do not support planar projections.
So far I know no format which works with Maya and can do that, but I've no Maya myself so I also can't do much tests (I always have to ask someone else to do that for me).

There is a loader (http://irrlicht-plugins.googlecode.com/ ... aders/LMO/) which allows working with multitexturing with .obj files, which might be a good start if you try to work on support for planar projections. But for the few testfiles I had for that, it didn't work correct for planar mapped stuff. So some work ahead...

Posted: Mon Nov 05, 2007 7:37 am
by ibax
I didn't UV mapped the modell, but I think, maya makes some default UV map for each modell.

if the planar projection isn't a good idea, than how can I assign different textures for different parts of my house, rooms, etc??

is there some tutorial, or something, which can help for me??

Posted: Mon Nov 05, 2007 11:13 am
by ibax
And what about the format .x
There are some exporters, which can export maya files to .x file.
Can be this format the solution for my problem??

I will try it....

I heard something about the "Bake" function in Maya, which "bakes" the texture into the polygon objects... but it is hard to find a good tutorial or description, how it works...

Posted: Mon Nov 05, 2007 12:50 pm
by CuteAlien
Hmpf, I shouldn't post on weekends. Sorry, but I mixed up planar mapping with something like normal mapping :( Planar mapping should certainly work and Virion has most likely given you already the correct hint. This sounds like missing uv-coordinates.

Posted: Mon Nov 05, 2007 1:37 pm
by hybrid
If you applied a technique which calculates the uv coords you have to make this explicit, such that every vertex gets the uv coords. Otherwise, you will only save the information that you use planar mapping, which is often discarded upon export. So use some Maya function to bake the texture coords onto the vertices. Or call makePlanarMapping inside your Irrlicht code.

Posted: Mon Nov 05, 2007 11:38 pm
by ibax
hi!

thanks for the helps.
I learned, how to use UV-s, so the solution is:

1) assign material to polygon object -> file -> texture.jpg
2) automatic projection
3) transform, or rotate, or scale the UV vertices to the real position
4) export to obj format

the result .obj file will be the same, what u see in Maya

but its true, when I assign 5-6 texture files (max resolution 1024x1024, max filesize 800k), the exe files allocates 2x-3x bigger place in the memory. why is it?

Posted: Tue Nov 06, 2007 12:32 am
by hybrid
If you mean memory usage during run-time, then it's because textures are handled as bitmaps in the application (because it does not work otherwise, the gfx card needs to know the color values). And that's typically 3 bytes for the three colors (or even 4 when alpha channels come in).

Re: Textures in Maya looks different in irrLicht

Posted: Fri Jun 08, 2012 3:54 pm
by NoLJustS
Hello. I have a question about texturing maya model in irrlicht. I have obj file and several textures. My scene contains many objects. And there are several groups of them who use same textures. Is it right that vertices of objects who use same texture should be in one MeshBuffer? Is it right that it should happen automatically after ISceneManager->getMesh() is called or after ISceneManager->addMeshSceneNode() is called?

Re: Textures in Maya looks different in irrLicht

Posted: Mon Jun 25, 2012 2:57 pm
by NoLJustS
Well, here is the answer - when we export model from 3ds max or blender, we get two files: file.obj and file.mtl(material texture library). When we load model in irrlicht by calling "IAnimatedMesh* mesh = smgr->getMesh("file.obj");" engine will read all needed information from mtl file if its in same directory as obj file and it must have right paths to texture files...