Commit graph

526 commits

Author SHA1 Message Date
Bastiaan Olij a6df366b23 Moving lens distortion shader into drivers and adding GLES2 support 2018-10-02 17:14:43 +10:00
Rémi Verschelde 85bb1c445c Style: Run clang-format on shaders again 2018-10-02 08:34:08 +02:00
Rémi Verschelde 6bfb7944d9 SCons: Remove avoidable defines from main env's CPPPATH
Also finally move freetype to its own env and disable warnings for it.
Still needs some work to fix the awkward situation of the freetype and
svg modules used in scene/ and editor/ respectively.
2018-10-01 11:59:22 +02:00
Juan Linietsky c24277a520 -Many GLES2 optimizations
-Android export fixes (use ETC if GLES2 backend in use)
-revert to thekla atlas because xatlas is not working well
2018-09-30 23:11:24 -03:00
tagcup 9f4e9fcb81 Optimized GGX G function for GLES2.
Also changed the mapping of anisotropy to match the common definition.
2018-09-30 16:33:50 -04:00
Ferenc Arn e94f6aacee Restore the Fresnel term in the BRDF.
Was uncommented in 65fd37c, mostly likely by mistake since its important.

Also made a few corrections of specular -> specular_blob_intensity (gles2).
2018-09-30 12:17:48 -04:00
muiroc 9a5d867210 Uses skip_transform in gles2 canvas shader 2018-09-30 18:10:58 +02:00
Rémi Verschelde d3f01a2281 Style: Run clang-format on recent shader changes 2018-09-30 16:31:46 +02:00
Juan Linietsky ce8294986d Some more GLES2 tuning.. 2018-09-29 23:47:24 -03:00
Juan Linietsky 3333166b07 Many more GLES2 fixes 2018-09-29 19:17:52 -03:00
Juan Linietsky 4115e6d179 This fixes a bug in refprobe blending, but I have no idea when I fixed it. It just started working all of sudden.. 2018-09-29 17:03:35 -03:00
Juan Linietsky 0de8309b2c Many fixes to GLES2 renderer, fixed compilation issues in GLES3 shaders. 2018-09-29 13:49:34 -03: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 cdc411fd54 Fix various warnings: [-Waddress], [-Wpointer-arith], [-Wwrite-strings], [-Wreturn-local-addr] and more
Fixes the following GCC 5 warnings:
```
core/os/file_access.cpp:49:19: warning: the address of 'FileAccess::create_func' will always evaluate as 'true' [-Waddress]
servers/audio_server.cpp:192:70: warning: comparison with string literal results in unspecified behaviour [-Waddress]

drivers/gles2/rasterizer_storage_gles2.cpp:4095:90: warning: NULL used in arithmetic [-Wpointer-arith]

modules/gdnative/register_types.cpp:237:3: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
platform/android/export/export.cpp:207:1: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

modules/gdscript/gdscript.h:150:67: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:119:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:123:56: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:127:50: warning: returning reference to temporary [-Wreturn-local-addr]
servers/physics_2d/collision_object_2d_sw.h:131:52: warning: returning reference to temporary [-Wreturn-local-addr]

editor/plugins/skeleton_editor_plugin.cpp:34:36: warning: extra tokens at end of #include directive
modules/bullet/bullet_types_converter.cpp:31:9: warning: #pragma once in main file

editor/import/editor_scene_importer_gltf.cpp:1996:51: warning: name lookup of 'i' changed
modules/visual_script/visual_script_property_selector.cpp:402:45: warning: name lookup of 'E' changed
scene/gui/tree.cpp:1268:25: warning: name lookup of 'i' changed
scene/resources/visual_shader.cpp:808:32: warning: name lookup of 'i' changed
```
2018-09-27 16:33:52 +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
Rémi Verschelde e5bbcb8bcf Fix warnings for comparison between signed and unsigned integers [-Wsign-compare]
Also turn off -Wsign-compare warnings in the future, we do not consider them important.

Fixes the following GCC 5 warnings:
```
core/node_path.cpp:279:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:169:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:314:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/shader_gles2.cpp:985:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles3/rasterizer_storage_gles3.cpp:1075:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/pulseaudio/audio_driver_pulseaudio.cpp:343:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_plugin.cpp:525:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_properties_array_dict.cpp:747:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:2078:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:4096:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/sprite_editor_plugin.cpp💯20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:134:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:339:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/etc/image_etc.cpp:222:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:242:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:258:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:200:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:222:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1085:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1489:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1623:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:206:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:356:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:406:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:493:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/audio_stream_player_3d.cpp:420:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:565:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:571:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_rb_resampler.cpp:156:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```

The following warnings were not fixed, as they implied casting for no gain:
```
core/io/packet_peer.cpp:228:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/io/resource_format_binary.cpp:109:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/rasterizer_scene_gles2.cpp:144:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/unix/file_access_unix.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:889:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1020:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:2255:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/bit_mask.cpp:336:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:141:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:150:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:154:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:86:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:89:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```
2018-09-27 16:25:23 +02:00
Hugo Locurcio b8bd5d0354
Update lights when their reverse cull face mode is toggled 2018-09-26 21:52:41 +02:00
Juan Linietsky 2005b0c820 Fix gizmo handles in GLES2 backend 2018-09-25 10:36:54 -03:00
Rémi Verschelde 60312915dc Fix build after 65fd37c1, using Math_PI
Also fix style in shaders.
2018-09-23 18:26:57 +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
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
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Rémi Verschelde fc207ba18a
Merge pull request #21782 from eska014/gles3-get-texture-err
Fix missing texture-download error with OpenGL ES
2018-09-05 22:12:28 +02:00
Leon Krause 57eaea571a Fix missing texture-download error with OpenGL ES 2018-09-05 21:22:13 +02:00
volzhs d5354e2e8f Respect splash fullsize option on GLES2 2018-09-03 19:48:12 +09:00
Rémi Verschelde c1f687c681
Merge pull request #21387 from hpvb/fix-15324
Fall back to GLES2 if GLES3 is not working
2018-08-27 16:54:22 +02:00
Juan Linietsky bca706b361
Revert "Fix some 3D texture issues" 2018-08-27 10:12:07 -03:00
Rémi Verschelde 3dc63a710f
Merge pull request #21469 from akien-mga/glsl-clang-format
Style: Enable clang-format on GLSL shaders
2018-08-27 10:12:24 +02:00
Rémi Verschelde 4226d56ca9 Style: Enable clang-format on GLSL shaders
As of clang-format 6.0.1, putting the `/* clang-format off */` hint
around our "invalid" `[vertex]` and `[shader]` statements isn't enough
to prevent a bogus indent of the next comments and first valid statement,
so we need to enclose that first valid statement in the unformatted chunk.
2018-08-27 07:34:14 +02:00
elasota 30e20b6278 Partial fixes for 3D texture issues 2018-08-26 20:22:56 -04:00
Hein-Pieter van Braam 08f452d1a9 Fall back to GLES2 if GLES3 is not working
This adds a static is_viable() method to all rasterizers which has to be
called before initializing the rasterizer. This allows us to check what
rasterizer to use in OS::initialize together with the GL context
initialization.

This commit also adds a new project setting
"rendering/quality/driver/driver_fallback" which allows the creator of a
project to specify whether or not fallback to GLES2 is allowed. This
setting is ignored for the editor so the editor will always open even if
the project itself cannot run. This will hopefully reduce confusion for
users downloading projects from the internet.

We also no longer crash when GLES3 is not functioning on a platform.

This fixes #15324
2018-08-26 16:40:46 +02:00
Juan Linietsky 62233423c7 Fix generation of env map, closes #18880 2018-08-24 13:31:31 -03:00
Rémi Verschelde 1ae7a78d8b
Merge pull request #21364 from akien-mga/shaders-style
Style: Fix code formatting in GLSL shaders
2018-08-24 15:17:38 +02:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Rémi Verschelde d442f3d0aa
Merge pull request #21351 from akien-mga/print_verbose
Add print_verbose to print to stdout only in verbose mode
2018-08-24 14:58:36 +02:00
Rémi Verschelde e68b96928b Style: Fix code formatting in GLES2 shaders 2018-08-24 14:50:59 +02:00
Thomas Herzog f123694b4e
Merge pull request #21357 from karroffel/gles2-shader-language-f-to-pay-respects
[GLES2] fix wrong shader compiler output
2018-08-24 12:14:40 +02:00
Thomas Herzog 56bab6509c
Merge pull request #21318 from karroffel/gles2-shader-fixes
[GLES2] attempt to fix some android problems
2018-08-24 12:14:20 +02:00
Thomas Herzog 2fa4b50027 [GLES2] fix wrong shader compiler output
The `f` postfix was working fine on dekstop GL but not on
some mobile drivers.
2018-08-24 12:10:54 +02:00
Thomas Herzog 211e0fa4aa [GLES2] fix multimesh byte colors
When using float colors, everything works fine, but when using
the byte format, the colors were read incorrectly.
2018-08-24 11:23:42 +02:00
Rémi Verschelde de59fe04e7 Add print_verbose to print to stdout only in verbose mode
Equivalent of the cumbersome:
if (OS::get_singleton()->is_stdout_verbose())
	print_line(msg);
2018-08-24 09:23:20 +02:00
Rémi Verschelde b2494d3898
Merge pull request #21325 from karroffel/gles2-texture-flags
[GLES2] fix texture flags not having an effect
2018-08-23 22:22:33 +02:00
Thomas Herzog 8884b3daad [GLES2] fix texture flags not having an effect 2018-08-23 18:25:55 +02:00
Thomas Herzog 0edb50f629
Merge pull request #21321 from karroffel/gles2-canvas-modulate
[GLES2] fix CanvasModulate not working
2018-08-23 18:15:42 +02:00
Thomas Herzog 0f59cc179c [GLES2] fix CanvasModulate not working
That's what happens when you forget about your debug
shortcuts.

Fixes #21025
2018-08-23 17:38:20 +02:00
Thomas Herzog 5ebc70f288 [GLES2] fix depth for alpha pass 2018-08-23 17:25:00 +02:00
Thomas Herzog d61fc6a97b
Merge pull request #21317 from karroffel/gles2-canvas-texture-sampler-long-branch-name
[GLES2] fix canvas_item sampler allocation
2018-08-23 17:11:00 +02:00
Thomas Herzog a7bedaf935 [GLES2] attempt to fix some android problems 2018-08-23 17:08:16 +02:00
Thomas Herzog da876907fd [GLES2] fix canvas_item sampler allocation 2018-08-23 16:46:43 +02:00
Thomas Herzog 8e7454e5d7 enable hardware skeletons 2018-08-23 16:13:45 +02:00
elasota 35f6ba5c5d BPTC support 2018-08-21 22:56:04 -04:00
Marcin Zawiejski bd5ff205b2 Revert "Batch GLES2 draw calls"
This reverts commit f55039b194.

The GLES2 batching seems to require more testing and tweaking in order
to actually make the performance better on Android devices. It's been
proved with #21184 that the current implementation has it's drawbacks
therefore I suggest reverting the commit for now.
2018-08-20 02:10:14 +02:00
Thomas Herzog b4ce1e3005
Merge pull request #20965 from dragmz/gles2_batching
Batch GLES2 draw calls
2018-08-18 18:37:52 +02:00
dumitru.stama 5a74b15b3d Removed the lines forcing black screen on android GLES2 2018-08-17 22:26:30 -07:00
Thomas Herzog 0ef85b55e0 [gles2] fix black bar artifacts 2018-08-15 17:12:21 +02:00
Rémi Verschelde 4c6cf97257
Merge pull request #20941 from codingHahn/fix-normals-on-shader
Fix handling of normals that approach 1
2018-08-15 08:40:16 +02:00
Marcin Zawiejski ab1e460f53
Reduce verbosity for unsupported GLES2 bg modes 2018-08-14 15:11:19 +02:00
Marcin Zawiejski f55039b194 Batch GLES2 draw calls
Adds GLES2 draw calls batching for the same render list item that uses
multiple rasterizer commands (e.g. Label node; a node with multiple
GDScript draw_* calls).
2018-08-14 10:47:16 +02:00
Thomas Herzog 3d2984c962 [gles2] added ImmediateGeometry rendering 2018-08-13 16:16:23 +02:00
Nick Hahn 66eba18969 Fix handling of normals that approach 1 2018-08-12 12:45:43 +02:00
Marcin Zawiejski a0afaaeeb9 Fix mat4 uniform writes 2018-08-08 21:39:43 +02:00
Thomas Herzog 1800664e80
Merge pull request #20805 from karroffel/gles2-misc-fixes
unhacking some GLES2 code
2018-08-08 17:28:35 +02:00
Thomas Herzog 73fe08be2e GLES2 refactors
This commit unhacks some parts of the 3D rendering.

Most notably:

 - possibility to use negative texture units
   (no longer weird manual index allocation for user samplers)

 - refactoring of light code, now sorts in a different way,
   should yield better performance

 - fixes a crash while saving (because of "Illegal instruction" execution)
   when using a decent compiler (clang, it's clang. Thanks GCC for not telling me about UB).
2018-08-08 17:09:44 +02:00
Juan Linietsky b67f982723
Merge pull request #20681 from DavidSichma/master
Keeping track of discard
2018-08-08 09:54:59 -03:00
Hugo Locurcio 31c12f05c4
Tweak the default SpatialMaterial properties
Roughness is now set to 1 by default and albedo is now white,
even on meshes that do not have any materials defined.

This means there is no longer a visual difference between a
mesh with no materials defined and a mesh with a default
SpatialMaterial defined.
2018-08-07 17:04:30 +02:00
Juan Linietsky edde52c8de Added proper import support for 3D and Array textures 2018-08-06 14:56:06 -03:00
Juan Linietsky 07a982e614
Merge pull request #20597 from karroffel/tex3d
add 3D textures
2018-08-06 07:20:00 -03:00
Marcin Zawiejski 477f496162
Fix uniform set for mat3 and mat4 2018-08-04 07:30:25 +02:00
David Sichma c101dd5fa6 Keeping track of discard
Shader compilation now keeps track of the discard key word.

Previously only variables were monitored. But discard, which needs
special treatment in some cases, went unnoticed by the compiler as
discard is not a variable but a flow control.

This commit adds monitoring for discard.
2018-08-02 21:55:02 +02:00
Thomas Herzog b4d3f541e7 add 3D textures 2018-07-30 12:20:27 +02:00
karroffel b64171e79c add initial GLES2 3D renderer 2018-07-27 14:15:46 +02:00
Hein-Pieter van Braam 0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Rémi Verschelde e38051970c
Merge pull request #20448 from volzhs/duplicated-code
Remove duplicated codes
2018-07-25 22:20:47 +02:00
Rémi Verschelde 237148e80f
Merge pull request #18368 from Gamblify/RasterizerEngineSync
sync rasterizers with engine
2018-07-25 20:33:37 +02:00
volzhs 946be8be50 Remove duplicated codes 2018-07-25 23:34:25 +09:00
Marcin Zawiejski 2d05ae39a2 fix disappearing lines in visual script editor 2018-07-23 09:07:32 +02:00
Rémi Verschelde c579c48461
Merge pull request #20353 from dragmz/gles2_redundant
Remove redundant uniform set call
2018-07-22 16:20:23 +02:00
dragmz 00180ef264 remove redundant uniform set call 2018-07-22 15:42:43 +02:00
dragmz d2e909847d initialize texture shrink to false by default 2018-07-22 15:09:00 +02:00
Rémi Verschelde 00dfc9c8eb Shader lang: Properly assign INSTANCE_ID to gl_InstanceID
Note that gl_InstanceID is not supported in OpenGL ES 2.0,
so in the gles2 backend we assign it to 0.

Also clean up some duplicates/commented out code.
Fixes #20088.
2018-07-22 14:26:46 +02:00
Rémi Verschelde 7c9f7452f4 Style: Format code with clang-format 6.0.1 2018-07-18 16:27:03 +02:00
Max Hilbrunner 277793439a
Revert "Fix #19507 Not emitted particles affects performance" 2018-07-17 16:52:13 +02:00
Max Hilbrunner 4b626dc114
Merge pull request #19764 from malbach/godot_malbach
Fix #19507 Not emitted particles affects performance
2018-07-17 16:47:41 +02:00
Juan Linietsky de910f8c26 Finally figured out how to implement AnimatedTexture properly. 2018-07-16 11:43:49 -03:00
Max Hilbrunner 40f38216cf
Merge pull request #19707 from toger5/fix_clipping_vflip
fix clipping with v_flip fixes: #18600
2018-07-12 05:05:56 +02:00
Juan Linietsky 7dcaabaf19 Support for CPU based particles, which aids compatibility with OpenGL ES 2.0 2018-07-06 20:21:42 -03:00
Rémi Verschelde 8ce6444f59 Fix server build after 7fc23675 2018-07-03 13:53:00 +02:00
Juan Linietsky 7fc2367508 Added ability for SSAO to affect AO textures too 2018-07-02 16:50:52 -03:00
malbach cef8d355d2 Fix #19507 Not emitted particles affects performance 2018-06-25 18:17:28 +02:00
toger5 b4b7ca89f5 fix clipping with v_flip fixes: #2929 2018-06-16 22:55:21 +02:00
nemerle 7d9a55bdc5 A typo in ShaderCompilerGLES2 constructor code '==' used instead of '=' 2018-06-13 15:49:13 +02:00
Gustav Lund 35eb7f2d6a Rasterizers are now in sync with engine
The rasterisers (both GLES3 and GLES2) were calculating their own frame delta time
This fix lets the rasterizers get the frame delta through the draw call
That way any regulations to the frame step from the main script will not cause particle systems to process at a different step than the rest of the Engine.

Remove unused rasterizer storage variable

frame.prev_tick variable were not used anywhere and has been removed
2018-06-05 16:33:02 +02:00
Rémi Verschelde 43b7ebf0a0 Style: Apply clang-format (5.0) to some missed files 2018-05-31 09:00:37 +02:00
bruvzg 6f0a83b681
Fix UWP build after #14622. 2018-05-18 19:29:24 +03:00
Hein-Pieter van Braam e668757aa9
Merge pull request #14622 from bruvzg/non-rectangular-windows
Experimental support for windows with per-pixel transparency.
2018-05-08 16:44:35 +02:00
Juan Linietsky b96cd25305
Merge pull request #18495 from Zylann/partial_texture_update
Added partial texture update to VisualServer
2018-05-07 13:20:38 -03:00
Juan Linietsky b3e4bc562c Skeleton for 2D WIP 2018-05-03 17:29:56 -03:00
Marc Gilleron c755cced83 Added partial texture update to VisualServer 2018-04-29 03:09:49 +02:00
Juan Linietsky 8a5fb669ae
Merge pull request #17421 from Chaosus/fixshaderbugs
Fix few bugs in shader definitions
2018-04-08 09:33:12 -03:00
bruvzg ddae098dee
Experimental support for windows with per-pixel transparency (macOS, X11 and Windows). 2018-04-07 17:11:45 +03:00
Poommetee Ketson ff070de986 s/2017/2018/g for gles2, websocket, linux appdata 2018-03-21 16:07:51 +07:00
Chaosus 2d428a350e Fix few bugs in shader definitions 2018-03-10 21:00:18 +03:00
bruvzg e256f9d4e5
Add GL_ARB_framebuffer_object extension support check and GL_EXT_framebuffer_object fallback for GLES2 (updated GLAD bindings).
Add GL_ARB_debug_output extension support check on all platforms.
2018-03-05 20:49:47 +02:00
Rémi Verschelde 3bab5477ff
Merge pull request #17173 from karroffel/gles2-line-rendering-fix
fix GLES2 line rendering
2018-03-02 13:37:44 +01:00
karroffel 8b82f4ad2e fix GLES2 line rendering
fixes #17147
2018-03-02 12:35:34 +01:00
bruvzg a5a4f3714b
GLES2 renderer support on macOS. 2018-03-02 13:15:12 +02:00
karroffel eac4c984df add GLES 2 renderer for 2D
This commit adds a new rendering backend, GLES2, and adds a
project setting to enable it.

Currently this backend can only be used on the X11 platform,
but integrating into other platforms is planned.
2018-03-01 15:12:30 +01:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Wilson E. Alvarez 738d2ab969 Removed unnecessary assignments 2017-08-21 15:15:55 -04:00
Marcelo Fernandez eab850524e Add closest_power_of_2 func and implement mix_rate/latency on OS X 2017-08-17 19:51:13 -03:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Poommetee Ketson c7c65ca6ba Clang-formatting *.cpp and *.h (some files excluded) 2017-07-22 18:14:08 +07:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Juan Linietsky bbada82f80 -Reorganized all properties of project settings (Sorry, Again).
(Lot's of bloat accumulated, so it was time for clean up.)
-Made EditorSettings and ProjectSettings search more useful (search in sections too)
2017-07-17 22:18:58 -03:00
Poommetee Ketson 2fd204c35e Refactor 'treshold' to 'threshold' 2017-07-08 22:24:56 +07:00
Juan Linietsky 12a8fedfe6 Some changes to dual paraboloid envmap generation, fixes somme bleeding 2017-07-05 19:39:45 -03:00
Juan Linietsky 5c6cac4e53 Add normalmap support for drawing in all low level primitives. Only added support in Sprite so far. 2017-06-17 23:27:42 -03:00
Juan Linietsky 98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Juan Linietsky 74808ac4d9 New particle system, mostly working, some small features missing. 2017-04-06 23:49:27 -03:00
Rémi Verschelde debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Hein-Pieter van Braam b696beea65 Correct hash behavior for floating point numbers
This fixes HashMap where a key or part of a key is a floating point
number. To fix this the following has been done:

* HashMap now takes an extra template argument Comparator. This class
gets used to compare keys. The default Comperator now works correctly
for common types and floating point numbets.

* Variant implements ::hash_compare() now. This function implements
nan-safe comparison for all types with components that contain floating
point numbers.

* Variant now has a VariantComparator which uses Variant::hash_compare()
safely compare floating point components of variant's types.

* The hash functions for floating point numbers will now normalize NaN
values so that all floating point numbers that are NaN hash to the same
value.

C++ module writers that want to use HashMap internally in their modules
can now also safeguard against this crash by defining their on
Comperator class that safely compares their types.

GDScript users, or writers of modules that don't use HashMap internally
in their modules don't need to do anything.

This fixes #7354 and fixes #6947.
2017-02-16 18:44:29 +01:00
Rémi Verschelde 2a0ddc1e89 Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
Rémi Verschelde f44ee891be Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
Rémi Verschelde a540e15cd1 Merge pull request #7513 from djrm/compilation_fix
Matrix32 -> Transform2D
2017-01-15 00:27:05 +01:00
Rémi Verschelde 93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Daniel J. Ramirez aafaf2226f Matrix32 -> Transform2D 2017-01-13 01:34:32 -06:00
Juan Linietsky bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00
Juan Linietsky 2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
Juan Linietsky 0f7af4ea51 -Changed most project settings in the engine, so they have major and minor categories.
-Changed SectionedPropertyEditor to support this
-Renamed Globals singleton to GlobalConfig, makes more sense.
-Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available
2017-01-05 09:16:00 -03:00
Rémi Verschelde 3f3f5a5359 Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
2017-01-02 21:52:26 +01:00
Rémi Verschelde c7bc44d5ad Welcome in 2017, dear changelog reader!
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer
with state-of-the-art rendering techniques tuned to work as low as middle
end handheld devices - without compromising with the possibilities given
for higher end desktop games of course. Great times ahead for the Godot
community and the gamers that will play our games!
2017-01-01 22:03:33 +01:00
Juan Linietsky a47c78aed1 Screen space reflection effect 2016-11-29 19:55:12 -03:00
Rémi Verschelde f34151ff0f style: Various other PEP8 fixes in Python files
Done with `autopep8 --select=E7`, fixes:

- E701 - Put colon-separated compound statement on separate lines.
- E702 - Put semicolon-separated compound statement on separate lines.
- E703 - Put semicolon-separated compound statement on separate lines.
- E711 - Fix comparison with None.
- E712 - Fix (trivial case of) comparison with boolean.
- E713 - Fix (trivial case of) non-membership check.
- E721 - Fix various deprecated code (via lib2to3).
2016-11-01 00:35:16 +01:00
Rémi Verschelde 97c8508f5e style: Start applying PEP8 to Python files, indentation issues
Done with `autopep8 --select=E1`, fixes:

- E101 - Reindent all lines.
- E112 - Fix under-indented comments.
- E113 - Fix over-indented comments.
- E115 - Fix under-indented comments.
- E116 - Fix over-indented comments.
- E121 - Fix a badly indented line.
- E122 - Fix a badly indented line.
- E123 - Fix a badly indented line.
- E124 - Fix a badly indented line.
- E125 - Fix indentation undistinguish from the next logical line.
- E126 - Fix a badly indented line.
- E127 - Fix a badly indented line.
- E128 - Fix a badly indented line.
- E129 - Fix a badly indented line.
2016-11-01 00:33:51 +01:00
Rémi Verschelde fc8ccd5b8c SCsub: Add python shebang as a hint for syntax highlighting
Also switch existing shebangs to "better" /usr/bin/env python.
2016-10-17 20:10:46 +02:00
Rémi Verschelde 248bc9159c drivers: Refactor SCsub and drop redundant env_drivers clone
The reordering of the SConscript includes allows to ensure that
stuff like the builtin zlib headers will be available for libpng.

Also moved glew back into global env, otherwise windows seems
not to find it... Kind of shooting in the dark with this multi-env
setup.
2016-10-15 18:10:18 +02:00
Juan Linietsky cf5778e51a -Added ViewportContainer, this is the only way to make viewports show up in GUI now
-2D editing now seems to work
-Added some functions and refactoring to Viewport
2016-10-05 01:26:35 -03:00
Juan Linietsky 22d83bc9f6 Begining of GLES3 renderer:
-Most 2D drawing is implemented
-Missing shaders
-Missing all 3D
-Editor needs to be set on update always to be used, otherwise it does not refresh
-Large parts of editor not working
2016-10-03 21:35:16 +02:00
Rémi Verschelde 78d97b060a Merge pull request #6605 from zaps166/old-gl-ext-funcs
Add compatibility with old OpenGL 2.1 drivers
2016-10-03 14:21:37 +02:00
mookiexl 0b12ebba11 Limit directional shadow draw distance, fixes #559, optimization (#1991)
* Shadow fadeout exponent hardcoded for now, should be user configurable.
* optimization - skip shadows outside visible range
2016-10-03 12:28:32 +02:00
Rémi Verschelde 463a42c71e Merge pull request #6606 from zaps166/don-crash-on-unsupported-gl
Don't crach when OpenGL version is unsupported
2016-10-03 11:54:49 +02:00
Błażej Szczygieł 7b8fe97888 Don't crash in "_process_hdr()" if "framebuffer.luminance" is empty
If "glFramebufferTexture2D()" fails on old drivers the Vector is empty.
Don't allow to read from empty Vector (NULL pointer).
2016-09-25 13:09:23 +02:00
Błażej Szczygieł ca3b8deb78 Don't crach when OpenGL version is unsupported 2016-09-25 13:06:14 +02:00
Błażej Szczygieł a27fafb273 Add compatibility with old OpenGL 2.1 drivers
If ARB_framebuffer_object is not supported, try to fall-back to
EXT_framebuffer_object if present.

In current version of godot, the way framebuffers are used is backward
compatible with the older EXT_framebuffer_object extension.

Fixes #6591
Done with SuperUserNameMan
2016-09-25 12:58:22 +02:00
knd 708a028ce8 removed redundant assign operation in mesh_add_surface: elem_count is reassigned a value before the old one has been used. 2016-09-21 05:23:42 +03:00
Rémi Verschelde 80861b7d59 Merge pull request #6414 from RandomShaper/improve-shader-shadow
Expose additional light/shadow properties to canvas item shaders
2016-09-17 18:34:22 +02:00
Juan Linietsky e2aad59b59 Merge pull request #5962 from Alex-doc/Y_billboard
Implements Y billboard
2016-09-10 12:12:26 -03:00
Juan Linietsky 7a27d5d9e7 Merge pull request #6363 from vnen/winrt
Fix the support for WinRT/UWP
2016-09-10 11:47:42 -03:00
Pedro J. Estébanez 0960887625 Expose light shadow color to canvas item shaders 2016-09-07 01:52:54 +02:00
Pedro J. Estébanez b69e422af9 Rename misleading define
The macro USE_LIGHT_SHADOW_COLOR actually was being defined when the shader used SHADOW (the output shadow color), not the shadow color set for the light so it's better named USE_OUTPUT_SHADOW_COLOR. In 3D there's not that difference but renaming as well for consistency.
2016-09-07 00:51:03 +02:00
George Marques c9b82498b4
Fix drivers coding for WinRT
- Add a proper function to retrieve IP addresses.
- Solve issues with Windows FileAccess and DirAccess to use the same code
  for WinRT.
- Add patches to the GLES2 rasterizer to workaround ANGLE issues.
2016-09-03 19:36:44 -03:00
Juan Linietsky fb4d6d1db0 More visual script improvements
-Added anti-aliasing on lines
-Improved draw performance enormously
-Removed sequence ports for most nodes, current visual scripts will likely be broken now. Sorry!
2016-08-30 23:46:41 -03:00
Alex Piola c3b9ef8229 Implements Y billboard
Y billboard wasn't hooked up. This commit implements it.
2016-08-01 14:00:30 +02:00
Rémi Verschelde a155342eca GLES2: Check for GPU capabilities to display an error
The engine will still segfault, but the error message should be displayed by the
OS in a blocking manner, so that it will only crash once users have acknowledged
the error dialog.

Closes #1162.
2016-07-25 23:08:46 +02:00
Rémi Verschelde b6ac91c0e6 Removed unused variables (first pass)
Fixes various gcc 5.4.0 warnings for -Wunused-variable and -Wunused-but-set-variable
2016-07-07 23:15:03 +02:00
Geequlim fdf914e53e Add texture region support for stylebox render 2016-06-05 00:45:53 +08:00
Juan Linietsky 8be2fabbe5 Changed import workflow
-Rearrange favorites in fs dock with drag and drop
-Removed import -> sub-scene, moved to scenetree contextual menu
-Removed import -> re-import , moved and integrated to FS dock
-Added ability in FS dock to re-import more than one resource
simultaneously
-Added ability to drag from native filesystem explorer to Godot, only
works on Windows though
-Removed scene reimport merge options, never worked well. Eventually
merging materials should be re-added
-Added ability to set custom root node type when importing scenes
-Re-Import is now automatic, can be configured back to manual in editor
settings
-Added resource previews in property list for many resource types
2016-05-27 14:19:11 -03:00
Juan Linietsky 8043135e0d missing default value 2016-05-04 12:46:37 -03:00
Juan Linietsky fd6667a7dc fix to avoid video texture scaling 2016-05-04 12:44:50 -03:00
Juan Linietsky 89d87294db ability to shrink all images x2 on load
this is for extreme cases when running on devices with very low video
memory, so you can still retain compatibility.
2016-05-04 12:37:07 -03:00
MSC 7a9998370f free Material 'shadow_material_double_sided' on ::finish() 2016-04-03 19:24:14 +02:00
Rémi Verschelde c9a401e541 Merge pull request #3694 from techtonik/patch-1
Show driver information in verbose mode
2016-03-15 10:30:47 +01:00
Rémi Verschelde aec4f57f95 Merge pull request #3528 from SaracenOne/baked_light_realtime_colourize
Ability to colourize baked lighting in real time.
2016-03-15 10:22:09 +01:00
Saracen 24bc7d8db7 Fix 'FLAG_RECEIVE_SHADOWS' flag for GeometryInstances so that turning it off now correctly disables shadows from affecting the instance. 2016-03-12 16:51:17 +00:00
Juan Linietsky a3d6768199 Merge pull request #3958 from SaracenOne/cpu_skinning_path_fix
Fix to CPU skinning path when using GPU skinning (meshes with morphs)
2016-03-08 15:34:36 -03:00
Saracen 7fecebd8a8 Added extra controls to GeometryInstances to control how they should cast shadows: double-sided and shadows only.
Conflicts:
	servers/visual/visual_server_raster.h
2016-03-07 23:14:14 +00:00
Saracen 23a4683879 Fix to CPU skinning path when using GPU skinning (meshes with morphs) causing modifications to root bone to have doubled offset and wasted performance. 2016-03-06 18:47:52 +00:00
anatoly techtonik ba6858dd41 Show which video driver is used in verbose mode 2016-02-24 23:36:40 +03:00
Saracen fe49ac19df Fixed hardware-accelerated skinning support. 2016-02-24 02:16:20 +00:00
Saracen de5281c398 Ability to colourize baked lighting in real time. 2016-02-06 18:03:20 +00:00
Juan Linietsky f6a8a0f513 -Correctly flip BG texture if viewport is flipped, fixes #3507 2016-02-02 07:40:38 -03:00
Juan Linietsky 2fce78ad10 Correct viewport scaling with stretch mode viewport, fixes #1571 2016-01-24 00:46:26 -03:00
Rémi Verschelde d67df42cc8 Merge pull request #2180 from sketchyfun/SketchyFun
Billboards were displayed upside down when drawn to a render texture
2016-01-19 22:25:40 +01:00
Saracen 1cc5ccba1b Allows vec4 shader uniforms to be set by quaternion variant type. 2016-01-13 22:09:07 +00:00
Juan Linietsky 6eb742d49f -Make a rare corner case where disabling/reenabling mipmaps causes invalid texture state. Fixes #3102 2016-01-10 21:45:58 -03:00
Juan Linietsky f6798d9d73 -Made tile parameter work, fixes #3167 2016-01-10 17:45:41 -03:00
Juan Linietsky eca92bb7ac make it impossible to shrink framebuffer < 0, fixes #2066 2016-01-02 21:08:57 -03:00
Juan Linietsky 8fb70142e4 Ability to use opacity on distance field textures, fixes #2148 2016-01-02 15:57:19 -03:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
reduz 77b5b4f4df removed some prints 2015-12-29 12:56:58 -03:00
Juan Linietsky 428984ec0c -New mask mode for lights, makes using masks MUCH easier. 2015-12-08 20:25:08 -03:00
Juan Linietsky e176bb6a7c Merge pull request #2719 from SaracenOne/clipping_fix
Canvas Clipping fix
2015-12-08 17:18:19 -03:00
Saracen 157b97b087 Extended clipping fix to missing clipping-related features. 2015-12-07 13:59:42 +00:00
Juan Linietsky 4b1f0afb01 -several fixes to Android to work better on Tegra 3/4 devices, uses 16 bits FBOs so all 2D shader effects should now work in every single Android device. 2015-12-02 11:15:48 -03:00
Saracen 2cc52bc3ff Modification to GUI in 3D demo to show resolved viewport clipping bug and small fix to bug causing viewport clipping to be inverted. 2015-11-19 23:47:25 +00:00
Saracen dd00452997 Merge branch 'master' of https://github.com/okamstudio/godot into shadow_color
Conflicts:
	drivers/gles2/shader_compiler_gles2.cpp
2015-11-18 23:18:10 +00:00
Juan Linietsky 0c3386b2ed Merge pull request #2707 from akien-mga/master
Cosmetic fixes to SCons buildsystem
2015-11-18 19:43:28 -03:00
Juan Linietsky f0aeb036d1 Merge pull request #2715 from SaracenOne/shader_fix_and_enhancement
Write to 4-dimensional position access and shader graph code generation fix.
2015-11-18 19:36:47 -03:00
Juan Linietsky 0fd3e18818 Merge pull request #2724 from SaracenOne/disable_baked_light_sampling_on_shadeless
Disable baked lighting sampling on shadeless materials.
2015-11-18 19:31:18 -03:00
Juan Linietsky 1ceefd4759 Merge pull request #2661 from romulox-x/lowMem2D
Added low_memory_2d_mode
2015-11-18 19:12:34 -03:00
Aren Villanueva 402c24ec8b iOS compile fixes. 2015-11-16 11:10:07 +11:00
Saracen c1d19ad258 New shader feature: change the colour of shadows on a per-material basis.
Conflicts:
	drivers/gles2/shader_compiler_gles2.cpp
2015-11-08 03:54:55 +00:00
Saracen 539bbd6654 Disable baked lighting sampling on shadeless materials. 2015-11-02 17:30:18 +00:00
Saracen ff363c94db Another clipping fix: default back to using window size to calculate clipping on viewports which don't have a rendertarget which fixes clipping on the editor viewport. 2015-11-02 16:48:11 +00:00
Saracen 5072134f41 Fixed canvas clipping on offscreen viewports. 2015-11-02 16:48:09 +00:00
Saracen b54d96ceba Added ability to write directly to 4-dimensional position vector from within custom vertex shader code. Bugfixes to shader graph code generation concerning xforms. 2015-11-02 16:03:31 +00:00
Rémi Verschelde 399b1b0474 Cosmetic fixes to SCons buildsystem
- Removed trailing spaces
- Made sure all indentation is done using tabs (fixes #39)
- Potentially fixed an identation issue for openssl check
2015-11-01 20:53:26 +01:00
romulox_x b86e3c3402 added low_memory_2d_mode, to indicate when 3D post processing buffers and viewport depth buffers should not be allocated 2015-10-21 19:23:34 -07:00
Juan Linietsky b59c86f6f9 -Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
2015-10-21 09:50:44 -03:00
Juan Linietsky 5d86a25f4d -some fixes to where screen is read from rasterizer
-fixed bug in ogg vorbis looping
-properly flushing audiostream rb when stopping
2015-10-19 18:47:49 -03:00
Juan Linietsky 79e5ced7e6 -A little More control about pixel snapping in 2D 2015-10-13 15:53:34 -03:00
romulox_x 187c000ab5 removed unnecessary clear, which prevented root viewport from working right when told not to clear 2015-10-01 13:30:10 -07:00
Juan Linietsky 83d9a692be Ability to visually debug geometry visually:
-Visible 2D and 3D Shapes, Polygons, Tile collisions, etc.
-Visible Navmesh and Navpoly
-Visible collision contacts for 2D and 3D as a red point
-Customizable colors in project settings
2015-09-20 13:03:46 -03:00
steve b0e5031f1f ios now displays splash screen between launch image and main scene, instead of a black screen 2015-09-10 15:01:02 -07:00
Juan Linietsky b0aa49accb merged some stuff for okam 2015-09-03 23:24:55 -03:00
romulox_x 85e49d4e75 added support for mirrored repeat texture wrapping 2015-06-25 14:51:21 -07:00
Juan Linietsky 52308aba68 ability to change shadow color in light2d 2015-06-24 18:15:43 -03:00
BenH d807a22981 Billboards were being displayed upside down when drawn to a render texture
Render texture's view transforms seem to be inverted, so when drawing
billboards, the 'up' vector given to set_look_at() is also inverted and
so the billboard gets drawn upside down.
2015-06-24 21:06:31 +01:00
Juan Linietsky 4b35654a02 Update rasterizer_gles2.cpp
fixed camera plane
2015-06-12 09:54:19 -03:00
Juan Linietsky 9e479065f5 new space shooter demo
ortho camera sort fix, closes #2063
2015-06-11 10:00:48 -03:00
Juan Linietsky 9acab32daa new file dialog!
-ItemList control for easier lists/thumbnails
-New file dialog, with support for thumbnails, favorites, recent places,
etc
-Moved .fscache out of the project, no more bugs due to committed/pulled
.fscache!
-Dir dialog now sorts directories
2015-06-06 09:44:38 -03:00
Juan Linietsky f4caddbc23 -corrected frac() and hyperbolic sin,cos,tan when running on PC (GLSL120), fixes #1775 2015-05-04 10:53:54 -03:00
Juan Linietsky c45ffc2ca9 -fixed old condition in TextureFrame that caused bugs in materials, closes #1742 2015-05-01 12:16:51 -03:00
Juan Linietsky 5c6b31c024 -fixed broken lighting in release version of godot for isometric light demo, fixes #1697 2015-04-30 11:34:24 -03:00
Juan Linietsky 0adca0a7c9 -made normalmaps easier in 2D, fixes #1467 2015-04-27 08:11:54 -03:00
Juan Linietsky 52e2f4606f -Objects with BlendMode!=MIX do not get affected by CanvasModulate, fixes #1724 2015-04-24 23:46:42 -03:00
Juan Linietsky 59154cccf9 -Changed Godot exit to be clean.
-Added more debug information on memory cleanliness on exit (if run with -v)
-Fixed several memory leaks, fixes #1731, fixes #755
2015-04-20 19:38:02 -03:00
Juan Linietsky a5cbfbbcbb -fixed relative path saving to file, fixes #1694 2015-04-18 16:33:31 -03:00
Juan Linietsky fdaa2920eb Updated copyright year in all headers 2015-04-18 14:38:54 -03:00
Juan Linietsky 3b434eacde Fix clipping when used in viewport or inside another viewport, fixes #1661 2015-04-14 22:05:14 -03:00
Juan Linietsky e573d3a945 fixed broken lighting, closes #1671 2015-04-12 20:41:25 -03:00
Juan Linietsky f9906eeac8 -Fixed screen capture for viewports, added a screen capture demo, fixes #1529 2015-04-12 18:58:05 -03:00
Juan Linietsky d148a03848 -Fixes bug in ShaderGraph material, when uniform property is not used, fixes #1634 and #1610 2015-04-09 00:29:21 -03:00
Juan Linietsky b135cdbf05 Merge pull request #1531 from vkbsb/h5_canvas_polygon_fix
H5 canvas polygon fix
2015-04-07 20:22:58 -03:00
Juan Linietsky b36e41cb71 Added a PVRTC encoder for iOS 2015-04-06 21:48:20 -03:00
Juan Linietsky 5d99e15e43 fix shadow issue with lights in mix mode, i think fixes #1611 2015-04-03 14:36:10 -03:00
Juan Linietsky 9fa1698c74 Changes to Light
-=-=-=-=-=-=-=-=

-Changed material unshaded property for an enum, which supports light-only shading
-Added a "Mix" shading mode, useful for using lights as masks
-Added energy parameter to Light2D
2015-04-03 01:43:37 -03:00
Juan Linietsky 68e42f53ba Beta1 Attempt #1
-=-==-=-=-=-=-=-

-Small fixes in canvas item light shader
-Fixed compilation in server target
-Export for Android makes 32 bits display as default
-changed version to 1.1beta1
2015-04-02 12:59:23 -03:00
Juan Linietsky 76c2b9d812 fix shadow attenuation 2015-04-01 12:23:13 -03:00
Juan Linietsky 7fc4059b13 read depth fixes 2015-03-31 17:57:16 -03:00
Juan Linietsky ad634876b5 fixes for light2d in androids that do not support
read depth
2015-03-31 14:59:28 -03:00
reduz 7f8a0cddcf fixes to shader to get most new demos working on mobile 2015-03-25 22:56:35 -03:00
V.VamsiKrishna 4fa71a6ee0 Removing Print statement effects perf. 2015-03-21 22:25:48 +05:30
V.VamsiKrishna 372fa5277c Fix for canvas_draw_polygon on webgl. 2015-03-21 10:12:25 +05:30
Juan Linietsky acc6f3b285 signed distance field font support 2015-03-21 00:43:33 -03:00
Juan Linietsky 53e1694e1e New option to send canvas to render buffer
allows to use 3D environment effects for post processing such as Glow,
Bloom, HDR, etc. in 2D.
2015-03-16 01:14:59 -03:00
Juan Linietsky 650e13f3cd back buffer copy node, to improve on texscreen()
back buffer copy node and respective demo
2015-03-12 01:05:50 -03:00
Juan Linietsky 91744e9ed3 New Demo, Screen Space Shaders
-Fixes to screen space shaders.
-Fixes to isometric light demo.
2015-03-10 00:53:50 -03:00
Juan Linietsky 09489e3a78 lot of work on 2D lighting and isometric maps
added a new demo, isometric_light that does full isometric sorting,
lights, shadows, etc.
2015-03-09 02:34:56 -03:00
Juan Linietsky a0ee5cc353 time was not being set properly with the rest of the uniforms. 2015-03-02 19:21:46 -03:00