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.
Don't display sydney texture file
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Don't display sydney texture file
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
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");
}
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
@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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Don't display sydney texture file
@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 ?
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
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.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: Don't display sydney texture file
@CuteAlien : ^^ thanks for your kind.
I will check more.
I will check more.
Re: Don't display sydney texture file
i also meet this problem.
but i can't resolve it.
if you have resulted , please write it, thanks.
but i can't resolve it.
if you have resulted , please write it, thanks.
-
- Posts: 1
- Joined: Thu Nov 08, 2012 1:40 am
Re: Don't display sydney texture file
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.