Android Port

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Android Port

Post by guqun »

reizencroft wrote:I have made an attempt on making ogles2 work and was somehow successful. I forked it from the ogles branch(r4073) and borrowed some code from the OP.

here's github link:
https://github.com/reizencroft/irrAndroid

and a video of example 8 running on Samsung Galaxy S2(android 2.3)
http://youtu.be/TPtO4UDSMrM
hi
i dowbloader your code and run it ,it is very nice.
but i attempt to run example by GLSurfaceView of android and crash, i cant find the reason.
i want to know if you run it like tihs and resolved it.
thanks!
Last edited by guqun on Sun Aug 19, 2012 5:10 pm, edited 1 time in total.
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Android Port

Post by guqun »

guafeng wrote:
Andi.Dascalu wrote:Hy,

I have a problem with the GLES 2.0 driver. It does not load my textures. GLES 1.0 works fine with the same textures.
I have a LG Optimus Black.

Anyone know what is the solution to this problem?
I have the same issue. GLES 1.x OK, but GLES 2.0 cant apply texture. I am currently trying to find the answer, and anybody could give some advice. Thanks in advance.
wow,i have the same problem. waitting for the ansower........
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Android Port(Using with GLES2 problem)

Post by guqun »

zhengxianfu wrote:I have already compiled with _IRR_COMPILE_WITH_OGLES2_ ,Copy those .vsh .fsh into /mnt/sdcard/irrlicht/

There is error when createShader (COGLES2SLMaterialRenderer.cpp:343), glGetShaderiv return error ,and the program crash.

And also ,there are many :called unimplemented OpenGL ES API.
Here is the Logcat :

07-23 12:53:18.282: I/log(32557): Irrlicht Engine version 1.7.0-beta
07-23 12:53:18.292: I/Irrlicht(32557): CIrrDeviceAndroid::CIrrDeviceAndroid
07-23 12:53:18.302: I/Irrlicht(32557): CIrrDeviceAndroid::createDriver
07-23 12:53:18.302: I/log(32557): OpenGL-ES2 initialized
07-23 12:53:18.312: I/Irrlicht(32557): OGLES2 initialized
07-23 12:53:18.312: I/log(32557): Using renderer: OpenGL ES-CM 1.1
07-23 12:53:18.312: I/log(32557): Qualcomm
07-23 12:53:18.312: I/log(32557): GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_APPLE_texture_2D_limited_npot GL_ARB_vertex_buffer_object GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_OES_blend_equation_separate GL_OES_blend_func_separate GL_OES_blend_subtract GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_draw_texture GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_framebuffer_object GL_OES_matrix_palette GL_OES_packed_depth_stencil GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_rgb8_rgba8 GL_OES_stencil_wrap GL_OES_texture_cube_map GL_OES_texture_env_crossbar GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_texture_mirrored_repeat GL_QCOM_binning_control GL_QCOM_extended_get GL_QCOM_tiled_rendering GL_AMD_compressed_3DC_texture
07-23 12:53:18.312: I/log(32557): load shader: /mnt/sdcard/Irrlicht/COGLES2FixedPipeline.vsh
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: I/log(32557): createShader.
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: I/log(32557): Loading shader
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: I/log(32557): glGetShaderiv error.
07-23 12:53:18.312: I/log(32557): ����l,(,�l�
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.312: I/log(32557):
07-23 12:53:18.312: I/log(32557): Error reading fixed pipeline vertex shader.
07-23 12:53:18.322: I/log(32557): createShader.
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): Loading shader
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): glGetShaderiv error.
07-23 12:53:18.322: I/log(32557): ����l,(,�l�
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557):
07-23 12:53:18.322: I/log(32557): Error reading fixed pipeline fragment shader.
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): GLSL shader program failed to link
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): He@He@ard/
07-23 12:53:18.322: I/log(32557): Error linking fixed pipeline shader program.
07-23 12:53:18.322: I/log(32557): Shader loaded
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): load shader: /mnt/sdcard/Irrlicht/COGLES2Renderer2D.vsh
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): createShader.
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API
07-23 12:53:18.322: I/log(32557): Loading shader
07-23 12:53:18.322: E/libEGL(32557): called unimplemented OpenGL ES API

please read http://stackoverflow.com/questions/5926 ... ngl-es-api
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Android Port

Post by hybrid »

Yeah, read it yourself. As we request a context for Version 2, it's obviously the emulator or device that does not support the ogl-es2 render context. You have a device which simply cannot create such a renderer. Switch back to ogl-es 1.x or update your mobile
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: cannot bind texture on android 2.3

Post by guqun »

zhengxianfu wrote:This problem has been solved.

Code: Select all

 
COGLESTexture.cpp:getBestColorFormat: 
"destFormat=ECF_A1R5G5B5;" 
 
OR Invoke:
driver->setTextureCreationFlag(ETCF_ALWAYS_16_BIT,true);
 
Refer to http://irrlicht.sourceforge.net/forum/v ... 8&start=45 by Willem.
Thanks.
pmtolk wrote:01-07 03:11:10.684: INFO/log(28446): Irrlicht Engine version 1.7.0-beta
01-07 03:11:10.684: INFO/Irrlicht(28446): CIrrDeviceAndroid::CIrrDeviceAndroid
01-07 03:11:10.684: INFO/Irrlicht(28446): CIrrDeviceAndroid::createDriver
01-07 03:11:10.684: INFO/log(28446): Using renderer: OpenGL ES-CM 1.1
01-07 03:11:10.684: INFO/log(28446): Qualcomm
01-07 03:11:10.684: INFO/log(28446): 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 GL_EXT_texture_type_2_10_10_10_REV GL_OES_blend_equation_separate GL_OES_blend_func_separate GL_OES_blend_subtract GL_OES_compressed_ETC1_RGB8_texture GL_OES_compressed_paletted_texture GL_OES_depth_texture GL_OES_draw_texture GL_OES_framebuffer_object GL_OES_matrix_palette GL_OES_packed_depth_stencil GL_OES_point_size_array GL_OES_point_sprite GL_OES_read_format GL_OES_rgb8_rgba8 GL_OES_stencil_wrap GL_OES_EGL_image GL_OES_texture_cube_map GL_OES_texture_env_crossbar GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_texture_mirrored_repeat GL_QCOM_binning_control GL_QCOM_extended_get GL_QCOM_tiled_rendering
01-07 03:11:10.694: INFO/log(28446): GL_INVALID_ENUM
01-07 03:11:10.694: INFO/log(28446): Could not bind Texture
01-07 03:11:10.694: INFO/Irrlicht(28446): createDevice r=3048792 w=320 h=480
01-07 03:11:10.694: INFO/Irrlicht(28446): getVideoDriver r=3049488
01-07 03:11:10.694: INFO/Irrlicht(28446): resize w=320 h=519
01-07 03:11:11.194: INFO/log(28446): Loaded mesh
01-07 03:11:11.214: INFO/log(28446): Loaded texture
01-07 03:11:11.214: INFO/Irrlicht(28446): add texture
01-07 03:11:11.214: INFO/Irrlicht(28446): beginScene

This is the complete Log Error

I encounter the same problem when using HTC G14 which also use qualcom ,texture doesn't render.

Does anyone know how to solve this problem?
Thanks in advance.

hi
i changed the code ,but sydney demo's texture is white.
did you meet this problem and reslove it?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Android Port

Post by hybrid »

Yeah, sydney has two problems. NPOT texture and indexed bmp (or is it really 8bit only?). Anyway, I also don't know if we could find out that there is some support lacking in the renderer, or if it is just a buggy implementation. Really not sure. Which emulator do you use?
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: Android Port

Post by hendu »

It works fine with the texture scaled to a POT png, so maybe it should be turned to that in irr to avoid these issues.

(*it = sydney on a PC)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Android Port

Post by hybrid »

Well, the problem is not that easy to solve, at least not the underlying one. Because it seems that there's some problem with the 16bit formats here, or some up/down conversion in between. The bmp loader should deliver 16bit A1R5G6B5, which might be wrong in the beginning already. The pixels have 24bit in the bmp, so we should return such format to avoid losing pixel data. But then, also this format seems to fail here for some reason.
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Android Port

Post by guqun »

hybrid wrote:Yeah, sydney has two problems. NPOT texture and indexed bmp (or is it really 8bit only?). Anyway, I also don't know if we could find out that there is some support lacking in the renderer, or if it is just a buggy implementation. Really not sure. Which emulator do you use?
you are right
we can avoid to use NPOT texture,
but the bmp is a problem.
wo use a pot png,the sydney is ok
i wish other picture all is right.
thank you in advanced
guqun
Posts: 8
Joined: Sat Aug 18, 2012 7:06 am

Re: Android Port

Post by guqun »

guqun wrote:
hybrid wrote:Yeah, sydney has two problems. NPOT texture and indexed bmp (or is it really 8bit only?). Anyway, I also don't know if we could find out that there is some support lacking in the renderer, or if it is just a buggy implementation. Really not sure. Which emulator do you use?
you are right
we can avoid to use NPOT texture,
but the bmp is a problem.
wo use a pot png,the sydney is ok
i wish other picture all is right.
thank you in advanced


sorry
sydney is right in es 1.1
but in es 2.0 the texture is white. i have use the POT texture and png picture.
my phone is moto MB525
do you meet?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Android Port

Post by hybrid »

So for opengl 1.x the problem is power-of-two or the 8bit BMP? Could you test with NPOT png or 16bit POT png?
For ogl-es2 it might be a shader problem, please post the full console log and also test other examples, e.g. 5 and 6.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

As You can find in some other threads related to OGL ES2 and mobile devices on this forum an OGL ES2 "white texture bug" is caused by use a arrays in a fixed pipeline shader for textures, this is not our mistake, but a bug in some drivers. As a workaroud we'll replace an array by 2 independent uniforms.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Auradrummer
Posts: 260
Joined: Thu Apr 17, 2008 1:38 pm
Location: Brasopolis - Brazil

Re: Android Port

Post by Auradrummer »

I'm newbie developing for Android.

As I don't have a real device, I'm using the emulator provided byt the official Android site. But, all the apk's I've downloaded from this thread fails to run (the process J2NI stops) . Is possible to run them on the Emulator? What I'm doing wrong?

Thanks guys
Professional Software Developer and Amateur Game Designer ;-)
Auradrummer
Posts: 260
Joined: Thu Apr 17, 2008 1:38 pm
Location: Brasopolis - Brazil

Re: Android Port

Post by Auradrummer »

Hello guys,

Worked fine here, I though the problem was worse than really was. The thing now is: dynamic lighting works over GLES1? Thanks
Professional Software Developer and Amateur Game Designer ;-)
ilzc
Posts: 2
Joined: Mon Sep 10, 2012 8:03 am

Re: Android Port

Post by ilzc »

Hi
I have complied the android port demo and it works well when it first launches.
But I found some confusing problems. One of the problems is that when turning the Activity containing GLSurfaceView to back stack, and return to the app later,texture is lost and models without texture is shown on the screen.
After lots of searching I found that using SurfaceView.setPreserveEGLContextOnPause(true) can solve the problem above,but as we know, this method needs api level 11.It means that it can't be used in android 2.x。
Another problems is that when I press "Back" key to exit the app,and launch it gain,the texture is also lost.I found a ugly solution. When leaving the app ,I exit the process explicitly calling "System.exit(0)".
Does anyone knows a good way which can prevent losing the texture?
Post Reply