Commit graph

1476 commits

Author SHA1 Message Date
Pedro J. Estébanez 11815a23dc Fix GLES2 automatic texture lookup in canvas
After this change the color will only be fetched if the shader code doesn't use it explicitly, to match the GLES3 behaviour.

Fixes #23179.
2018-10-28 02:37:34 +01:00
Rémi Verschelde 9de724f327
Merge pull request #23091 from aaronfranke/mingw-warnings
Fix some compile warnings for Windows from Linux
2018-10-25 15:09:11 +02:00
Rémi Verschelde b9eb3a048e GLES2: Fix shadows shader error for SpotLights
Fixes #23268.
2018-10-25 12:14:02 +02:00
Rémi Verschelde 1169196f04
Merge pull request #22779 from Superwaitsum/LimitSettings
Limit several project settings
2018-10-25 11:38:06 +02:00
Superwaitsum e5041ad0f5 Add some limits on the Editor Settings 2018-10-24 19:46:33 -05:00
Rémi Verschelde cfa8ef1f77
Merge pull request #23186 from BastiaanOlij/fix_gles2_stereo_sky
Fixed stereoscopic (VR) sky in GLES2
2018-10-24 15:16:36 +02:00
Rémi Verschelde 8a113b9143
Merge pull request #23175 from marcelofg55/input_buffer_fix
Fix possible audio input buffer issues
2018-10-24 14:59:57 +02:00
Rémi Verschelde 053da2b487 GLES2: Fix typo in tangent calculation
Thanks @tagcup for the find.

Fixes #23234.
2018-10-24 11:10:16 +02:00
Dominique LaSalle f39d14dd61 Fix gles3 shader to actually multiply specular light by rev_amount for fog calculations. 2018-10-22 21:09:34 -07:00
Bastiaan Olij ef06079ad1 Fixed stereoscopic (VR) sky in GLES2 2018-10-21 11:36:01 +11:00
Marcelo Fernandez fa26a5511d Fix possible audio input buffer issues 2018-10-20 12:13:40 -03:00
Aaron Franke dc2e73499a Fix compile warnings for Windows from Linux
At least the ones I got when I compiled it using Mingw64 POSIX on Xubuntu 18.04. Plus use the Size2 of get_window_size() directly, rather than reconstructing it.
2018-10-19 09:11:14 -04:00
Dualtagh Murray b902a2f2a7 Fixing warnings generated by MSVC
Fixes #22684.
2018-10-19 11:45:24 +02:00
Rémi Verschelde df3fe9d781
Merge pull request #22980 from CakHuri/remove-include-dupl
Removed duplication of include(s)
2018-10-16 13:01:42 +02:00
M. Huri 55c8fda884 Removed duplication of include(s):
- "collision_solver_sat.h".
- "shaders/copy.glsl.gen.h"
2018-10-13 20:25:34 +07:00
Marcelo Fernandez 5e26829118 Fixed issues with audio input on some Macs 2018-10-12 19:20:28 -03:00
Rémi Verschelde 8b56ea3138
Merge pull request #22800 from QbieShay/depth_write
Added the ability to write to gl_FragDepth.
2018-10-11 17:31:50 +02:00
Juan Linietsky 14494dddd0 Fixes to CPU particles for performance and avoiding NaNs. 2018-10-08 00:55:43 -03:00
Juan Linietsky e0871b0f52 Baker fixes 2018-10-07 11:18:44 -03:00
Fabio Alessandrelli 12124d2d44 Safer getcwd in DirAccess
Fix [-Wunused-result]
2018-10-07 14:50:14 +02:00
Fabio Alessandrelli 5393e7310d Avoid possible overflow in OS_Unix readlink
Also fix [-Wunused-result]
2018-10-07 12:56:07 +02:00
Rémi Verschelde bf6dcb9105
Merge pull request #22722 from akien-mga/fix-warnings
Fix more "may be used initialized" warnings from GCC 7
2018-10-07 11:07:13 +02:00
Rémi Verschelde 44d82b3a07
Merge pull request #22752 from aaronfranke/equals-redundant
Remove redundant "== true" and "== false" code
2018-10-07 10:58:45 +02:00
Rémi Verschelde a406bf3e68
Merge pull request #22782 from eska014/gles2-uniform-precision
Fix GLES2 uniform precision
2018-10-07 10:11:40 +02:00
Aaron Franke 4f7b33cdcf Remove redundant "== false" code
Some of this code has been re-organized.
f
2018-10-06 16:20:41 -04:00
Aaron Franke 37386f112b Remove redundant "== true" code
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-10-06 16:12:36 -04:00
QbieShay ac04e14a51 Added the ability to write to gl_FragDepth. It doesn't affect the depth prepass. 2018-10-06 19:34:50 +02:00
Leon Krause 7a4d5ddb4d Format GLES2 scene.glsl 2018-10-06 02:17:24 +02:00
Leon Krause e869d53e6d Fix GLES2 uniform precision 2018-10-06 02:15:04 +02:00
Leon Krause 5f45476dc1 Fix warnings in HTML5 build outside platform files 2018-10-06 00:08:17 +02:00
Marcelo Fernandez cb99a15064 Fix CoreMidi warnings 2018-10-04 16:23:59 -03:00
Rémi Verschelde 3e9740ac93 Fix more "may be used initialized" warnings from GCC 7
Fixes the following GCC 7 warnings:
```
core/cowdata.h:269:47: warning: 'alloc_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/error_macros.h:163:26: warning: 'nearest_point' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1579:5: warning: 'colormap_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1582:12: warning: 'size_height' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1590:23: warning: 'size_width' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/image.cpp:1599:29: warning: 'pixel_size' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:207:15: warning: 'tri_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
core/math/face3.cpp:209:15: warning: 'tri_min' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:665:22: warning: 'best_used_frame' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:865:27: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/rasterizer_storage_gles3.cpp:980:29: warning: 'blit_target' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::frag_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::id' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gles3/shader_gles3.h:122:9: warning: '<anonymous>.ShaderGLES3::Version::vert_id' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/plugins/script_editor_plugin.cpp:1980:31: warning: 'se' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/scene_tree_dock.cpp:840:30: warning: 'new_node' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'a1' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4259:9: warning: 'lul' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4260:9: warning: 'a2' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4261:9: warning: 'a3' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4265:3: warning: 'enable_lin' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4294:3: warning: 'enable_ang' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'll' may be used uninitialized in this function [-Wmaybe-uninitialized]
editor/spatial_editor_gizmos.cpp:4311:34: warning: 'ul' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1655:47: warning: 'cone_dirs' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/3d/voxel_light_baker.cpp:1656:73: warning: 'cone_weights' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cp' may be used uninitialized in this function [-Wmaybe-uninitialized]
scene/gui/texture_progress.cpp:181:6: warning: 'cq' may be used uninitialized in this function [-Wmaybe-uninitialized]
servers/physics/shape_sw.cpp:1056:19: warning: 'support_max' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-04 18:54:20 +02:00
Rémi Verschelde 97b9697ea2 Fix some OSX and iOS Clang warnings
Fixes the following XCode 9.4.1 warnings:
```
core/os/memory.cpp:175:13: warning: unused variable 's' [-Wunused-variable]
drivers/coremidi/core_midi.cpp:68:14: warning: comparison between NULL and non-pointer ('MIDIEndpointRef' (aka 'unsigned int') and NULL) [-Wnull-arithmetic]
drivers/gles2/rasterizer_gles2.cpp:77:24: warning: unused function '_gl_debug_print' [-Wunused-function,34]
drivers/unix/thread_posix.cpp:106:12: warning: unused variable 'running_thread' [-Wunused-variable,34]
modules/gdnative/nativescript/nativescript.h:371:16: warning: in-class initialization of non-static data member is a C++11 extension [-Wc++11-extensions]
platform/iphone/gl_view.mm:56:14: warning: unused variable 'video_previous_volume' [-Wunused-variable,34]
platform/iphone/gl_view.mm:251:12: warning: unused function 'get_first_id' [-Wunused-function,34]
platform/iphone/main.m:45:15: warning: unused variable 'app' [-Wunused-variable,34]
platform/osx/os_osx.mm:79:15: warning: unused function 'convertRectToBacking' [-Wunused-function]
```
2018-10-04 11:50:16 +02:00
Jean-François Michaud 700d5d26c9 Fix #22591: shader failed to compile when shadow enabled because of incompatible assignment of vec3 to a vec4. 2018-10-03 13:42:17 -04:00
Rémi Verschelde 95131e6f23 Fix warnings on release builds (not DEBUG_ENABLED)
Fixes the following Clang 5 warnings:
```
modules/bmp/image_loader_bmp.cpp:46:60: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
modules/bmp/image_loader_bmp.cpp:48:61: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
drivers/png/image_loader_png.cpp:231:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
scene/gui/graph_edit.cpp:1045:8: warning: comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-out-of-range-compare]

core/class_db.cpp:812:13: warning: unused variable 'check' [-Wunused-variable]
core/io/file_access_pack.cpp:172:11: warning: unused variable 'ver_rev' [-Wunused-variable]
core/math/bsp_tree.cpp:195:13: warning: unused variable 'plane' [-Wunused-variable]
core/math/bsp_tree.cpp:168:6: warning: unused variable 'plane_count' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:685:10: warning: unused variable 'ok' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:706:10: warning: unused variable 'ok' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:755:19: warning: unused variable 'var_type' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:1306:12: warning: unused variable 'err' [-Wunused-variable]

modules/gdscript/gdscript_function.cpp:158:15: warning: unused function '_get_var_type' [-Wunused-function]
modules/gdscript/gdscript_parser.cpp:750:20: warning: unused variable 'lv' [-Wunused-variable]
modules/gdscript/gdscript_parser.cpp:59:15: warning: unused function '_find_function_name' [-Wunused-function]
scene/main/node.cpp:2489:13: warning: unused function '_Node_debug_sn' [-Wunused-function]
```
2018-10-03 17:34:55 +02:00
Rémi Verschelde d952126caf Fix warnings in Android platform
Fixes the following Clang 7 warnings:
```
platform/android/os_android.h:240:16: warning: 'OS_Android::native_video_play' hides overloaded virtual function [-Woverloaded-virtual]
platform/android/os_android.h:241:15: warning: 'OS_Android::native_video_is_playing' hides overloaded virtual function [-Woverloaded-virtual]

platform/android/audio_driver_opensl.cpp:104:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]

platform/android/audio_driver_opensl.cpp:129:10: warning: unused variable 'numOutputs' [-Wunused-variable]
platform/android/audio_driver_opensl.cpp:130:11: warning: unused variable 'deviceID' [-Wunused-variable]
platform/android/java_glue.cpp:795:10: warning: unused variable 'clsio' [-Wunused-variable]
platform/android/java_glue.cpp:890:12: warning: unused variable 'gob' [-Wunused-variable]
platform/android/java_glue.cpp:592:13: warning: unused variable 'resized' [-Wunused-variable]
platform/android/java_glue.cpp:593:13: warning: unused variable 'resized_reload' [-Wunused-variable]

modules/mobile_vr/mobile_vr_interface.cpp:401:8: warning: unused variable 'aspect_ratio' [-Wunused-variable]

drivers/unix/dir_access_unix.cpp:394:2: warning: THIS IS BROKEN [-W#warnings]
```
2018-10-03 15:17:00 +02:00
Rémi Verschelde f8484bb77d
Merge pull request #22672 from akien-mga/fix-warnings
Fix various warnings reported by CI in #22620
2018-10-03 15:09:00 +02:00
Rémi Verschelde 6ab78d9ffb Fix some more warnings reported by CI
Fixes the following Clang 7 warnings:
```
core/io/marshalls.cpp:872:10: warning: unused variable 'f' [-Wunused-variable]

core/ustring.cpp:1831:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]
core/ustring.cpp:1832:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register]

drivers/gles3/rasterizer_gles3.cpp:82:24: warning: unused function '_gl_debug_print' [-Wunused-function,34]

main/main.cpp:118:13: warning: unused variable 'auto_build_solutions' [-Wunused-variable]

modules/csg/csg_gizmos.cpp:225:46: warning: 'current' may be used uninitialized in this function [-Wmaybe-uninitialized]
```
2018-10-03 14:13:42 +02:00
Juan Linietsky 286b70839e vertex lit optimization for fog. 2018-10-02 19:08:33 -03:00
Juan Linietsky 11f088279d Implemented FOG support in GLES2. 2018-10-02 18:53:16 -03:00
Rémi Verschelde 45842c0ea9
Merge pull request #22627 from akien-mga/gles2-pixel-snap
GLES2: Implement pixel snap 2D option
2018-10-02 19:09:34 +02:00
Ferenc Arn 658c2b6eee Bring accidentally commented out lines back.
Oversight by me in #22483. GLES2 doesn't seem to be supporting anisotropy at the moment anyway ---in case it gets revived.
2018-10-02 12:44:31 -04:00
Rémi Verschelde 63e1c6dce3 Disable GLES2 debugging on iOS, fixes build
Could be readded by someone who knows how to access an API
similar to EGL on iOS.
2018-10-02 16:34:31 +02:00
Rémi Verschelde ac2a4771d5 GLES2: Implement pixel snap 2D option 2018-10-02 15:53:24 +02:00
Rémi Verschelde 8c9c1d6882
Merge pull request #21436 from CptPotato/tonemap-fixes
tonemapping fixes
2018-10-02 15:42:15 +02:00
Rémi Verschelde 4d693fc3f0
Merge pull request #22455 from Calinou/reverse-cull-face-update-light
Update lights when their reverse cull face mode is toggled
2018-10-02 15:23:24 +02:00
Rémi Verschelde 9c93a401b9
Merge pull request #22483 from tagcup/fresnel
Restore the Fresnel term in the BRDF.
2018-10-02 15:18:31 +02:00
Rémi Verschelde 6e619ccb24
Merge pull request #22562 from muiroc/gles2_canvas_skip_transform
Uses skip_vertex_transform in GLES2 canvas shader
2018-10-02 15:12:50 +02:00
Rémi Verschelde 123931f7eb
Merge pull request #22574 from BastiaanOlij/mobile_vr_gles2
Moving lens distortion shader into drivers and adding GLES2 support
2018-10-02 15:08:59 +02:00
Juan Linietsky bad991ea83 Many more fixes for GLES2 mobile export. Also added ability to turn on OpenGL debugging on Android export. 2018-10-02 10:00:15 -03:00