godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.47k stars 21.27k forks source link

GLES2 Android - black screen - no 2D nor 3D content visible #22585

Closed avril-gh closed 6 years ago

avril-gh commented 6 years ago

Godot version Godot 3.1 master branch 80d6bb7 at 2018-10-01

OS/device including version Tested on Android 4.4.2 - MTK6592 - 1GB - GPU Mali 450 MP4 700Mhz - GL2.0 Android 4.4.2 - BCM23550 - 1GB - GPU VideoCore IV - GL2.0

GL_ARM_mali_program_binary
GL_ARM_mali_shader_binary
GL_ARM_rgba8
GL_EXT_blend_minmax
GL_EXT_debug_marker
GL_EXT_discard_framebuffer
GL_EXT_multisampled_render_to_texture
GL_EXT_robustness
GL_EXT_shader_texture_lod
GL_EXT_texture_format_BGRA8888
GL_KHR_debug
GL_OES_EGL_image
GL_OES_EGL_image_external
GL_OES_EGL_sync
GL_OES_compressed_ETC1_RGB8_texture
GL_OES_depth24
GL_OES_depth_texture
GL_OES_depth_texture_cube_map
GL_OES_get_program_binary
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_npot
GL_OES_vertex_half_float

Issue

  1. export for android and run on android device.
  2. one can see app is starting, (splash screen with godot logo is visible)
  3. after godot splash screen vanishes, there is black screen. No 3D and no 2D content are visible.
  4. app does not crash, and seems to continue working like this (with black screen)

Errors shown on Mali 450 MP2 Device

W 0:00:00:0955   Could not create framebuffer!!
  <C Source>     drivers\gles2\rasterizer_storage_gles2.cpp:3935 @ _render_target_allocate()

Errors shown on VideoCoreIV Device

E 0:00:00:0936   Directional shadow framebuffer status invalid
  <C Source>     drivers\gles2\rasterizer_scene_gles2.cpp:3032 @ initialize()
W 0:00:02:0460   Could not create framebuffer!!
  <C Source>     drivers\gles2\rasterizer_storage_gles2.cpp:3935 @ _render_target_allocate()
E 0:00:05:0275   CubemapFilterShaderGLES2: Program linking failed:
ERROR:CUSTOM-14 (line 94) Support for indexing array/vector/matrix with a non-constant is not mandated in the fragment shader
  <C Source>     drivers\gles2\shader_gles2.cpp:196 @ _display_error_with_code()
E 0:00:05:0276   Method/Function Failed, returning: __null
  <C Source>     drivers\gles2\shader_gles2.cpp:470 @ get_current_version()
E 0:00:05:0276   Condition ' !version ' is true. returned: false
  <C Source>     drivers\gles2\shader_gles2.cpp:133 @ bind()
E 0:00:05:0320   Condition ' !version ' is true. returned: -1
  <C Source>     drivers\gles2/shader_gles2.h:524 @ _get_uniform()
E 0:00:05:0320   Condition ' !version ' is true. returned: -1
  <C Source>     drivers\gles2/shader_gles2.h:524 @ _get_uniform()

Example project g31-test-8.zip

qarmin commented 6 years ago

With same commit, my 2D game working good on Bluboo Maya with Android 6.0 ARM Mali-400.

Your example project on Bluboo Maya: screenshot_20181001-145911

avril-gh commented 6 years ago

Hmm... interesting. ...im having the same outcome on two different devices. It throw error

W 0:00:00:0859   Could not create framebuffer!!
  <C Source>     drivers\gles2\rasterizer_storage_gles2.cpp:3935 @ _render_target_allocate()

the screen is black, no 2D gui nor 3D stuff is shown, but the app is not crashing nor hangs, - it continues to work. I proved it by adding print at line 51 in camera.gd

if (ev is InputEventMouseMotion and ev.button_mask&BUTTON_MASK_LEFT):
    print("touch ", ev.relative.x)

and it prints in editor's output while touching screen... ...Ok, im going to investigate further.

muiroc commented 6 years ago

Maybe related, I'm getting those errors with GLES2/WebGL1 both Firefox and Chrome,

For the framebuffer creation failure looks like glRenderbufferStorage doesn't accept the unsized DEPTH_COMPONENT nor _DEPTH_COMPONENT24_OES, I tried forcing it back to DEPTH_COMPONENT16 in index.js and it doesnt fail

About the non-constant indexing according to Chrome its the faceUvVectors[faceID] subscript in texelCoordToVec in cubemap_filter.glsl: line 119. for example forcing it to 0 removes the error

avril-gh commented 6 years ago

This issue referred to build 80d6bb7 It has been fixed at https://github.com/godotengine/godot/commit/c24277a520acf856831ed78d4f96444290d17597 Therefore since this issue refer's to Android device's im closing this as solved.

@muiroc i assume that it might be fixed for WebExport too, but since i cant currently build for Web, please try out latest build and if the bug is still there, please open new issue about WebExport.