Irrlicht Android specific device issue

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
Sfortza
Posts: 39
Joined: Thu Mar 17, 2011 12:40 pm
Location: 184

Irrlicht Android specific device issue

Post by Sfortza »

Have issue connected with specific device.
Have error log.

Issue is in two lines
05-04 17:14:20.015: INFO/log(2744): GL_INVALID_ENUM
05-04 17:14:20.015: INFO/log(2744): Could not bind Texture

As a result the scene is rendered without textures.
This is reproduced on Samsung Galaxy Ace but didn't reproduced
on Nexus One, HTC Desire and Wildfire, Samsung Galaxy S.

What's wrong?

Thanks in advance.

05-04 17:14:19.975: INFO/log(2744): Using renderer: OpenGL ES-CM 1.1
05-04 17:14:19.975: INFO/log(2744): Qualcomm
05-04 17:14:19.975: INFO/log(2744): GL_AMD_compressed_3DC_texture GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_APPLE_texture_2D_limited_npot GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888...(reduced)
05-04 17:14:20.015: INFO/log(2744): GL_INVALID_ENUM
05-04 17:14:20.015: INFO/log(2744): Could not bind Texture
05-04 17:14:20.055: INFO/Irrlicht(2744): createDevice r=2340400 w=320 h=480
05-04 17:14:20.055: INFO/Irrlicht(2744): getVideoDriver r=2341096
05-04 17:14:20.055: INFO/Irrlicht(2744): resize w=480 h=320

05-04 17:14:25.135: INFO/log(2744): Generated terrain data (256x256) in 5.0790 seconds
05-04 17:14:25.245: INFO/log(2744): Loaded texture
05-04 17:14:25.835: INFO/log(2744): Loaded texture
05-04 17:14:25.855: INFO/log(2744): Loaded texture
05-04 17:14:25.865: INFO/log(2744): Loaded texture
05-04 17:14:25.875: INFO/log(2744): Loaded texture
05-04 17:14:25.885: INFO/log(2744): Loaded texture
05-04 17:14:25.895: INFO/log(2744): Loaded texture
05-04 17:14:25.895: INFO/log(2744): Loaded texture
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should do yourself a favor (and also us) and avoid cross-posting. Choose one thread and post there. If you're told that it's the wrong position, you can post it elsewhere or get it moved.
ghd214
Posts: 4
Joined: Wed Mar 31, 2010 7:48 am

Re: Irrlicht Android specific device issue

Post by ghd214 »

I have the same issue, Do you know how to solve ?
Lysenko
Posts: 10
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Post by Lysenko »

I can't solve it.
Samsung Ace, Android 2.2

The error is raised in COGLES1MaterialRenderer_SOLID::OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial, bool resetAllRenderstates, IMaterialRendererServices* services).

Stack trace looks like COGLES1Driver -> genericDriverInit -> setRenderStates3DMode -> OnSetMaterial.

I stuck on OnSetMaterial code, especially this lines:

Code: Select all

 
     if (resetAllRenderstates || (material.MaterialType != lastMaterial.MaterialType))
                {
                        // thanks to Murphy, the following line removed some
                        // bugs with several OGLES1 implementations.
                        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
                }
 

If you have any info about Murphy or "some bugs", please help.

After commenting glTexEnvi , I can see textures, but only if they are close to camera.


Sorry for my English.
Thanks for any help.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht Android specific device issue

Post by hybrid »

The comment is wrong, it read OpenGL at the time it was written. Don't know how this was replaced this wrong. It should be removed anyway. It somehow sounds as if you have problems with vertex colors, because once you remove the modulate you might get straight texturing instead of vertex color modulation. Maybe try your scene with one of the standard renderers first. Maybe some lighting issues also, or some other scene problem
Lysenko
Posts: 10
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Post by Lysenko »

@hybrid: Thanks for response.

Another code that raise GL_INVALID_ENUM is in COGLESDriver::setBasicRenderStates:

Code: Select all

 
#ifdef GL_EXT_texture_filter_anisotropic
if (FeatureAvailable[IRR_EXT_texture_filter_anisotropic])
       glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT,
                     static_cast<GLfloat>(material.TextureLayer[i].AnisotropicFilter>1 ? core::min_(MaxAnisotropy, material.TextureLayer[i].AnisotropicFilter) : 1));
#endif
 
According to http://www.khronos.org/opengles/documen ... meter.html , glTexParameterf hasn't GL_TEXTURE_MAX_ANISOTROPY_EXT parameter name.

Maybe I should look into other documentation?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht Android specific device issue

Post by hybrid »

Well, this one should only be enabled if the headers support the extension. Hence the ifdef and the FeatureAvailable check. So if the headers support the ext extension, and also the runtime says it does, there's quite some chance that it's for sure supported.
Lysenko
Posts: 10
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Post by Lysenko »

Samsung ACE assures that he supports anisotropic filter on runtime.
But when I do #undef GL_EXT_texture_filter_anisotropic, all GL_INVALID_ENUM errors disappeared.

Second step is dirty monkey patch.
I changed code in OnSetMaterial from

Code: Select all

 
if (resetAllRenderstates || (material.MaterialType != lastMaterial.MaterialType))
{
        // thanks to Murphy, the following line removed some
        // bugs with several OGLES1 implementations.
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
 

to

Code: Select all

 
if (material.MaterialType != lastMaterial.MaterialType)
{
        // thanks to Murphy, the following line removed some
        // bugs with several OGLES1 implementations.
        glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
}
 
And it works!
Code is tested only on Samsung Ace, can some one test this solution on other phones, please?
@hybrid, can you give me some clue about how resetAllRenderstates used on createDevice step?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Irrlicht Android specific device issue

Post by hybrid »

Maybe we have some missing texture setup there for an unknown reason. This could lead to in invalid enum maybe. Or do you have just one scene node and material in your scene for now?
Maybe the EXT extension is not right for the filter there. Problem is that many drivers and emulators have really badly written extensions sometimes. I'd have to go through all the extension definitions once more, but IIRC, I did this for the filter things already. So maybe more likely not a problem with Irrlicht.
Lysenko
Posts: 10
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Post by Lysenko »

My scene has 3 nodes/materials.
This isn't problem with Irrlicht, as topic starter mentioned before, this is specific Android device problem - Samsugn Ace.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Android specific device issue

Post by CuteAlien »

Old topic, but I run into the same problem on Moto G. The one with the glTexParameterf call failing for GL_TEXTURE_MAX_ANISOTROPY_EXT with GL_INVALID_ENUM. I had seen a GL_INVALID_ENUM on startup for a while already so started to debug around a while tonight until I found it as well. Only happens in ES1.0, while same call works in ES2.0. After which I googled... to get this thread as result. Irrlicht forum knows it all ;-)

The device reported that it supports GL_EXT_texture_filter_anisotropic, so I also guess it's a vendor bug. My other device does not support that extension at all (and correspondingly not getting errors there).
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
devsh
Competition winner
Posts: 2057
Joined: Tue Dec 09, 2008 6:00 pm
Location: UK
Contact:

Re: Irrlicht Android specific device issue

Post by devsh »

Only happens in ES1.0, while same call works in ES2.0. After which I googled... to get this thread as result. Irrlicht forum knows it all ;-)

The device reported that it supports GL_EXT_texture_filter_anisotropic, so I also guess it's a vendor bug. My other device does not support that extension at all (and correspondingly not getting errors there).
The reason is that now, in this day and age ES 1.1 is "compatibility profile"-like and its not top priority or in-fact any priority at all for driver developers, a move to ES 2.0 or better ES 3.0 would solve your problems.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Irrlicht Android specific device issue

Post by CuteAlien »

Hehe thread revived once more ;-) And yeah - we also just keep ES 1.1 around because there had never been a release with it in Irrlicht and as long as it doesn't make troubles we will keep it for 1.9, but marked as deprecated. If it causes any troubles it will be kicked out. Not that Android devices with ES 2.0 cause any less troubles - drivers are sometimes just as bad on some devices (but that's just Android as usual).
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
Post Reply