Commit graph

494 commits

Author SHA1 Message Date
Rémi Verschelde 1504c96112
Merge pull request #24539 from BastiaanOlij/override_gl_position
Override GL_position
2019-01-04 15:40:05 +01:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Bastiaan Olij c1a53d8b06 Always treat exponent as float 2018-12-30 13:10:58 +01:00
Bastiaan Olij 9f266cf7e5 Override GL_position 2018-12-29 23:56:50 +11:00
Bastiaan Olij f3dd3c0830 Adding option to re-orient our sky 2018-12-15 19:41:34 +11:00
Rémi Verschelde ac87560fda
Merge pull request #23469 from clayjohn/fragment_camera_matrix
Added CAMERA_MATRIX to fragment shader
2018-12-12 13:46:58 +01:00
Rémi Verschelde 37e198c320
Merge pull request #23483 from clayjohn/fragment_camera_view
Make VIEW vector available in fragment shader
2018-12-11 20:44:41 +01:00
clayjohn 2042d6214e make VIEW vector available in fragment 2018-12-11 09:44:38 -08:00
Rémi Verschelde 0a9a2b1d62
Merge pull request #24163 from clayjohn/light_uv_const
Make LIGHT_UV constant in canvas_item light shader
2018-12-11 15:25:18 +01:00
Bojidar Marinov 02b569297e
Fix error when adding children to YSort
If it weren't for this warning, it would have crashed in release builds.
Fix #23889, fixup 6b8d6e3b07
2018-12-04 21:11:40 +02:00
clayjohn 4740dd343e make LIGHT_UV constant 2018-12-04 10:10:47 -08:00
Juan Linietsky af8d941c55 Added luminance capping to avoid glitches on small dots. closes #17996 2018-11-28 01:22:20 -03:00
Kanabenki 33a7fae127 Allow *= operator between vec and mat types in shaders 2018-11-24 18:57:29 +01:00
Juan Linietsky 631cf676c3 Removed noperspective (not in GLSL ES 3.0), do not write smooth if not specified. Fixes #20435 2018-11-21 23:07:09 -03:00
Rémi Verschelde 3df9aa3339
Merge pull request #23878 from bojidar-bg/23775-ysort-crash
Fix YSort crash when removing a child
2018-11-21 15:35:03 +01:00
Bojidar Marinov d2750ce593
Fix YSort crash when removing a child
Fixup of 8e4837f357
Fixes #23775
2018-11-21 15:01:11 +02: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
JFonS fb92c7b0fa Use hint_color when getting shader default params 2018-11-16 12:20:23 +01:00
Juan Linietsky d2e642b2dc Proper validation of out arguments in built-in shader functions, closes #16244 2018-11-14 18:56:19 -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 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
Rémi Verschelde 8e4837f357
Merge pull request #23407 from bojidar-bg/3281-ysort-recursive
Y-Sort children together in nested YSorts
2018-11-12 20:42:55 +01:00
Juan Linietsky baa8678d2a Do not allow samplers where they dont belong (variables/return types), fixes #15133 2018-11-12 08:36:26 -03:00
Juan Linietsky 555fb3a317 Effectively ensure that surface materials are the right size when setting them, fixes #23596 2018-11-08 15:58:52 -03: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
clayjohn 34d4faa227 added CAMERA_MATRIX to fragment shader 2018-11-02 23:14:42 -07:00
Pedro J. Estébanez cf8976de41 Fix canvas stacking not deterministic on same layer
Fixes #22687.
2018-10-30 21:53:00 +01:00
Bojidar Marinov 6b8d6e3b07
Y-Sort children together in nested YSorts
Closes #3281
2018-10-30 20:53:46 +02:00
Simon Wenner 9fcf9ee813 fixed uninitialized variables and false positives found by CppCheck 2018-10-25 20:38:17 +02: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
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 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
Rémi Verschelde c026e3957a Fix warnings on virtual methods [-Woverloaded-virtual] [-Wdelete-non-virtual-dtor]
Fixes the following Clang 7 warnings:
```
editor/editor_help.h:123:7: warning: 'EditorHelpIndex::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/editor_help.h:95:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/editor_help.h:96:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/plugins/curve_editor_plugin.h:141:15: warning: 'CurvePreviewGenerator::generate' hides overloaded virtual function [-Woverloaded-virtual]
editor/plugins/script_editor_plugin.h:70:7: warning: 'ScriptEditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual]
editor/quick_open.h:69:7: warning: 'EditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual]
main/tests/test_io.cpp:53:15: warning: 'TestIO::TestMainLoop::input_event' hides overloaded virtual function [-Woverloaded-virtual]
servers/audio/effects/audio_effect_record.h:69:15: warning: 'AudioEffectRecordInstance::process_silence' hides overloaded virtual function [-Woverloaded-virtual]

core/os/memory.h:119:2: warning: destructor called on non-final 'ContextGL_X11' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'EditorScriptCodeCompletionCache' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'Engine' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'PhysicalBone::JointData' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerScene' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerViewport' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
```
2018-10-02 13:40:17 +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 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
Juan Linietsky c83742ba86 -Lightmap and lightmap capture support for GLES2
-Added hint to not show some properties when running on low end gfx
2018-09-28 20:33:18 -03:00
Juan Linietsky f2ed26d71e Reflection probe support in GLES2 back-end. 2018-09-28 16:42:47 -03:00
Rémi Verschelde 3a2ca68af3 SCons: Build thirdparty code in own env, disable warnings
Also remove unnecessary `Export('env')` in other SCsubs,
Export should only be used when exporting *new* objects.
2018-09-28 14:07:39 +02:00
Rémi Verschelde 7b081a7fc8 Fix warnings about unhandled enum value in switch [-Wswitch]
Fixes GCC 5 warnings of the form:

core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch]
core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch]

Those can be trivial cases where adding a default fallback is the solution,
or more complex issues/hidden bugs where missed values are actually meant
to be handled.
2018-09-27 18:34:30 +02:00
Rémi Verschelde d95bbb8922 Fix warnings about set but unused variables [-Wunused-but-set-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable]
drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable]
drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable]
editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable]
editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable]
editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable]
editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable]
editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable]
modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable]
platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable]
platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable]
scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable]
scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable]
scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable]
scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable]
scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable]
scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable]
servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable]
servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable]
```

Also fixes two [-Wunused-value] warnings:
```
scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value]
servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value]
```

Some of those are bugs and need further work, they are identified with
`// FIXME` comments.
2018-09-27 16:25:24 +02:00
Rémi Verschelde cda5b0bfe1 Fix warnings about unused variables [-Wunused-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_scene_gles2.cpp:1139:15: warning: unused variable 'offset' [-Wunused-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:1205:39: warning: unused variable 'multi_mesh' [-Wunused-variable]
drivers/gles2/rasterizer_storage_gles2.cpp:359:7: warning: unused variable 'srgb' [-Wunused-variable]
drivers/gles2/shader_gles2.cpp:1016:45: warning: unused variable 'texture_hints' [-Wunused-variable]
editor/animation_track_editor.cpp:776:9: warning: unused variable 'keys_to' [-Wunused-variable]
editor/editor_inspector.cpp:273:7: warning: unused variable 'vs_height' [-Wunused-variable]
editor/editor_themes.cpp:202:10: warning: unused variable 'begin_time' [-Wunused-variable]
editor/editor_themes.cpp:239:10: warning: unused variable 'end_time' [-Wunused-variable]
editor/plugins/animation_blend_tree_editor_plugin.cpp:726:17: warning: unused variable 'an' [-Wunused-variable]
editor/plugins/script_text_editor.cpp:1278:8: warning: unused variable 'fold_state' [-Wunused-variable]
main/main.cpp:132:13: warning: 'use_vsync' defined but not used [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:231:8: warning: unused variable 'y_end' [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:311:6: warning: unused variable 'shift' [-Wunused-variable]
modules/gdscript/gdscript_editor.cpp:58:7: warning: unused variable 'th' [-Wunused-variable]
modules/gridmap/grid_map.cpp:1084:6: warning: unused variable 'ofs' [-Wunused-variable]
modules/theora/video_stream_theora.cpp:442:9: warning: unused variable 'tr' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2606:6: warning: unused variable 'count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2829:6: warning: unused variable 'seq_count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2844:24: warning: unused variable 'vnode_function' [-Wunused-variable]
modules/websocket/lws_peer.cpp:122:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:135:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:63:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:91:12: warning: unused variable 'peer_data' [-Wunused-variable]
platform/android/export/export.cpp:763:16: warning: unused variable 'node_size' [-Wunused-variable]
scene/gui/rich_text_label.cpp:850:10: warning: unused variable 'x_ofs' [-Wunused-variable]
scene/gui/text_edit.cpp:653:8: warning: unused variable 'tab_w' [-Wunused-variable]
scene/resources/bit_mask.cpp:186:6: warning: unused variable 'i' [-Wunused-variable]
scene/resources/mesh.cpp:549:20: warning: '_array_name' defined but not used [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:107:10: warning: unused variable 'v2' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:108:10: warning: unused variable 'v3' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:109:10: warning: unused variable 'v4' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:110:10: warning: unused variable 'v5' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:111:10: warning: unused variable 'v0n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:112:10: warning: unused variable 'v1n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:113:10: warning: unused variable 'v2n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:114:10: warning: unused variable 'v3n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:115:10: warning: unused variable 'v4n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:116:10: warning: unused variable 'v5n' [-Wunused-variable]
servers/visual/default_mouse_cursor.xpm:2:21: warning: 'default_mouse_cursor_xpm' defined but not used [-Wunused-variable]
```
2018-09-27 16:25:24 +02:00
Juan Linietsky 65fd37c149 -Rewrote GLES2 lighting and shadows and optimized state changes, did many optimizations, added vertex lighting.
-Did some fixes to GLES3 too
2018-09-23 12:14:50 -03:00
Chaosus 16e5ef6894 Added missed min/max shader overloads 2018-09-21 20:10:03 +03:00
Ibrahn Sahir bff864818f Fixed an access after free in ShaderLanguage::_reduce_expression.
Passing an element reference of a vector to a push_back call to
that same vector can cause an access after free. This is because push_back
will resize the vector, reallocating if necessary, leaving the reference
referring to the freed memory.
Removed an instance of this usage here.
2018-09-19 14:28:19 +01:00
JFonS 3cedec5f75 Set uniform default values in inspector 2018-09-13 23:05:33 +02:00
Rémi Verschelde 1a16dabfb5
Merge pull request #21982 from luzpaz/misc-typos
Misc. typos
2018-09-13 10:59:00 +02:00
luz.paz 08bde5b2de Misc. typos
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12 21:39:17 -04:00