[SOLVED] PNG texture rendered badly

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
ManlyStump
Posts: 6
Joined: Mon Mar 02, 2015 3:31 pm

[SOLVED] PNG texture rendered badly

Post by ManlyStump »

I've adapted the first tutorial project (Hello World) and built a Sokoban game using that as a starting place. I've replaced the initial model loading and texture assigning with my own models exported from Blender, using PNG textures I made in Gimp. Most of my models look fine except for the player model (a little cartoon bulldozer) which instead of rendering as yellow it looks brown. Can anyone shed any light as to why? I'll attach the texture itself and a screenshot from within Irrlicht below. Incidentally I'm using the OpenGL rendering mode, and I've experimented with the Gamma values in the PNG, and I get the same problem, with or without gamma values.

Image Image

Code: Select all

IAnimatedMesh *myMesh = smgr->getMesh(modelFilename);
if ( node ) {
    node->setMaterialFlag(EMF_LIGHTING, false);
    node->setMD2Animation(scene::EMAT_STAND);
    node->setMaterialTexture(0, driver->getTexture(textureFilename));
}
Any help would be greatly appreciated.
Last edited by ManlyStump on Tue Mar 03, 2015 9:57 am, edited 1 time in total.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: PNG texture rendered badly

Post by hendu »

1. Convert to jpeg/bmp and see if it still happens.
ManlyStump
Posts: 6
Joined: Mon Mar 02, 2015 3:31 pm

Re: PNG texture rendered badly

Post by ManlyStump »

Weirdly, I just tried converting the PNG to BMP and JPG with Paint and both times it seemed to lose the UV mapping! It had the same dark orange/brown colouring but was all the same colour.
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: PNG texture rendered badly

Post by hendu »

Then it is not the PNG format or even the texture, but something with the model or your code.
ManlyStump
Posts: 6
Joined: Mon Mar 02, 2015 3:31 pm

Re: PNG texture rendered badly

Post by ManlyStump »

Fair enough, thanks for the help.

EDIT: Not sure what caused it but I tried exporting to 3ds instead of x and now it renders absolutely fine! This thread can be closed now.
Post Reply