Page 1 of 1

opengl-es 2.0 problem

Posted: Fri Sep 28, 2012 6:53 am
by hongjunyu128
hi,i have downloaded the Irrlicht Engine version 1.8.0-alpha form SVN/branches/ogl-es.
i try to run example No.8 with opengl-es 1.0 on Android 4.0,it looks well.
but i try to run it with opengl-es 2.0,it does not work.
i just edit main.cpp "video::E_DRIVER_TYPE driverType=video::EDT_OGLES1;" to "video::E_DRIVER_TYPE driverType=video::EDT_OGLES2;"
the other files are the same content.

here is the logcat:

Code: Select all

09-28 14:35:26.752: W/ActivityThread(1685): Application com.irrlicht.SFX is waiting for the debugger on port 8100...
09-28 14:35:26.812: I/System.out(1685): Sending WAIT chunk
09-28 14:35:26.812: I/dalvikvm(1685): Debugger is active
09-28 14:35:27.022: I/System.out(1685): Debugger has connected
09-28 14:35:27.022: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:27.232: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:27.442: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:27.652: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:27.862: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:28.072: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:28.282: I/System.out(1685): waiting for debugger to settle...
09-28 14:35:28.492: I/System.out(1685): debugger has settled (1441)
09-28 14:35:28.562: I/threaded_app(1685): Creating: 0x166828
09-28 14:35:28.562: I/threaded_app(1685): Config: mcc=0 mnc=0 lang=zh cnt=CN orien=2 touch=3 dens=120 keys=1 nav=1 keysHid=3 navHid=0 sdk=15 size=3 long=1 modetype=1 modenight=1
09-28 14:35:28.562: I/threaded_app(1685): Start: 0x166828
09-28 14:35:28.562: I/Irrlicht(1685): 1
09-28 14:35:28.562: E/Irrlicht(1685): Irrlicht Engine version 1.8.0-alpha
09-28 14:35:28.562: E/Irrlicht(1685): CIrrDeviceAndroid::CIrrDeviceAndroid
09-28 14:35:28.562: E/Irrlicht(1685): Waiting for Android activity window to be created.
09-28 14:35:28.562: I/threaded_app(1685): activityState=10
09-28 14:35:28.572: E/Irrlicht(1685): Unhandled android command: 10
09-28 14:35:28.582: I/threaded_app(1685): Resume: 0x166828
09-28 14:35:28.582: I/threaded_app(1685): activityState=11
09-28 14:35:28.592: E/Irrlicht(1685): Android command APP_CMD_RESUME
09-28 14:35:28.602: I/threaded_app(1685): InputQueueCreated: 0x166828 -- 0x1ab628
09-28 14:35:28.602: I/threaded_app(1685): APP_CMD_INPUT_CHANGED
09-28 14:35:28.602: I/threaded_app(1685): Attaching input queue to looper
09-28 14:35:28.622: I/threaded_app(1685): NativeWindowCreated: 0x166828 -- 0x1f0b58
09-28 14:35:28.622: E/Irrlicht(1685): Unhandled android command: 0
09-28 14:35:28.622: I/threaded_app(1685): APP_CMD_INIT_WINDOW
09-28 14:35:28.632: E/Irrlicht(1685): Android command APP_CMD_INIT_WINDOW
09-28 14:35:28.632: E/Irrlicht(1685): CIrrDeviceAndroid::createDriver
09-28 14:35:28.632: E/Irrlicht(1685): Getting OpenGL-ES2 display.
09-28 14:35:28.632: D/libEGL(1685): loaded /system/lib/egl/libGLES_android.so
09-28 14:35:28.662: I/threaded_app(1685): WindowFocusChanged: 0x166828 -- 1
09-28 14:35:28.702: D/libEGL(1685): loaded /system/lib/egl/libEGL_mali.so
09-28 14:35:28.722: D/libEGL(1685): loaded /system/lib/egl/libGLESv1_CM_mali.so
09-28 14:35:28.732: D/libEGL(1685): loaded /system/lib/egl/libGLESv2_mali.so
09-28 14:35:28.732: E/Irrlicht(1685): EglDisplay initialized. Egl version 1.4
09-28 14:35:28.732: E/Irrlicht(1685):  Creating EglSurface with nativeWindow...
09-28 14:35:28.732: A/libc(1685): Fatal signal 11 (SIGSEGV) at 0x00000058 (code=1)
Android.mk:

Code: Select all

LOCAL_PATH := $(call my-dir)
 
include $(CLEAR_VARS)   
LOCAL_MODULE    := IrrAndroid  
LOCAL_SRC_FILES := libIrrAndroid.a   
include $(PREBUILT_STATIC_LIBRARY)
 
include $(CLEAR_VARS)
 
LOCAL_MODULE    := SFX
LOCAL_SRC_FILES := main.cpp
LOCAL_LDLIBS := -landroid -lEGL -llog -lGLESv1_CM -lGLESv2
LOCAL_CFLAGS := -DBUILD_OGLES2 -g -D_DEBUG
#LOCAL_SHARED_LIBRARIES :=IrrAndroid
LOCAL_STATIC_LIBRARIES :=android_native_app_glue    \
                        IrrAndroid
                                                    
LOCAL_C_INCLUDES := D:/Irrlicht_18/include  \
                    D:/Irrlicht_18/source/Irrlicht  \
                    
include $(BUILD_SHARED_LIBRARY)
$(call import-module,android/native_app_glue)
Application.mk

Code: Select all

APP_MODULES := SFX
APP_PLATFORM :=android-9
AndroidManifest.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.irrlicht.SFX"
        android:versionCode="1"
        android:versionName="1.0">
 
    <!-- This is the platform API where NativeActivity was introduced. -->
    <uses-sdk android:minSdkVersion="7" />
    
    <!-- This .apk has no Java code itself, so set hasCode to false. -->
    <application android:label="@string/app_name" android:hasCode="false">
 
        <!-- Our activity is the built-in NativeActivity framework class.
             This will take care of integrating with our NDK code. -->
        <activity android:name="android.app.NativeActivity"
                android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 
                android:launchMode="singleTask"
                android:label="@string/app_name"
                android:configChanges="orientation|keyboardHidden"
                android:screenOrientation="landscape" 
                android:clearTaskOnLaunch="true">
            <!-- Tell NativeActivity the name of or .so -->
            <meta-data android:name="android.app.lib_name"
                    android:value="SFX" />
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    
   <uses-feature android:glEsVersion="0x00020000"/>
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest> 
<!-- END_INCLUDE(manifest) -->
where am i wrong?Can anybody help me?thanks a lot *^__^*

Re: opengl-es 2.0 problem

Posted: Fri Sep 28, 2012 2:44 pm
by Nadro
Android port is still under development (eg. require some code clean-up). Currently only OGL ES1 works, OGL ES2 require improved many things. I think that context creation phase is bugged in OGL ES2 for Android, but I'll have to check it.

Re: opengl-es 2.0 problem

Posted: Sat Sep 29, 2012 2:52 am
by hongjunyu128
Nadro wrote:Android port is still under development (eg. require some code clean-up). Currently only OGL ES1 works, OGL ES2 require improved many things. I think that context creation phase is bugged in OGL ES2 for Android, but I'll have to check it.
How about Irrlicht Engine version 1.7.0-beta?I have tried to run example No.1 HelloWorld with opengl-es 2.0 under Irrlicht Engine version 1.7.0-beta.
It works,but it only draw model,the texture of model is all white.I check the logcat,something looks like wrong~
When i create device with opengl-es 2.0,logcat shows that only have loaded the .vsh files and .fsh files have not loaded.
I think it may be the .fsh files problem,the .fsh files should draw the texture of model.
I have no idea why the .fsh files is not loaded,Do you have some advices?

Here is the logcat:

Code: Select all

09-29 10:15:56.728: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:56.938: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:57.148: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:57.358: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:57.568: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:57.778: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:57.988: I/System.out(1087): waiting for debugger to settle...
09-29 10:15:58.198: I/System.out(1087): debugger has settled (1495)
09-29 10:15:58.218: D/dalvikvm(1087): Trying to load lib /data/data/com.tenone.irrlicht/lib/libirrlicht.so 0x40f55000
09-29 10:15:58.238: D/dalvikvm(1087): Added shared lib /data/data/com.tenone.irrlicht/lib/libirrlicht.so 0x40f55000
09-29 10:15:58.238: D/dalvikvm(1087): No JNI_OnLoad found in /data/data/com.tenone.irrlicht/lib/libirrlicht.so 0x40f55000, skipping init
09-29 10:15:58.248: D/dalvikvm(1087): Trying to load lib /data/data/com.tenone.irrlicht/lib/libirrlichtSample.so 0x40f55000
09-29 10:15:58.248: D/dalvikvm(1087): Added shared lib /data/data/com.tenone.irrlicht/lib/libirrlichtSample.so 0x40f55000
09-29 10:15:58.248: D/dalvikvm(1087): No JNI_OnLoad found in /data/data/com.tenone.irrlicht/lib/libirrlichtSample.so 0x40f55000, skipping init
09-29 10:15:58.318: I/Irrlicht(1087): not handled /mnt/sdcard
09-29 10:15:58.328: D/SurfaceView(1087): pckname = com.tenone.irrlicht
09-29 10:15:58.428: V/TabletStatusBar(210): setLightsOn(true)
09-29 10:15:58.438: D/libEGL(1087): loaded /system/lib/egl/libGLES_android.so
09-29 10:15:58.438: D/libEGL(1087): loaded /system/lib/egl/libEGL_mali.so
09-29 10:15:58.458: D/libEGL(1087): loaded /system/lib/egl/libGLESv1_CM_mali.so
09-29 10:15:58.498: I/ActivityManager(142): Displayed com.tenone.irrlicht/.Quake3Map: +2s131ms
09-29 10:15:58.518: D/libEGL(1087): loaded /system/lib/egl/libGLESv2_mali.so
09-29 10:15:58.558: I/log(1087): Irrlicht Engine version 1.7.0-beta
09-29 10:15:58.558: I/Irrlicht(1087): CIrrDeviceAndroid::CIrrDeviceAndroid
09-29 10:15:58.558: I/Irrlicht(1087): CIrrDeviceAndroid::createDriver
09-29 10:15:58.558: I/log(1087): OpenGL-ES2 initialized
09-29 10:15:58.558: I/Irrlicht(1087): OGLES2 initialized
09-29 10:15:58.558: I/log(1087): Using renderer: OpenGL ES 2.0
09-29 10:15:58.558: I/log(1087): ARM
09-29 10:15:58.558: I/log(1087): GL_OES_texture_npot GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture 
09-29 10:15:58.558: I/log(1087): load shader: /mnt/sdcard/Irrlicht/COGLES2FixedPipeline.vsh
09-29 10:15:58.558: I/log(1087): Loading shader
09-29 10:15:58.648: I/log(1087): Loading shader
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.658: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): ?
09-29 10:15:58.668: I/log(1087): Shader loaded
09-29 10:15:58.668: I/log(1087): load shader: /mnt/sdcard/Irrlicht/COGLES2Renderer2D.vsh
09-29 10:15:58.668: I/log(1087): Loading shader
09-29 10:15:58.668: I/log(1087): Loading shader
09-29 10:15:58.668: I/log(1087): Shader loaded
09-29 10:15:58.668: I/log(1087): load shader: /mnt/sdcard/Irrlicht/COGLES2NormalMap.vsh
09-29 10:15:58.668: I/log(1087): Loading shader
09-29 10:15:58.688: I/log(1087): Loading shader
09-29 10:15:58.698: I/log(1087): X?*?AX?**???T0H++??T?0h0?y484I???
09-29 10:15:58.698: I/log(1087): X?*?AX?**???T0H++??T?0h0?y484I???
09-29 10:15:58.698: I/log(1087): Shader loaded
09-29 10:15:58.698: I/log(1087): load shader: /mnt/sdcard/Irrlicht/COGLES2ParallaxMap.vsh
09-29 10:15:58.698: I/log(1087): Loading shader
09-29 10:15:58.728: I/log(1087): Loading shader
09-29 10:15:58.738: I/log(1087): \@?AP??,,??P?PTX0H++??T?0h0?y484I???
09-29 10:15:58.738: I/log(1087): \@?AP??,,??P?PTX0H++??T?0h0?y484I???
09-29 10:15:58.738: I/log(1087): \@?AP??,,??P?PTX0H++??T?0h0?y484I???
09-29 10:15:58.738: I/log(1087): Shader loaded
09-29 10:15:58.738: I/Irrlicht(1087): createDevice r=2048208 w=320 h=480
09-29 10:15:58.738: I/Irrlicht(1087): getVideoDriver r=2237448
09-29 10:15:58.748: I/Irrlicht(1087): resize w=800 h=425
09-29 10:15:59.058: I/log(1087): Loaded mesh
09-29 10:15:59.078: I/log(1087): Loaded texture
09-29 10:15:59.078: I/Irrlicht(1087): add texture
09-29 10:15:59.538: I/log(1087): Loaded texture
09-29 10:15:59.538: I/Irrlicht(1087): begin Scene
09-29 10:15:59.558: I/Irrlicht(1087): begin Scene
09-29 10:15:59.578: I/Irrlicht(1087): begin Scene

Re: opengl-es 2.0 problem

Posted: Sun Sep 30, 2012 7:46 pm
by Nadro
We don't support a v1.7.0 beta under Android, so I can't help. This is probably the unofficial port.

Re: opengl-es 2.0 problem

Posted: Mon Oct 08, 2012 5:22 am
by hongjunyu128
Nadro wrote:We don't support a v1.7.0 beta under Android, so I can't help. This is probably the unofficial port.
OK,i see~I am waiting for your update of engine~ :?

Re: opengl-es 2.0 problem

Posted: Mon Oct 08, 2012 11:44 pm
by Nadro
Fix for similar (this?) issue in our official port should be available after v1.8 will be released, so probably even in this month. Currently we have similar issue related to GLSL uniforms tables in our official port, but as I said we don't support v1.7 under Android so I can't verify that this is the same issue.

Re: opengl-es 2.0 problem

Posted: Tue Oct 09, 2012 5:09 am
by hongjunyu128
Nadro wrote:Fix for similar (this?) issue in our official port should be available after v1.8 will be released, so probably even in this month. Currently we have similar issue related to GLSL uniforms tables in our official port, but as I said we don't support v1.7 under Android so I can't verify that this is the same issue.
oh,I see.As v1.7 is not official,I may give up for v1.7 and waiting for v1.8.Thank you for your hard work.