From ad634876b5b7d775f6d490cf7f874c6aae058a28 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 31 Mar 2015 14:58:52 -0300 Subject: [PATCH 1/6] fixes for light2d in androids that do not support read depth --- demos/2d/lights_shadows/light_shadows.scn | Bin 4293 -> 4293 bytes drivers/gles2/rasterizer_gles2.cpp | 2 + drivers/gles2/shaders/canvas.glsl | 53 ++++++++++++++-------- platform/android/detect.py | 4 +- 4 files changed, 37 insertions(+), 22 deletions(-) diff --git a/demos/2d/lights_shadows/light_shadows.scn b/demos/2d/lights_shadows/light_shadows.scn index 34781b804935c9f8474e0e8f18f975d28c194f8b..a13e31376ecd0ae4fdd3c510a45dc33fa35ea2fc 100644 GIT binary patch delta 247 zcmX@AcvNu%E2AZ^0>8o;PAh%=q;$Q4ymW>K%rXw~4Kge_nduoN4>;r*_#ZIXFclZ% zKj4&e3}~=pOiom|%utkIKiQUX5~Jz>T_Us5O%EFEWpIU z$arJ2B(ox;_GD{jd&a!U)y%gT4{r`*iDZ&wYTocOLB!!uf_Z|T11}Q;gMy|Nqk^M@ z-sF>Po*bWMBp%)zCFV3)ie1s1x#p&Vy@Q+sGjmm1Vo`z!Q1Pz}UWXc{wEVIJb|B9r up~7JSb6I9;x%;*zcL!C+{cceXZkvnPxjA|L6_^=Jf!H00btZQSSOWkVEk;cM delta 247 zcmX@AcvNu%E29O!0>8o;E-QWg;)47Vy@I^-2P|?7ybl=U7?aW;aL72+HCQv}WTt04 z;IwfJXpm=2PE@$eP?X>>*^Y4%W7On}jJm=#3}On34)Yug9p*XpIj}njJMP{r$i%_O zxO1`;vmztUWE*CCM*qn*%(obqYz}9MWRha$4CS(S5O6q@V4k4oz{|wIprC2RsNm=z zJNYD=C&z!0x+8vhnujM#u`8N0)!bA_RCG{cu1ZTRN)Q36{guJ%P{Wj#UzWhm%)nsc uee<9@d&2gS`r?A)BZ?h4EdIza3X#HN$G1grsE5=0OH diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index 05c977f3441..d2bf28a1bcf 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -9129,6 +9129,7 @@ void RasterizerGLES2::canvas_render_items(CanvasItem *p_item_list,int p_z,const canvas_shader.set_conditional(CanvasShaderGLES2::USE_MODULATE,canvas_use_modulate); canvas_shader.set_conditional(CanvasShaderGLES2::USE_DISTANCE_FIELD,false); + bool reset_modulate=false; bool prev_distance_field=false; @@ -10578,6 +10579,7 @@ void RasterizerGLES2::init() { shadow_mat_ptr = material_owner.get(shadow_material); overdraw_material = create_overdraw_debug_material(); copy_shader.set_conditional(CopyShaderGLES2::USE_8BIT_HDR,!use_fp16_fb); + canvas_shader.set_conditional(CanvasShaderGLES2::USE_DEPTH_SHADOWS,read_depth_supported); canvas_shader.set_conditional(CanvasShaderGLES2::USE_PIXEL_SNAP,GLOBAL_DEF("rasterizer/use_pixel_snap",false)); diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index bd10c495598..afa58b77415 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -299,32 +299,45 @@ LIGHT_SHADER_CODE highp float shadow_attenuation; +#ifdef USE_DEPTH_SHADOWS + +#define SHADOW_DEPTH(m_tex,m_uv) (texture2D((m_tex),(m_uv)).z) + +#else + +//#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),highp vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) ) +#define SHADOW_DEPTH(m_tex,m_uv) dot(texture2D((m_tex),(m_uv)),vec4(1.0 / (256.0 * 256.0 * 256.0),1.0 / (256.0 * 256.0),1.0 / 256.0,1) ) + +#endif + + + #ifdef SHADOW_PCF5 shadow_attenuation=0.0; - shadow_attenuation += texture2D(shadow_texture,vec2(su,sh)).z Date: Tue, 31 Mar 2015 20:26:38 +0200 Subject: [PATCH 2/6] New node will be added to root node if nothing is selected --- tools/editor/scene_tree_dock.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/editor/scene_tree_dock.cpp b/tools/editor/scene_tree_dock.cpp index 2012d966643..84b34cf1309 100644 --- a/tools/editor/scene_tree_dock.cpp +++ b/tools/editor/scene_tree_dock.cpp @@ -1059,14 +1059,15 @@ void SceneTreeDock::_create() { if (edited_scene) { - + // If root exists in edited scene parent = scene_tree->get_selected(); - ERR_FAIL_COND(!parent); - } else { + if( !parent ) + parent = edited_scene; + } else { + // If no root exist in edited scene parent = scene_root; ERR_FAIL_COND(!parent); - } Object *c = create_dialog->instance_selected(); From 7fc4059b1311afbf986f4b356bb93cd164ba829a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 31 Mar 2015 17:57:16 -0300 Subject: [PATCH 3/6] read depth fixes --- drivers/gles2/rasterizer_gles2.cpp | 75 +++++++++++++++++++++++-- drivers/gles2/rasterizer_gles2.h | 1 + platform/android/detect.py | 2 +- servers/visual/visual_server_raster.cpp | 2 +- 4 files changed, 73 insertions(+), 7 deletions(-) diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp index d2bf28a1bcf..ae5f3d8f2f7 100644 --- a/drivers/gles2/rasterizer_gles2.cpp +++ b/drivers/gles2/rasterizer_gles2.cpp @@ -8559,6 +8559,7 @@ RID RasterizerGLES2::canvas_light_shadow_buffer_create(int p_width) { #ifdef GLEW_ENABLED glDrawBuffer(GL_NONE); #endif + } else { // We'll use a RGBA texture into which we pack the depth info glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cls->size, cls->height, 0, @@ -8567,6 +8568,7 @@ RID RasterizerGLES2::canvas_light_shadow_buffer_create(int p_width) { // Attach the RGBA texture to FBO color attachment point glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, cls->depth, 0); + cls->rgba=cls->depth; // Allocate 16-bit depth buffer glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, cls->size, cls->height); @@ -8845,10 +8847,14 @@ void RasterizerGLES2::canvas_debug_viewport_shadows(CanvasLight* p_lights_with_s int h = 10; int w = viewport.width; int ofs = h; + + //print_line(" debug lights "); while(light) { + // print_line("debug light"); if (light->shadow_buffer.is_valid()) { + // print_line("sb is valid"); CanvasLightShadow * sb = canvas_light_shadow_owner.get(light->shadow_buffer); if (sb) { glActiveTexture(GL_TEXTURE0); @@ -9858,9 +9864,9 @@ void RasterizerGLES2::free(const RID& p_rid) { glDeleteFramebuffers(1,&cls->fbo); glDeleteRenderbuffers(1,&cls->rbo); glDeleteTextures(1,&cls->depth); - if (!read_depth_supported) { - glDeleteTextures(1,&cls->rgba); - } + //if (!read_depth_supported) { + // glDeleteTextures(1,&cls->rgba); + //} canvas_light_shadow_owner.free(p_rid); memdelete(cls); @@ -10366,6 +10372,62 @@ void RasterizerGLES2::_update_blur_buffer() { } #endif + + +bool RasterizerGLES2::_test_depth_shadow_buffer() { + + + int size=16; + + GLuint fbo; + GLuint rbo; + GLuint depth; + + glActiveTexture(GL_TEXTURE0); + + glGenFramebuffers(1, &fbo); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + + // Create a render buffer + glGenRenderbuffers(1, &rbo); + glBindRenderbuffer(GL_RENDERBUFFER, rbo); + + // Create a texture for storing the depth + glGenTextures(1, &depth); + glBindTexture(GL_TEXTURE_2D, depth); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + + // Remove artifact on the edges of the shadowmap + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + + + // We'll use a depth texture to store the depths in the shadow map + glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, size, size, 0, + GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); + +#ifdef GLEW_ENABLED + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); +#endif + + // Attach the depth texture to FBO depth attachment point + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, + GL_TEXTURE_2D, depth, 0); + + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + + glDeleteFramebuffers(1,&fbo); + glDeleteRenderbuffers(1,&rbo); + glDeleteTextures(1,&depth); + + return status == GL_FRAMEBUFFER_COMPLETE; + +} + void RasterizerGLES2::init() { #ifdef GLEW_ENABLED @@ -10438,7 +10500,7 @@ void RasterizerGLES2::init() { #ifdef GLEW_ENABLED - read_depth_supported=true; + pvr_supported=false; etc_supported=false; use_depth24 =true; @@ -10456,7 +10518,10 @@ void RasterizerGLES2::init() { use_anisotropic_filter=true; float_linear_supported=true; float_supported=true; - use_rgba_shadowmaps=false; + + read_depth_supported=_test_depth_shadow_buffer(); + use_rgba_shadowmaps=!read_depth_supported; + //print_line("read depth support? "+itos(read_depth_supported)); glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT,&anisotropic_level); anisotropic_level=MIN(anisotropic_level,float(GLOBAL_DEF("rasterizer/anisotropic_filter_level",4.0))); diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h index b7895ad82e3..ad18c8e7a18 100644 --- a/drivers/gles2/rasterizer_gles2.h +++ b/drivers/gles2/rasterizer_gles2.h @@ -1288,6 +1288,7 @@ class RasterizerGLES2 : public Rasterizer { void _copy_screen_quad(); void _copy_to_texscreen(); + bool _test_depth_shadow_buffer(); Vector3 chunk_vertex; Vector3 chunk_normal; diff --git a/platform/android/detect.py b/platform/android/detect.py index 86743fc3704..5ef405f7b66 100644 --- a/platform/android/detect.py +++ b/platform/android/detect.py @@ -24,7 +24,7 @@ def get_opts(): ('NDK_TOOLCHAIN', 'toolchain to use for the NDK',"arm-eabi-4.4.0"), #android 2.3 ('ndk_platform', 'compile for platform: (2.2,2.3)',"2.2"), - ('NDK_TARGET', 'toolchain to use for the NDK',"arm-linux-androideabi-4.9"), + ('NDK_TARGET', 'toolchain to use for the NDK',"arm-linux-androideabi-4.8"), ('android_stl','enable STL support in android port (for modules)','no'), ('armv6','compile for older phones running arm v6 (instead of v7+neon+smp)','no'), ('x86','Xompile for Android-x86','no') diff --git a/servers/visual/visual_server_raster.cpp b/servers/visual/visual_server_raster.cpp index 83bfbbc6c30..916316a0e24 100644 --- a/servers/visual/visual_server_raster.cpp +++ b/servers/visual/visual_server_raster.cpp @@ -7155,7 +7155,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ } - //rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); +// rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); } //capture From 3920c497b3811b3c0c970631599c13025c81ff14 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 31 Mar 2015 19:02:40 -0300 Subject: [PATCH 4/6] Option in Android export to use 32 bits buffer. --- demos/2d/isometric_light/export.cfg | 262 ------------------ platform/android/export/export.cpp | 13 + .../java/src/com/android/godot/Godot.java | 7 +- .../java/src/com/android/godot/GodotView.java | 18 +- 4 files changed, 32 insertions(+), 268 deletions(-) delete mode 100644 demos/2d/isometric_light/export.cfg diff --git a/demos/2d/isometric_light/export.cfg b/demos/2d/isometric_light/export.cfg deleted file mode 100644 index 578d4171b24..00000000000 --- a/demos/2d/isometric_light/export.cfg +++ /dev/null @@ -1,262 +0,0 @@ -[convert_images] - -action="none" -compress_quality=0.7 -formats="png" -shrink=1 - -[export_filter] - -filter="" -type="resources" - -[image_group_files] - -files=["res://faceNormal.png", "normal", "res://faceColor.png", "normal", "res://faceMask.png", "normal"] - -[image_groups] - -normal={"atlas":false, "action":"compress_ram", "shrink":1, "lossy_quality":0.7} - -[platform:Android] - -apk_expansion/SALT="" -apk_expansion/enable=false -apk_expansion/public_key="" -command_line/extra_args="" -custom_package/debug="" -custom_package/release="" -keystore/release="" -keystore/release_password="" -keystore/release_user="" -one_click_deploy/clear_previous_install=true -package/icon="" -package/name="" -package/signed=true -package/unique_name="com.android.noname" -permissions/access_checkin_properties=false -permissions/access_coarse_location=false -permissions/access_fine_location=false -permissions/access_location_extra_commands=false -permissions/access_mock_location=false -permissions/access_network_state=false -permissions/access_surface_flinger=false -permissions/access_wifi_state=false -permissions/account_manager=false -permissions/add_voicemail=false -permissions/authenticate_accounts=false -permissions/battery_stats=false -permissions/bind_accessibility_service=false -permissions/bind_appwidget=false -permissions/bind_device_admin=false -permissions/bind_input_method=false -permissions/bind_nfc_service=false -permissions/bind_notification_listener_service=false -permissions/bind_print_service=false -permissions/bind_remoteviews=false -permissions/bind_text_service=false -permissions/bind_vpn_service=false -permissions/bind_wallpaper=false -permissions/bluetooth=false -permissions/bluetooth_admin=false -permissions/bluetooth_privileged=false -permissions/brick=false -permissions/broadcast_package_removed=false -permissions/broadcast_sms=false -permissions/broadcast_sticky=false -permissions/broadcast_wap_push=false -permissions/call_phone=false -permissions/call_privileged=false -permissions/camera=false -permissions/capture_audio_output=false -permissions/capture_secure_video_output=false -permissions/capture_video_output=false -permissions/change_component_enabled_state=false -permissions/change_configuration=false -permissions/change_network_state=false -permissions/change_wifi_multicast_state=false -permissions/change_wifi_state=false -permissions/clear_app_cache=false -permissions/clear_app_user_data=false -permissions/control_location_updates=false -permissions/delete_cache_files=false -permissions/delete_packages=false -permissions/device_power=false -permissions/diagnostic=false -permissions/disable_keyguard=false -permissions/dump=false -permissions/expand_status_bar=false -permissions/factory_test=false -permissions/flashlight=false -permissions/force_back=false -permissions/get_accounts=false -permissions/get_package_size=false -permissions/get_tasks=false -permissions/get_top_activity_info=false -permissions/global_search=false -permissions/hardware_test=false -permissions/inject_events=false -permissions/install_location_provider=false -permissions/install_packages=false -permissions/install_shortcut=false -permissions/internal_system_window=false -permissions/internet=false -permissions/kill_background_processes=false -permissions/location_hardware=false -permissions/manage_accounts=false -permissions/manage_app_tokens=false -permissions/manage_documents=false -permissions/master_clear=false -permissions/media_content_control=false -permissions/modify_audio_settings=false -permissions/modify_phone_state=false -permissions/mount_format_filesystems=false -permissions/mount_unmount_filesystems=false -permissions/nfc=false -permissions/persistent_activity=false -permissions/process_outgoing_calls=false -permissions/read_calendar=false -permissions/read_call_log=false -permissions/read_contacts=false -permissions/read_external_storage=false -permissions/read_frame_buffer=false -permissions/read_history_bookmarks=false -permissions/read_input_state=false -permissions/read_logs=false -permissions/read_phone_state=false -permissions/read_profile=false -permissions/read_sms=false -permissions/read_social_stream=false -permissions/read_sync_settings=false -permissions/read_sync_stats=false -permissions/read_user_dictionary=false -permissions/reboot=false -permissions/receive_boot_completed=false -permissions/receive_mms=false -permissions/receive_sms=false -permissions/receive_wap_push=false -permissions/record_audio=false -permissions/reorder_tasks=false -permissions/restart_packages=false -permissions/send_respond_via_message=false -permissions/send_sms=false -permissions/set_activity_watcher=false -permissions/set_alarm=false -permissions/set_always_finish=false -permissions/set_animation_scale=false -permissions/set_debug_app=false -permissions/set_orientation=false -permissions/set_pointer_speed=false -permissions/set_preferred_applications=false -permissions/set_process_limit=false -permissions/set_time=false -permissions/set_time_zone=false -permissions/set_wallpaper=false -permissions/set_wallpaper_hints=false -permissions/signal_persistent_processes=false -permissions/status_bar=false -permissions/subscribed_feeds_read=false -permissions/subscribed_feeds_write=false -permissions/system_alert_window=false -permissions/transmit_ir=false -permissions/uninstall_shortcut=false -permissions/update_device_stats=false -permissions/use_credentials=false -permissions/use_sip=false -permissions/vibrate=false -permissions/wake_lock=false -permissions/write_apn_settings=false -permissions/write_calendar=false -permissions/write_call_log=false -permissions/write_contacts=false -permissions/write_external_storage=false -permissions/write_gservices=false -permissions/write_history_bookmarks=false -permissions/write_profile=false -permissions/write_secure_settings=false -permissions/write_settings=false -permissions/write_sms=false -permissions/write_social_stream=false -permissions/write_sync_settings=false -permissions/write_user_dictionary=false -screen/orientation=0 -screen/support_large=true -screen/support_normal=true -screen/support_small=true -screen/support_xlarge=true -user_permissions/0="" -user_permissions/1="" -user_permissions/10="" -user_permissions/11="" -user_permissions/12="" -user_permissions/13="" -user_permissions/14="" -user_permissions/15="" -user_permissions/16="" -user_permissions/17="" -user_permissions/18="" -user_permissions/19="" -user_permissions/2="" -user_permissions/3="" -user_permissions/4="" -user_permissions/5="" -user_permissions/6="" -user_permissions/7="" -user_permissions/8="" -user_permissions/9="" -version/code=1 -version/name="1.0" - -[platform:BlackBerry 10] - -package/category="core.games" -package/custom_template="" -package/description="Game made with Godot Engine" -package/icon="" -package/name="" -package/unique_name="com.godot.noname" -release/author="Cert. Name" -release/author_id="Cert. ID" -version/code=1 -version/name="1.0" - -[platform:HTML5] - -browser/enable_run=false -custom_package/debug="" -custom_package/release="" -options/memory_size=3 - -[platform:Linux X11] - -binary/64_bits=true -custom_binary/debug="" -custom_binary/release="" -resources/pack_mode=1 - -[platform:Mac OSX] - -application/64_bits=false -application/copyright="" -application/icon="" -application/identifier="com.godot.macgame" -application/info="This Game is Nice" -application/name="" -application/short_version="1.0" -application/signature="godotmacgame" -application/version="1.0" -custom_package/debug="" -custom_package/release="" -display/high_res=false - -[platform:Windows Desktop] - -binary/64_bits=true -custom_binary/debug="" -custom_binary/release="" -resources/pack_mode=1 - -[script] - -action="compile" -encrypt_key="" diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index 3e4ea8a4e0f..18747734abf 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -185,6 +185,7 @@ class EditorExportPlatformAndroid : public EditorExportPlatform { bool _signed; bool apk_expansion; bool remove_prev; + bool use_32_fb; String apk_expansion_salt; String apk_expansion_pkey; int orientation; @@ -279,6 +280,8 @@ bool EditorExportPlatformAndroid::_set(const StringName& p_name, const Variant& icon=p_value; else if (n=="package/signed") _signed=p_value; + else if (n=="screen/use_32_bits_view") + use_32_fb=p_value; else if (n=="screen/orientation") orientation=p_value; else if (n=="screen/support_small") @@ -344,6 +347,8 @@ bool EditorExportPlatformAndroid::_get(const StringName& p_name,Variant &r_ret) r_ret=icon; else if (n=="package/signed") r_ret=_signed; + else if (n=="screen/use_32_bits_view") + r_ret=use_32_fb; else if (n=="screen/orientation") r_ret=orientation; else if (n=="screen/support_small") @@ -393,6 +398,7 @@ void EditorExportPlatformAndroid::_get_property_list( List *p_list p_list->push_back( PropertyInfo( Variant::STRING, "package/name") ); p_list->push_back( PropertyInfo( Variant::STRING, "package/icon",PROPERTY_HINT_FILE,"png") ); p_list->push_back( PropertyInfo( Variant::BOOL, "package/signed") ); + p_list->push_back( PropertyInfo( Variant::BOOL, "screen/use_32_bits_view") ); p_list->push_back( PropertyInfo( Variant::INT, "screen/orientation",PROPERTY_HINT_ENUM,"Landscape,Portrait") ); p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_small") ); p_list->push_back( PropertyInfo( Variant::BOOL, "screen/support_normal") ); @@ -1158,8 +1164,14 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d err = export_project_files(save_apk_file,&ed,false); } + + } + if (use_32_fb) + cl.push_back("-use_depth_32"); + + if (cl.size()) { //add comandline Vector clf; @@ -1534,6 +1546,7 @@ EditorExportPlatformAndroid::EditorExportPlatformAndroid() { quit_request=false; orientation=0; remove_prev=true; + use_32_fb=false; device_thread=Thread::create(_device_poll_thread,this); devices_changed=true; diff --git a/platform/android/java/src/com/android/godot/Godot.java b/platform/android/java/src/com/android/godot/Godot.java index 1a7659a473a..1fd37c98cda 100644 --- a/platform/android/java/src/com/android/godot/Godot.java +++ b/platform/android/java/src/com/android/godot/Godot.java @@ -109,6 +109,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC private Button mPauseButton; private Button mWiFiSettingsButton; + private boolean use_32_bits=false; private boolean mStatePaused; private int mState; @@ -255,7 +256,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC // ...add to FrameLayout layout.addView(edittext); - mView = new GodotView(getApplication(),io,use_gl2, this); + mView = new GodotView(getApplication(),io,use_gl2,use_32_bits, this); layout.addView(mView,new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT)); mView.setKeepScreenOn(true); @@ -399,7 +400,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC for(int i=0;i Date: Wed, 1 Apr 2015 12:23:13 -0300 Subject: [PATCH 5/6] fix shadow attenuation --- drivers/gles2/shaders/canvas.glsl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gles2/shaders/canvas.glsl b/drivers/gles2/shaders/canvas.glsl index afa58b77415..12ff43479bf 100644 --- a/drivers/gles2/shaders/canvas.glsl +++ b/drivers/gles2/shaders/canvas.glsl @@ -297,7 +297,7 @@ LIGHT_SHADER_CODE su=s.x*0.5+0.5; sz=s.z*0.5+0.5; - highp float shadow_attenuation; + highp float shadow_attenuation=0.0; #ifdef USE_DEPTH_SHADOWS @@ -314,7 +314,6 @@ LIGHT_SHADER_CODE #ifdef SHADOW_PCF5 - shadow_attenuation=0.0; shadow_attenuation += SHADOW_DEPTH(shadow_texture,vec2(su,sh)) Date: Wed, 1 Apr 2015 12:39:54 -0300 Subject: [PATCH 6/6] solved color depth issues on osx --- platform/osx/os_osx.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 55ef6c15167..5556a71918d 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -903,7 +903,7 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi unsigned int attributeCount = 0; // OS X needs non-zero color size, so set resonable values - int colorBits = 24; + int colorBits = 32; // Fail if a robustness strategy was requested