Don't display sydney texture file

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
leekihyun
Posts: 8
Joined: Mon Jun 04, 2012 5:11 am

Don't display sydney texture file

Post by leekihyun »

hi.
i'm working with opengl es 2.0 on irrlicht android.
can display sydney md2 mesh file. but do not display sydney texture.
just white sydney is displayed.
why ? please let me know.
thanks.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Don't display sydney texture file

Post by hybrid »

IIRC, the texture is not power-of-two. So might be a problem with texture modes not properly supported or set. Try to rescale the texture.
leekihyun
Posts: 8
Joined: Mon Jun 04, 2012 5:11 am

Re: Don't display sydney texture file

Post by leekihyun »

hi. hybrid.
Thanks for your answer.
Sydney mesh is displayed. but not display texture.
just Sydney is running without texture -_-;;
when i used opengl es 1.0, everything is fine. texture displayed.
But in this case, opengl es 2.0, not working. WHY ??
maybe i think shader is problem. What's the problem ? ^^;
(irrlichtandroid 1.7.0-beta, opengl es 2.0)

this is my sample code :

stringc sydneyFilename = "/Irrlicht/sydney.md2";
mesh = smgr->getMesh( (gSdCardPath+sydneyFilename).c_str() );
if (!mesh)
{
device->drop();
__android_log_print(ANDROID_LOG_INFO, "Irrlicht", "cannot getMesh");
return;
}
nodeSydney = smgr->addAnimatedMeshSceneNode( mesh );

if (nodeSydney)
{
nodeSydney->setMaterialFlag(EMF_LIGHTING, false);
nodeSydney->setMD2Animation(scene::EMAT_RUN);
stringc sydneyTextureFilename = "/Irrlicht/sydney.bmp";
nodeSydney->setMaterialTexture( 0, driver->getTexture((gSdCardPath+sydneyTextureFilename).c_str()) );

__android_log_print(ANDROID_LOG_INFO, "Irrlicht", "add texture");
}
CuteAlien
Admin
Posts: 9694
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Don't display sydney texture file

Post by CuteAlien »

@leekihyun: Did you try what Hybrid said and rescaled the texture to have a power of two width (like 128, 256, 512 or 1024 pixels)?
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
leekihyun
Posts: 8
Joined: Mon Jun 04, 2012 5:11 am

Re: Don't display sydney texture file

Post by leekihyun »

@CuteAlien : I'm not sure the power of two width ?
Sydney's size is 308x193. You mean that rescaled to 128x128 or 256x256 ?
I did it. but not display texture.
If I send my sample code to you, can you check what's the problem ?
CuteAlien
Admin
Posts: 9694
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Don't display sydney texture file

Post by CuteAlien »

Sorry, I can't check (I'm not doing Android development, I don't even have a mobile phone actually).
But yes - rescaling to those numbers was what I meant (although only width matters, height doesn't really matter but if nothing shows that's not the problem).

I hope someone else can help you.
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
leekihyun
Posts: 8
Joined: Mon Jun 04, 2012 5:11 am

Re: Don't display sydney texture file

Post by leekihyun »

@CuteAlien : ^^ thanks for your kind.
I will check more.
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Don't display sydney texture file

Post by guqun »

i also meet this problem.
but i can't resolve it.
if you have resulted , please write it, thanks.
nonameentername
Posts: 1
Joined: Thu Nov 08, 2012 1:40 am

Re: Don't display sydney texture file

Post by nonameentername »

I was having the same problem with android. I was adding the models in the main loop and not the draw loop. I fixed it by adding the models in the draw loop.
Post Reply