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.

Irrlicht Android specific device issue

Postby Sfortza » Thu May 05, 2011 8:26 pm

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

Postby hybrid » Thu May 05, 2011 9:18 pm

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.
hybrid
Admin
 
Posts: 13970
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Irrlicht Android specific device issue

Postby ghd214 » Thu Jan 05, 2012 5:55 am

I have the same issue, Do you know how to solve ?
ghd214
 
Posts: 4
Joined: Wed Mar 31, 2010 7:48 am

Re: Irrlicht Android specific device issue

Postby Lysenko » Wed Jan 25, 2012 6:48 pm

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:
cpp 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.
Lysenko
 
Posts: 5
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Postby hybrid » Wed Jan 25, 2012 10:45 pm

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
hybrid
Admin
 
Posts: 13970
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Irrlicht Android specific device issue

Postby Lysenko » Thu Jan 26, 2012 5:13 pm

@hybrid: Thanks for response.

Another code that raise GL_INVALID_ENUM is in COGLESDriver::setBasicRenderStates:
cpp 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/documentation/opengles1_0/html/glTexParameter.html , glTexParameterf hasn't GL_TEXTURE_MAX_ANISOTROPY_EXT parameter name.

Maybe I should look into other documentation?
Lysenko
 
Posts: 5
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Postby hybrid » Thu Jan 26, 2012 6:17 pm

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.
hybrid
Admin
 
Posts: 13970
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Irrlicht Android specific device issue

Postby Lysenko » Thu Jan 26, 2012 7:21 pm

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
cpp 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
cpp 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?
Lysenko
 
Posts: 5
Joined: Wed Jan 25, 2012 6:32 pm

Re: Irrlicht Android specific device issue

Postby hybrid » Thu Jan 26, 2012 10:40 pm

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.
hybrid
Admin
 
Posts: 13970
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: Irrlicht Android specific device issue

Postby Lysenko » Thu Jan 26, 2012 11:00 pm

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.
Lysenko
 
Posts: 5
Joined: Wed Jan 25, 2012 6:32 pm


Return to Beginners Help

Who is online

Users browsing this forum: Google [Bot] and 1 guest