Commit graph

1438 commits

Author SHA1 Message Date
Juan Linietsky
909c06ee0f
Merge pull request #21806 from JFonS/inspector_uniform_defaults
Set uniform default values in inspector
2018-09-13 18:12:58 -03:00
JFonS
3cedec5f75 Set uniform default values in inspector 2018-09-13 23:05:33 +02:00
Fabio Alessandrelli
01c3c1a07b Properly initialize Winsock on startup
Also fix typo in _get_last_error which caused Winsock connect to fail.
2018-09-13 16:05:47 +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
Wilson E. Alvarez
29c9ea69d1
Removed unused function RasterizerSceneGLES3::_copy_to_front_buffer 2018-09-12 17:17:11 -04:00
Fabio Alessandrelli
30327872e0 Unify StreamPeerTCP/TCP_Server with NetSocket API 2018-09-12 15:56:20 +02:00
Fabio Alessandrelli
1b99806b47 Unify PacketPeerUDP using NetSocket 2018-09-12 15:56:16 +02:00
Fabio Alessandrelli
b4e3be7519 New NetSocket interface, BSD/Win implementation
Unified BSD and Winsock sockets into a single implementation of a
generic NetSocket interface.

This is some ground work for few network improvements:
- Reuse as much code as possible between Posix and Windows.
- Provide a single point of implementation for exotic sdks (consoles).
- Provide platform agnostic StreamPeerTCP and PacketPeerUDP in core.
- Implement connect for UDP allowing for DTLS implementation.
2018-09-12 15:46:37 +02:00
Fabio Alessandrelli
7de28be764 ENet wrapper properly detect disconnect on poll
Now PacketPeerUDP.get_available_packet_count() return -1 if the socket
is in error state.
2018-09-12 12:50:53 +02:00
Fabio Alessandrelli
d3108985e0 Properly reset socket blocking state on close 2018-09-12 12:50:53 +02: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
Marcelo Fernandez
10a4925159 Fix possible crash when switching audio device on WASAPI driver 2018-09-10 15:12:02 -03:00
Bastiaan Olij
0625f5b546 Fixed a theoretical condition where prealpha prevents lighting 2018-09-08 11:40:06 +10:00
Juan Linietsky
072bf41c03 Ability for Light2D to use a proxy texture, fixes #17067 2018-09-06 17:26:38 -03: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
Juan Linietsky
cf834a22dc Ported CPU particles to 2D 2018-08-29 16:48:55 -03:00
Rémi Verschelde
72996df656
Revert "Try closing gracefully before terminating process" 2018-08-27 17:32:43 +02: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
alex-poe
5cd00c3780 fix reinhard tonemapper, modified filmic tonemapper, added internal exposure bias 2018-08-27 10:08:38 +02:00
Rémi Verschelde
0ba84b3f23
Merge pull request #21467 from elasota/fix-3d-textures
Fix some 3D texture issues
2018-08-27 09:51:05 +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
Rémi Verschelde
282c0483c9
Merge pull request #21411 from Crazy-P/fixes-several-resource-leaks
Fixes several resource leaks listed on coverity
2018-08-26 17:35:32 +02: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
Crazy-P
e4af39cbc0 Fixes several resource leaks in ...
- gdscript
- gdscript_compiler
- regex
- android/export
- gles3/rasterizer (scene and storage)
2018-08-26 09:19:02 +08:00
Marcelo Fernandez
5d0622a8de Prevent CoreAudio driver failing on finish if Dummy driver was selected 2018-08-25 10:42:30 -03:00
Juan Linietsky
62233423c7 Fix generation of env map, closes #18880 2018-08-24 13:31:31 -03:00
Juan Linietsky
c6b340ea98
Merge pull request #20712 from marcelofg55/midi_open_close
Add OS::open_midi_inputs and OS::close_midi_inputs
2018-08-24 12:17:14 -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
Juan Linietsky
cf217627c7 Added a more minimal test to avoid crash in #20677 but I dont think this is the cause 2018-08-24 10:15:16 -03: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
Rémi Verschelde
1b6d75a599 Style: Fix code formatting in GLES3 shaders 2018-08-24 13:42:18 +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
ca1c851dbd Try closing gracefully before terminating process
Use a Microsoft recommended way of process termination for the project
process run from the editor. This allows loaded DLLs to receive and handle
DLL_PROCESS_DETACH notification and cleanup any global state before the
process actually exits.
2018-08-20 22:41:06 +02: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
Juan Linietsky
4e55835e48
Merge pull request #18096 from aaronfranke/master
[Core] Split up math_2d.h
2018-08-14 18:58:32 -03: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
Rémi Verschelde
eef9c1f5b5
Merge pull request #20936 from marcelofg55/mingw_compile_err
MinGW compile fix
2018-08-13 20:06:35 +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
Marcelo Fernandez
a9f071c41b MinGW compile fix 2018-08-11 22:51:16 -03:00
Marcelo Fernandez
eb3ab7cbbd Fix compile error with PulseAudio driver and clang 2018-08-11 21:47:26 -03:00
Rémi Verschelde
73cf0fd305
Merge pull request #19106 from SaracenOne/audio_mic
[WIP] Experimental microphone support
2018-08-11 15:24:41 +02:00
Aaron Franke
28fc195339 [Core] Change math_2d includes to vector2 includes where relevant 2018-08-10 14:59:29 -05:00
Juan Linietsky
ea3d997f9d
Revert "added get_creation_time function for gdscript" 2018-08-10 13:29:49 -03:00
Juan Linietsky
275e0d5ee4
Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
2018-08-10 13:28:47 -03: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
Marcelo Fernandez
05fc12ddb6 Add OS::open_midi_inputs and OS::close_midi_inputs 2018-08-04 10:07:46 -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
Juan Linietsky
7b63c6323d Clear color was not correctly being set, fixes #4939 2018-07-29 15:09:42 -03:00
SaracenOne
f045534f86
Merge pull request #7 from marcelofg55/audio_mic_mf2
Added support for single channel inputs for PulseAudio
2018-07-27 23:40:35 +01:00
Marcelo Fernandez
913eec5b04 Added support for single channel inputs for PulseAudio 2018-07-27 17:28:41 -03:00
Saracen
d91183be52 Added pointer to WASAPI input_buffer_write method. 2018-07-27 19:34:07 +01:00
Marcelo Fernandez
597301db34 Renamed AudioDriver audio_input_* vars to input_* 2018-07-27 15:09:03 -03:00
Marcelo Fernandez
e5e4dbb6c9 Added support for single channel inputs for CoreAudio 2018-07-27 14:05:38 -03:00
Saracen
09eafaba62 Implemented capture device selection for PulseAudio (marcelofg55) 2018-07-27 16:50:13 +01:00
Saracen
0a877b58b8 Reset audio input during render device change to keep synchronisation. 2018-07-27 16:50:13 +01:00
Saracen
aca6e291d6 Fixed audio clipping on WASAPI by fixing argument order on AudioClient
Initialize method ensuring a larger capture buffer and adding bounds
to the capture and stream.
2018-07-27 16:50:12 +01:00
Saracen
7142e1d3f7 Fix single channel capture devices on WASAPI. 2018-07-27 16:50:12 +01:00
Marcelo Fernandez
909cf03568 Fixed device capture switching for WASAPI driver 2018-07-27 16:50:11 +01:00
Marcelo Fernandez
2cf8da9d9f Implemented capture device selection for CoreAudio 2018-07-27 16:50:11 +01:00
Marcelo Fernandez
061358d838 Modified Microphone implementation to handle only one device at a time (WIP) 2018-07-27 16:50:10 +01:00
Saracen
76fd9d215c Fixes for microphone clipping and latency (marcelofg55) 2018-07-27 16:50:10 +01:00
Saracen
f85062495c Experimental microphone support. 2018-07-27 16:50:09 +01: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