Textures in meshes not working

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
Donald Duck
Posts: 34
Joined: Sat Jan 21, 2017 6:51 pm
Location: Duckburg
Contact:

Textures in meshes not working

Post by Donald Duck »

I'm trying to create 3D scenes with textures with Blender to use in Irrlicht. Here is a screenshot of the scene in Blender:

Image
https://user.oc-static.com/upload/2017/ ... C3%B6s.png

To use it in Irrlicht, I tried exporting it in OBJ and 3DS formats. In both cases, here is the result in Irrlicht:

Image
https://user.oc-static.com/upload/2017/ ... C3%B6s.png

As you can see, there is a problem. Instead of textures, there is a unique color which is a mix of colors in the texture.

In case it's important, the texture's format is BMP, but I also tried with PNG and JPG.

Why isn't it working? How can I make it work?

PS: Sorry, the images were made to big and I can't get them to the correct size so the whole images aren't visible. To see the complete images, click on the URL under them.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Textures in meshes not working

Post by CuteAlien »

Could be 2 things going wrong. First is something uv-mapping. Second is something with textures. When wrong uv-mapping then this might be the green part of your texture (maybe with slightly different lighting on top). When texture - maybe the color in Irrlicht is not the texture at all, but the material-color isntead.

Start by looking at the .mtl file when you export as .obj files. That is where the textures are written into. Is the correct texture mentioned in there? Also take a look at the console log when starting your application if it shows any errors (like missing texture warnings).

If it's wrong uv's... more tricky. Basically if you did set them correct in Blender then the export usually works. When it's just a plane you might still be able to see if something is wrong by checking uv's directly in the .obj format (it's a text-based format, so it's possible to read it...).

Can't tell much more without having concrete test-case (aka code and models).
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
Post Reply