Textures in Maya looks different in irrLicht

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Textures in Maya looks different in irrLicht

Post 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??
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Have you uv-mapped the model?
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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...
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post 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??
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post 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...
CuteAlien
Admin
Posts: 9633
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post 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.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
ibax
Posts: 193
Joined: Thu Jun 21, 2007 8:56 am
Location: hungary
Contact:

Post 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?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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).
NoLJustS
Posts: 5
Joined: Fri May 25, 2012 2:35 pm

Re: Textures in Maya looks different in irrLicht

Post 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?
NoLJustS
Posts: 5
Joined: Fri May 25, 2012 2:35 pm

Re: Textures in Maya looks different in irrLicht

Post 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...
Post Reply