Page 1 of 1

Don't display sydney texture file

Posted: Tue Jun 05, 2012 8:29 am
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.

Re: Don't display sydney texture file

Posted: Tue Jun 05, 2012 8:46 am
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.

Re: Don't display sydney texture file

Posted: Thu Jun 07, 2012 4:20 am
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");
}

Re: Don't display sydney texture file

Posted: Thu Jun 07, 2012 8:42 am
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)?

Re: Don't display sydney texture file

Posted: Thu Jun 07, 2012 9:10 am
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 ?

Re: Don't display sydney texture file

Posted: Thu Jun 07, 2012 10:15 am
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.

Re: Don't display sydney texture file

Posted: Thu Jun 07, 2012 11:00 am
by leekihyun
@CuteAlien : ^^ thanks for your kind.
I will check more.

Re: Don't display sydney texture file

Posted: Sat Aug 18, 2012 7:10 am
by guqun
i also meet this problem.
but i can't resolve it.
if you have resulted , please write it, thanks.

Re: Don't display sydney texture file

Posted: Thu Nov 08, 2012 1:43 am
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.