Commit graph

577 commits

Author SHA1 Message Date
Juan Linietsky a78b42c058 Don't post process on tiny render targets, fixes #19628 2018-11-19 22:05:55 -03:00
Juan Linietsky d5ad1ca1ae Fix crash on canvas with BG_MODE_KEEP, closes #19590 2018-11-19 21:41:18 -03:00
Juan Linietsky d304228003 Do not draw particles if they are not processing at all, fixes #19507 2018-11-19 20:34:29 -03:00
Juan Linietsky 634aa4fc24 Ensure bone AABBs are properly transformed to affect mesh AABB, fixes #19281 2018-11-19 10:43:29 -03:00
Juan Linietsky 455f297671 Properly reset canvas state after drawing, fixes #18860 2018-11-18 16:34:20 -03:00
Rémi Verschelde 60ee61c7ff
Merge pull request #23742 from JFonS/fix_23698
Use hint_color when getting shader default params
2018-11-18 12:05:02 +01:00
Wilson E. Alvarez f8e0051420 Removed unnecessary assignments 2018-11-17 20:40:55 -05:00
Juan Linietsky 8aa38c9ad8 Fix shader bug likely introduced recently. 2018-11-16 14:30:34 -03:00
Juan Linietsky e77afb8507 Ensure environment radiance is not used on refprobe interiors, fixes #17868 2018-11-16 11:46:21 -03:00
Juan Linietsky bb9127a78b Removed unnecesary normal multiplication (only culling was really needed), fixes #17776 2018-11-16 10:52:31 -03:00
Juan Linietsky 40e4f5bef4 Proxies were being mishandled, leading to the now fixed #17651 2018-11-16 09:33:33 -03:00
JFonS fb92c7b0fa Use hint_color when getting shader default params 2018-11-16 12:20:23 +01:00
Juan Linietsky 4d88721e62 Do not error on empty shader, just treat it as invalid by default. Fixes #15998. 2018-11-14 10:58:16 -03:00
Juan Linietsky 55f5f4757e
Merge pull request #23248 from dlasalle/fog
Add parameters for fog end depth and use alpha as density.
2018-11-14 10:24:55 -03:00
Juan Linietsky 43b9ed64c8
Merge pull request #23702 from JFonS/fix_2d_particles_scale
Make 2D particles work OOTB (again)
2018-11-14 10:16:50 -03:00
Juan Linietsky 984063cf0b Cleaned up and fixed the base_changed function in rasterizers, also fixes #15617 2018-11-14 09:32:39 -03:00
Dominique LaSalle 6eae6247e4 Add parameter for fog max depth and use alpha as density. 2018-11-13 17:19:11 -08:00
JFonS cbfb7bd613 Make 2D particles work OOTB (again) 2018-11-13 23:25:05 +01:00
Rémi Verschelde 8849d3b47d
Merge pull request #22639 from tagcup/opt
Avoid some unnecessary calculations in scene.glsl.
2018-11-12 21:22:57 +01:00
Rémi Verschelde 3bc7dfc856
Merge pull request #23254 from ibrahn/gles2-var-init-cleanup
Cleaning up some uninitialised variables in GLES2 stuff.
2018-11-12 20:47:19 +01:00
Juan Linietsky f00b522705 Avoid double underscore from breaking glsl compiler, fixes #12880 2018-11-10 10:48:18 -03:00
Rémi Verschelde 17b776e549
Merge pull request #23502 from Rubonnek/simplified-logic
Simplified boolean logic in GLES2/3 rasterizers
2018-11-05 08:31:14 +01:00
JFonS 85ce4a67ed Remove animation loop from ParticlesMaterial + improvements to CPUParticles2D
Remove animation loop from ParticlesMaterial and move it to
SpatialMaterial for 3D particles and Particles2D for the 2D case.

Added animation to CPUParticles2D as well as the "Convert to
CPUParticles2D" to the PAarticles2D menu.
2018-11-04 15:58:12 +01:00
Wilson E. Alvarez e4884cfc75
Simplified boolean logic in GLES2/3 rasterizers 2018-11-04 09:14:50 +00:00
Ibrahn Sahir 352b3c9c93 Cleaning up some uninitialised variables in GLES2 stuff.
Initialise keep_original_textures and use_fast_texture_filter in storage
config. Removed any other variables from storage config that were both unused
and uninitialised to avoid future confusion (if they're needed it's
easier to spot an uninitialised variable problem in a PR that adds the
variable again rather than just uses it).

Copied storage Texture struct constructor from GLES3 implementation
(except where variables were already initialised with different values).
Gives us sensible tested defaults for previously uninitialised vars.

Added assignments for state.current_main_tex based on same in GLES3.
2018-11-02 14:09:32 +00:00
Juan Linietsky 9c195b57a0
Merge pull request #23125 from JFonS/fix_texture_get_data
Implement rasterizer texture_get_data on OpenGL ES
2018-11-01 12:56:31 -03:00
JFonS edcccaf8c1 Implement rasterizer texture_get_data on OpenGL ES 2018-11-01 11:30:49 +01:00
Leon Krause 92e7c8daf0 Use BufferSubData instead of MapBufferRange in HTML5 platform
WebGL does not support MapBufferRange or UnmapBuffer.
Also used in non-ES platforms where an extra-copy is avoided.
2018-10-29 21:01:39 +01: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
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
Dualtagh Murray b902a2f2a7 Fixing warnings generated by MSVC
Fixes #22684.
2018-10-19 11:45:24 +02: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
Ferenc Arn 35ea827e83 Avoid some unnecessary calculations in scene.glsl. 2018-10-11 10:34:37 -04: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
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
Aaron Franke 4f7b33cdcf Remove redundant "== false" code
Some of this code has been re-organized.
f
2018-10-06 16:20:41 -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
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 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
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
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
Bastiaan Olij a6df366b23 Moving lens distortion shader into drivers and adding GLES2 support 2018-10-02 17:14:43 +10:00
Rémi Verschelde 9258d7b5d0 Fix warnings about uninitialized vars [-Wsometimes-uninitialized]
Fixes the following Clang 7 warnings:
```
drivers/gles3/rasterizer_scene_gles3.cpp:1260:10: warning: variable 'target' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:1280:10: warning: variable 'target' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:1281:10: warning: variable 'target' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:1282:10: warning: variable 'target' is used uninitialized whenever switch case is taken [-Wsometimes-uninitialized]
drivers/gles3/rasterizer_scene_gles3.cpp:1286:5: warning: variable 'target' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
editor/editor_properties_array_dict.cpp:982:15: warning: variable 'change_index' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
editor/editor_properties.cpp:2655:6: warning: variable 'lt' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
editor/settings_config_dialog.cpp:367:11: warning: variable 'current_search_box' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
```
2018-10-01 17:33:08 +02:00
Rémi Verschelde b1b625f4f5 Fix various Clang 7 warnings about unused stuff
Namely:
[-Wunneeded-internal-declaration]
[-Wunused-comparison]
[-Wunused-const-variable]
[-Wunused-function]
[-Wunused-private-fields]

Fixes the following Clang 7 warnings:
```
editor/plugins/script_editor_plugin.cpp:1417:20: warning: function '_find_node_with_script' is not needed and will not be emitted [-Wunneeded-internal-declaration]
editor/scene_tree_dock.cpp:1859:14: warning: function '_find_last_visible' is not needed and will not be emitted [-Wunneeded-internal-declaration]

modules/gdscript/gdscript_parser.cpp:7838:19: warning: equality comparison result unused [-Wunused-comparison]

scene/resources/mesh.cpp:549:35: warning: unused variable '_array_types' [-Wunused-const-variable]
scene/resources/mesh.cpp:563:18: warning: unused variable '_format_translate' [-Wunused-const-variable]

drivers/gles3/rasterizer_scene_gles3.cpp:54:28: warning: unused function 'store_transform2d' [-Wunused-function]

core/io/file_access_network.h:50:6: warning: private field 'ml' is not used [-Wunused-private-field]
core/io/file_access_zip.h:93:14: warning: private field 'archive' is not used [-Wunused-private-field]
core/io/resource_format_binary.h:122:6: warning: private field 'bin_meta_idx' is not used [-Wunused-private-field]
core/message_queue.h:47:9: warning: private field 'mutex' is not used [-Wunused-private-field]
main/tests/test_gui.cpp:63:11: warning: private field 'control' is not used [-Wunused-private-field]
modules/gdscript/gdscript_parser.h:558:7: warning: private field 'completion_static' is not used [-Wunused-private-field]
platform/x11/os_x11.h:148:11: warning: private field 'ip_unix' is not used [-Wunused-private-field]
platform/x11/os_x11.h:180:7: warning: private field 'net_wm_icon' is not used [-Wunused-private-field]
platform/x11/os_x11.h:189:6: warning: private field 'audio_driver_index' is not used [-Wunused-private-field]
platform/x11/os_x11.h:190:15: warning: private field 'capture_idle' is not used [-Wunused-private-field]
servers/physics/body_pair_sw.h:79:6: warning: private field 'cc' is not used [-Wunused-private-field]
servers/visual/visual_server_raster.h:62:7: warning: private field 'draw_extra_frame' is not used [-Wunused-private-field]
```
2018-10-01 17:32:12 +02:00
Rémi Verschelde 686f6ff279 Fix mismatched class/struct definition warnings [-Wmismatched-tags]
Fixes the following Clang 7 warnings:
```
core/object.cpp:44:1: warning: '_ObjectDebugLock' defined as a struct here but previously declared as a class [-Wmismatched-tags]
core/variant_call.cpp:43:1: warning: '_VariantCall' defined as a struct here but previously declared as a class [-Wmismatched-tags]
drivers/gles3/rasterizer_storage_gles3.h:765:2: warning: 'MultiMesh' defined as a struct here but previously declared as a class [-Wmismatched-tags]
editor/editor_node.h:794:1: warning: 'EditorProgress' defined as a struct here but previously declared as a class [-Wmismatched-tags]
modules/bullet/rigid_body_bullet.h:230:17: warning: class 'KinematicUtilities' was previously declared as a struct [-Wmismatched-tags]
modules/bullet/space_bullet.h:60:1: warning: class 'btSoftBodyWorldInfo' was previously declared as a struct [-Wmismatched-tags]
scene/resources/world_2d.cpp:40:1: warning: 'SpatialIndexer2D' defined as a struct here but previously declared as a class [-Wmismatched-tags]
scene/resources/world.cpp:39:1: warning: 'SpatialIndexer' defined as a struct here but previously declared as a class [-Wmismatched-tags]
servers/audio/reverb_sw.cpp:60:1: warning: 'ReverbParamsSW' defined as a struct here but previously declared as a class [-Wmismatched-tags]
thirdparty/bullet/BulletSoftBody/btSoftBody.h:43:1: warning: 'btSoftBodyWorldInfo' defined as a struct here but previously declared as a class [-Wmismatched-tags]
```
2018-10-01 17:02:47 +02:00