Android Port

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
nabouill
Posts: 4
Joined: Wed Aug 26, 2009 9:00 pm

Re: Android Port

Post by nabouill »

personnaly, i only use OGLES1 for the moment, i have too problems with the OGLES2 for the light and FPS (turn arrond 5-20 fps with OGLES2 and stable to 60 fps with OGLES1)

screen with the OGLES1:
Image
Nabouill
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

At now we use uber shader (+discard) in OGLES2 and it cause big performance drop on mobile GPUs. In future uber shader will be replaced by simple shaders dedicated for each material. With custom shaders OGL ES2 is much faster than OGL ES1 in all my projects.

@Mikkis
Did you add:
device->getContextManager()->activateContext(device->getContextManager()->getContext());
after:
device->getContextManager()->generateSurface();
in my last patch? BinMa reported this bug some posts ago.

Cheers,
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Android Port

Post by mikkis »

Oops..I think I have used wrong .a file (the one which uses my own modifications and it works except textures),
because if I now compile with @Nadro's patch (with or without "device->getContextManager()->activateContext(device->getContextManager()->getContext());" line, I got only black screen).

debug:

Code: Select all

 
if (device->CreationParams.WindowSize.Width != surfaceWidth || device->CreationParams.WindowSize.Height != surfaceHeight)
{
  char strDisplay[1000];
  sprintf(strDisplay, "surface size:(%d/%d)   params:(%d/%d)", surfaceWidth, surfaceHeight,  device->CreationParams.WindowSize.Width, device->CreationParams.WindowSize.Height );
  os::Printer::log(strDisplay);
 
output:
I/Irrlicht( 2908): Android command APP_CMD_GAINED_FOCUS
I/Irrlicht( 2908): surface size:(240/320) params:(1/1)
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

Hmmm... 240/320 is still wrong resolution. Can you check when 'ANativeWindow_getWidth(app->window)' and 'ANativeWindow_getHeight(app->window)' return correct values?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
mikkis
Posts: 64
Joined: Mon Jan 28, 2013 2:38 pm
Location: Fi

Re: Android Port

Post by mikkis »

It shows it like that (so after createDeviceEx() values are correct (I checked my phone's wiki and it tells that 240/320 is the right resolution)):
I/Irrlicht( 2908): Android command APP_CMD_GAINED_FOCUS
I/Irrlicht( 2908): surface size:(240/320)params:(1/1)
I/Irrlicht( 2908): Window size:(240/320)
I/Irrlicht( 2908): Display size:(240/320)
Nyx Erebos
Posts: 33
Joined: Fri Mar 01, 2013 1:26 am

Re: Android Port

Post by Nyx Erebos »

EDIT : ok forget everything I said, I'm stupid, I was trying the regular helloworld, I didn't see the android version...
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Android Port

Post by BinMa »

Nadro wrote:This branch works with iOS, just go to source/Irrlicht/iOS and open project file in XCode. You can build example no. 17 via this project. Anyway if you want use this branch for iOS please update branch to rev4574. Newer revisions doesn't work properly on SDL, iOS and OSX (other devices like a Windows, Linux X11 and Android works properly in the latest rev). It will be fixed in near future (code related to EAGL). At this time please don't look too much at OGL problems related to this branch, because in short time OGL code will be totally changed here (we're working on unified structure for all OGL versions).
@Nadro, Has the "EAGL" stuff been resolved now?Or does latest branch work both on Android and IOS? :P
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

The latest branch works on both iOS and Android, but EAGL code isn't exposed yet outside CIrrDeviceIPhone files.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Android Port

Post by BinMa »

I'm now fit the game to various devices. When running on Nexus5(Android 4.4.2), the view seems to be not properly rendered.
like this
Image

the log is
03-07 21:56:04.422 I/dalvikvm( 8168): Enabling JNI app bug workarounds for target SDK version 9...
03-07 21:56:04.492 D/dalvikvm( 8168): Trying to load lib /data/app-lib/cn.garymb.ygomobile-2/libYGOMobile.so 0x42824f38
03-07 21:56:04.502 D/dalvikvm( 8168): Added shared lib /data/app-lib/cn.garymb.ygomobile-2/libYGOMobile.so 0x42824f38
03-07 21:56:04.552 V/threaded_app( 8168): Creating: 0x75496f40
03-07 21:56:04.552 V/threaded_app( 8168): Config: mcc=460 mnc=1 lang=zh cnt=CN orien=2 touch=3 dens=480 keys=1 nav=1 keysHid=3 navHid=0 sdk=19 size=2 long=1 modetype=1 modenight=1
03-07 21:56:04.552 I/Irrlicht( 8168): Irrlicht Engine version 1.9.0
03-07 21:56:04.562 I/Irrlicht( 8168): Waiting for Android activity window to be created.
03-07 21:56:04.582 D/dalvikvm( 8168): GC_CONCURRENT freed 203K, 2% free 16991K/17228K, paused 1ms+0ms, total 15ms
03-07 21:56:04.612 D/dalvikvm( 8168): GC_FOR_ALLOC freed 9K, 2% free 17213K/17444K, paused 18ms, total 18ms
03-07 21:56:04.622 I/dalvikvm-heap( 8168): Grow heap (frag case) to 18.815MB for 2073616-byte allocation
03-07 21:56:04.632 D/dalvikvm( 8168): GC_FOR_ALLOC freed <1K, 2% free 19237K/19472K, paused 10ms, total 10ms
03-07 21:56:04.632 D/dalvikvm( 8168): GC_CONCURRENT freed <1K, 2% free 19236K/19472K, paused 2ms+1ms, total 9ms
03-07 21:56:04.642 V/threaded_app( 8168): Start: 0x75496f40
03-07 21:56:04.642 V/threaded_app( 8168): activityState=10
03-07 21:56:04.642 V/threaded_app( 8168): Resume: 0x75496f40
03-07 21:56:04.642 V/threaded_app( 8168): activityState=11
03-07 21:56:04.642 I/Irrlicht( 8168): Android command APP_CMD_RESUME
03-07 21:56:04.642 V/threaded_app( 8168): InputQueueCreated: 0x75496f40 -- 0x755f76b8
03-07 21:56:04.642 V/threaded_app( 8168): APP_CMD_INPUT_CHANGED
03-07 21:56:04.642 V/threaded_app( 8168): Attaching input queue to looper
03-07 21:56:04.672 V/threaded_app( 8168): NativeWindowCreated: 0x75496f40 -- 0x755eb958
03-07 21:56:04.672 V/threaded_app( 8168): APP_CMD_INIT_WINDOW
03-07 21:56:04.672 I/Irrlicht( 8168): Android command APP_CMD_INIT_WINDOW
03-07 21:56:04.672 I/Irrlicht( 8168): init window: width = 1794, height = 1080
03-07 21:56:04.672 I/Adreno-EGL( 8168): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13
03-07 21:56:04.672 V/threaded_app( 8168): WindowFocusChanged: 0x75496f40 -- 1
03-07 21:56:04.672 I/Irrlicht( 8168): EGL version: 1.400000
03-07 21:56:04.722 I/Irrlicht( 8168): Using renderer: OpenGL ES-CM 1.1
03-07 21:56:04.722 I/Irrlicht( 8168): Qualcomm
03-07 21:56:04.722 I/Irrlicht( 8168): GL_EXT_debug_marker 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
03-07 21:56:04.722 E/Adreno-ES11( 8168): <qglDrvAPI_glTexParameterfv:75>: GL_INVALID_ENUM
03-07 21:56:04.722 I/Irrlicht( 8168): GL_INVALID_ENUM
03-07 21:56:04.722 I/Irrlicht( 8168): Could not bind Texture
03-07 21:56:04.722 I/Irrlicht( 8168): Android command APP_CMD_GAINED_FOCUS
03-07 21:56:04.722 I/Irrlicht( 8168): focus window: width = 1794, height = 1080
03-07 21:56:04.732 I/Irrlicht( 8168): xScale = 1.751953, yScale = 1.687500
03-07 21:56:04.732 I/Irrlicht( 8168):
03-07 21:56:04.732 I/Irrlicht( 8168): /storage/emulated/0/ygocore/
03-07 21:56:04.742 I/Irrlicht( 8168): Loaded texture: textures/cover.jpg
03-07 21:56:04.742 I/Irrlicht( 8168): Loaded texture: textures/unknown.jpg
03-07 21:56:04.752 I/Irrlicht( 8168): Loaded texture: textures/act.png
03-07 21:56:04.752 I/Irrlicht( 8168): Loaded texture: textures/attack.png
03-07 21:56:04.752 I/Irrlicht( 8168): Loaded texture: textures/chain.png
03-07 21:56:04.762 I/Irrlicht( 8168): Loaded texture: textures/negated.png
03-07 21:56:04.772 I/Irrlicht( 8168): Loaded texture: textures/number.png
03-07 21:56:04.772 I/Irrlicht( 8168): Loaded texture: textures/lp.png
03-07 21:56:04.782 I/Irrlicht( 8168): Loaded texture: textures/lpf.png
03-07 21:56:04.792 I/Irrlicht( 8168): Loaded texture: textures/mask.png
03-07 21:56:04.792 I/Irrlicht( 8168): PNG warning: iCCP: known incorrect sRGB profile
03-07 21:56:04.792 I/Irrlicht( 8168): PNG warning: iCCP: cHRM chunk does not match sRGB
03-07 21:56:04.792 I/Irrlicht( 8168): Loaded texture: textures/equip.png
03-07 21:56:04.792 I/Irrlicht( 8168): PNG warning: iCCP: known incorrect sRGB profile
03-07 21:56:04.792 I/Irrlicht( 8168): PNG warning: iCCP: cHRM chunk does not match sRGB
03-07 21:56:04.792 I/Irrlicht( 8168): Loaded texture: textures/target.png
03-07 21:56:04.792 I/Irrlicht( 8168): Loaded texture: textures/lim.png
03-07 21:56:04.802 I/Irrlicht( 8168): Loaded texture: textures/f1.jpg
03-07 21:56:04.802 I/Irrlicht( 8168): Loaded texture: textures/f2.jpg
03-07 21:56:04.812 I/Irrlicht( 8168): Loaded texture: textures/f3.jpg
03-07 21:56:04.852 I/Irrlicht( 8168): Loaded texture: textures/bg.jpg
03-07 21:56:04.862 I/Irrlicht( 8168): Loaded texture: textures/field.png
03-07 21:56:05.362 E/Adreno-ES11( 8168): <qglDrvAPI_glTexParameterfv:75>: GL_INVALID_ENUM
03-07 21:56:05.372 I/Irrlicht( 8168): GL_INVALID_ENUM
03-07 21:56:05.372 I/Irrlicht( 8168): Could not bind Texture
03-07 21:56:05.392 E/Adreno-ES11( 8168): <qglDrvAPI_glTexParameterfv:75>: GL_INVALID_ENUM
Can anyone find any clue?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

03-07 21:56:05.362 E/Adreno-ES11( 8168): <qglDrvAPI_glTexParameterfv:75>: GL_INVALID_ENUM
03-07 21:56:05.372 I/Irrlicht( 8168): GL_INVALID_ENUM
03-07 21:56:05.372 I/Irrlicht( 8168): Could not bind Texture
Can you check when it's generated? Please test this app also with OpenGL ES2.0 driver.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Android Port

Post by BinMa »

I do not have that device, its from one of our testers, the same error is reported on SamSung Galaxy Note3(Android4.4)
I doubt that it may related to Android4.4.

GLES2.0 driver works poorly on My own Galaxy Nexus(Android4.2.1) with all the textures just showing black and rather low fps. I will send the GLES2.0 verison app to the tester to see if it works on Android4.4.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

Does HelloWorld for Android work fine on these devices? I didn't notice any graphical issues on Galaxy Note 3 (for both OGL ES2.0 and unreleased OGL ES3.0 drivers). Poor performance in OGL ES2.0 is related to ubershader for emulation fixed pipeline.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Android Port

Post by BinMa »

OK, I just got a Feedback from Galaxy Note3, OGL ES2.0 version works fine, so I need to release 2 different kind of version, OGLES2.0 verison for Andoird 4.4 and OGLES1.0 for the rest devices ?
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: Android Port

Post by Nadro »

No, OGL ES1.x will be fixed (if it's not a bug with a driver), hovewer for the best performance you should use OGL ES2.0 driver with custom shaders. More than 95% of phones in today's market support OGL ES2.0. Only really old devices doesn't support ES2.0.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
BinMa
Posts: 19
Joined: Wed Feb 19, 2014 8:59 am

Re: Android Port

Post by BinMa »

I guess that My own phone would be the “really old device” LOL.
According to the feedback from the beta test, the performance various a lot on different phones, thus it seems that performance is not directly related one phone's hardware specs. I think the performance may really be related to the compatibility of GLES2.0 driver?
Post Reply