Also problem loading Textures (opengl only)

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
bassiks
Posts: 5
Joined: Wed Feb 23, 2011 8:34 am

Also problem loading Textures (opengl only)

Post by bassiks »

Hi!

This is what I'm trying:

Code: Select all

ISceneNode* node=m_Smgr->addBillboardSceneNode(0, dimension2d<f32>(10.0f,10.0f));
node->setMaterialTexture(0, m_Driver->getTexture(texture_path.c_str()) );
    node->setMaterialFlag(EMF_LIGHTING, false);
Path and everything is fine. With EDT_SOFTWARE the texture is displayed correctly. With EDT_OPENGL everything is white.

I thought it may be opengl, but then I tried the Movement example with OpenGL and the cube and the sphere have textures. Everything seems to work there.

I compared how they create the device etc. in the example, but found no difference.

Don't know what to try else.

I can not use DirectX because I'm on a linux machine.

Any idea?

greez,
bassiks
Sylence
Posts: 725
Joined: Sat Mar 03, 2007 9:01 pm
Location: Germany
Contact:

Post by Sylence »

Is the texture size a power of two?
If not, resize your texture to a power of two (128,256,512, etc)
Software documentation is like sex. If it's good you want more. If it's bad it's better than nothing.
bassiks
Posts: 5
Joined: Wed Feb 23, 2011 8:34 am

Post by bassiks »

The texture is 512x256

It is the earth texture from the media directory which comes with irrlicht...
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

are you sure that also nsquare texture is supported? some computers supports only

pow2xpow2

and not

pow2Axpow2B
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
bassiks
Posts: 5
Joined: Wed Feb 23, 2011 8:34 am

Post by bassiks »

I also tried a 256x256 jpeg. Everything works fine with EDT_SOFTWARE but with EDT_OPENGL everything is white :(
ErUs
Posts: 165
Joined: Thu Oct 07, 2004 6:13 pm

Post by ErUs »

Sounds like a lighting issue.
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post by REDDemon »

does irrlicht examples compile and run corretly using OpenGL?
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

Strange, this only happened to me when I was trying out multithreading.
Working on game: Marrbles (Currently stopped).
bassiks
Posts: 5
Joined: Wed Feb 23, 2011 8:34 am

Post by bassiks »

yeah irrlicht examples compile and run correctly with opengl...

the point with multithreading sounds interesting...i have the irrlicht engine running in an own posix thread. (the rendering loop with beginSecen etc.)...

I'm loading and setting the material and textures from a different thread while engine is already in rendering loop. the threads are protected by pthread_mutex_lock and unlock...

Is that a problem?
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

I think that it is the problem as I was doing almost the same, tough without mutexes, I used python in my app, python was running in other thread and it had exposed loading functions, so when I was loading from python it went white, I fixed it by running it in the same thread.
Working on game: Marrbles (Currently stopped).
bassiks
Posts: 5
Joined: Wed Feb 23, 2011 8:34 am

Post by bassiks »

Wow that's the key... Thanks a lot. That was the last I was thinking about. So I think I'll implement a message queue :D

Thank you very much!
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You must have everything which does OpenGL calls inside the very same thread. From device creation until releasing it at the end. You can spawn any thread from there, which does not do any graphics related stuff. No problem with that. But putting gl codes into different threads is not possible (besides some complex stuff such a s multiple contexts, or opengl 4, which might allow such things)
Post Reply