Commit graph

1508 commits

Author SHA1 Message Date
PouleyKetchoupp
f9544716f4 Option for software skinning in MeshInstance
Option in MeshInstance to enable software skinning, in order to test
against the current USE_SKELETON_SOFTWARE path which causes problems
with bad performance.

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2020-10-08 16:14:55 +02:00
Marcel Admiraal
6c4a02479d
Fix how Line2D obtains the other object's supports
Measure the distance from the line against the rotated object, not the
rotated line, when obtaining the object's supports against a line.

(cherry picked from commit 7e44682c03)
2020-10-04 20:54:35 +02:00
Rémi Verschelde
0845fbb51b
Merge pull request #32475 from lawnjelly/hideshadow
Showing and hiding geometry updates shadows (3.2)
2020-10-02 11:39:47 +02:00
Rémi Verschelde
66cbcc1b7e
Merge pull request #41123 from lawnjelly/octree_fix
Optimize octree and fix leak
2020-09-30 23:11:31 +02:00
John Pennycook
f8cc7893d0
Make YSort stable
Keeps track of the order in which items are collected by
_collect_ysort_children, and uses that order to break
ties between items with similar Y positions.

(cherry picked from commit 8d3afa985b)
2020-09-29 13:57:57 +02:00
Fabio Alessandrelli
6dffc1ef46
Ignore thread models when compiling with NO_THREAD
The thread model option for physics (2D) and rendering (single-unsafe,
single-safe, multithread), was causing crashes/locks when set as
multithreaded and exported for a platform that does not support threads
(namely HTML5).

This commit ensures that when threads support is not available, that
option is ignored, and the equivalent of "single-unsafe" is always used
instead.

(cherry picked from commit f3c6ac1d71)
2020-09-24 14:43:08 +02:00
Keegan Owsley
777d90d7a1
Wrap angles to (-pi, pi) in momentum calculation.
Fixes a bug that causes KinematicBody2Ds to produce too much angular
momentum when rotating beyond 180 degrees.

(cherry picked from commit e148338d42)
2020-09-24 14:43:06 +02:00
Markus Sauermann
d2636cd30f
Wake up RigidBody 2D after applying torque
(cherry picked from commit 8335f00949)
2020-09-24 14:43:05 +02:00
Rémi Verschelde
c8859f0463
Fix typos with codespell
Using codespell 1.17.1.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2020-09-18 14:09:51 +02:00
Marcel Admiraal
fc72c3fdf5 Remove the unnecessary sync() and the restrictions it imposes on 3D Physics. 2020-09-18 10:42:59 +01:00
Fredia Huya-Kouadio
0af5cded1e Fix the update logic for user-added custom defines.
The previous logic was causing the (unintentional) removal of custom defines automatically added by the engine.
2020-09-06 21:31:09 -07:00
lawnjelly
667c970b77 Optimize octree and fix octree leak
Prevents adding new octants until a limiting number of elements have been added to the current octant. This enables balancing the benefits of brute force against the benefits of spatial partitioning. The limit can be set per octree.

Project settings are added for rendering octree to set the best balance per project depending on number of tests per frame / tick, and the amount of editing of the octree.

Fixes octants being leaked when removing elements.

Optimize octree with cached linear lists

Storing elements in octants using linked lists is efficient for housekeeping but very slow for testing. This optimization stores additional local_vectors with Element pointers and AABBs which are cached and only updated when a dirty flag is set on the octant.

This is selectable with 2 versions of Octree : Octree and Octree_CL, Octree being the old behaviour. At present the cached list version is only used for the visual server octree (rendering) as it has only been demonstrated to be faster there so far.

This uses slightly more memory (probably a few kb in most cases) but can be significantly faster during testing (culling etc).

Co-authored-by: Sergey Minakov <naithar@icloud.com>
2020-08-18 11:02:21 +01:00
clayjohn
8571f7b041 Check arrays before generating Polygon2D AABBs 2020-08-16 21:08:52 -07:00
Rémi Verschelde
f4d6830949
Merge pull request #40869 from clayjohn/3.2-polygon-aabb
Properly calculate polygon2D AABB with skeleton
2020-07-31 12:55:47 +02:00
clayjohn
32928c2112 Properly calculate polygon2D AABB with skeleton 2020-07-30 16:40:05 -07:00
Holger Dammertz
efe6b50f17 Added option to enable high precision float in GLES2
An additional project setting under rendering/gles2/compatibility with the name
enable_high_float.Android is introduced that enables #define USE_HIGHP_PRECISION
in GLES2 shader on Android when it is supported by the shader compiler.
This fixes #33633 and #32813 and also https://github.com/GodotVR/godot_oculus_mobile/issues/60
and https://github.com/GodotVR/godot_oculus_mobile/issues/68 on devices that
support the highp (high precision) modifier.
2020-07-30 05:40:15 +02:00
Rémi Verschelde
400a780050 Revert "Allow Area2D and 3D mouse events without a collision layer"
This reverts commit 15850687a8.
2020-07-27 22:46:04 +02:00
Juan Linietsky
ceeb690476 Properly pass safe margin on initialization.
Fixes jitter.

(cherry picked from commit 13e0385702)
2020-07-15 12:48:18 +02:00
Rémi Verschelde
d2be483e96
Merge pull request #40406 from Chaosus/fix_shader_3.2
[3.2] Fix some incorrect conversions which lead to crash in shaders
2020-07-15 09:13:41 +02:00
Yuri Roubinsky
ecd54630ef [3.2] Fix some incorrect conversions which lead to crash in shaders 2020-07-15 06:36:24 +03:00
Tomasz Chabora
15850687a8 Allow Area2D and 3D mouse events without a collision layer
Co-authored-by:    Tomasz Chabora <kobewi4e@gmail.com>
2020-07-11 11:14:12 +01:00
Marcel Admiraal
ccdfaf2491 Remove elements from monitored_bodies and monitored_areas as they are
processed before calling the callback, instead of after they have all
been processed, because the callbacks may readd them.
2020-07-04 10:08:33 +01:00
Cevantime
6206f4439d fix laxist collision detection on one way shapes
(cherry picked from commit 23f7d2c29d)
2020-07-03 15:34:30 +02:00
Fabio Alessandrelli
d06ad40757 Add default 50ms output_latency web override.
Hopefully a good tradeoff between latency and performance on most
browsers.
2020-07-02 14:30:23 +02:00
Rémi Verschelde
63fd0d37ed
Merge pull request #39895 from madmiraal/fix-39768-3.2
[3.2] Trigger broadphase update when changing collision layer/mask.
2020-06-29 21:34:56 +02:00
Marcel Admiraal
de284ea5d2 Trigger broadphase update when changing collision layer/mask, and
check for collision layer/mask changes in 2D hash grid broadphase update.
2020-06-27 18:11:21 +01:00
Yuri Roubinsky
891b84a833 [3.2] Prevents usage of return in main shader functions 2020-06-27 17:38:22 +03:00
Yuri Roubinsky
474b178534 [3.2] Fix shader crash if pass const argument to 'out/inout' parameter 2020-06-25 10:27:37 +03:00
Marcel Admiraal
b006f5402d Check for motion in cast_motion() before doing Bullet convexSweepTest().
Also ensure that default closest_safe and closest_unsafe values are
defined in cast_motion() and before cast_motion() is called.
2020-06-21 16:28:01 +01:00
Ev1lbl0w
17c87d2ec1
Expose disable_render_loop property to GDScript 2020-06-18 11:59:29 +01:00
Marcel Admiraal
a48e13101d Ensure pair callback data is set to null when it's null. 2020-06-13 14:37:40 +01:00
Rémi Verschelde
3fb9c776ff
Merge pull request #39437 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 8th batch
2020-06-10 17:33:50 +02:00
Rémi Verschelde
3c7e03510c
Merge pull request #39256 from lawnjelly/tilemap_pixel2
GLES2 batching - Add UV precision adjustment for tilemaps
2020-06-10 15:52:00 +02:00
Rémi Verschelde
7bf9787921 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.

(cherry picked from commit cd4e46ee65)
2020-06-10 15:30:52 +02:00
Rémi Verschelde
c9a8309e73
Merge pull request #39169 from lawnjelly/light2d_layer_fix
3.2 Make Light2D respect CanvasLayer layer_min and layer_max
2020-06-10 13:35:37 +02:00
Rémi Verschelde
9901eac9f5
Merge pull request #39400 from madmiraal/fix-39374-3.2
[3.2] Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D.
2020-06-09 13:38:11 +02:00
Marcel Admiraal
5794a4e11e Test collision mask before creating constraint pair in Godot physics
broadphase 2D and 3D.
2020-06-08 17:43:41 +01:00
lawnjelly
1b5c4bc5b7 Make Light2D respect CanvasLayer layer_min and layer_max
As the masked light list takes no account of layer_min and layer_max, the canvas_layed_id is passed to the _light_mask_canvas_items function where it can be used to reject lights outside the layer range.
2020-06-08 05:41:18 +01:00
lawnjelly
275183ef15 GLES2 batching - Add UV precision adjustment for tilemaps
Scaling tilemaps can cause border artifacts around the edges of tiles. This has been traced to precision issues in the GPU. This PR adds an adjustment to allow a minor contraction of the UVs of rects in order to compensate for the incorrect classification of texels across the UV border.
2020-06-07 16:29:40 +01:00
Rémi Verschelde
6e1af78df4
Merge pull request #39068 from lawnjelly/kessel_settings_rename
Rename batching project settings in preparation for GLES3
2020-06-07 14:25:50 +02:00
Pedro J. Estébanez
1ff7b0a0a9 Add shader time scaling
Shaders' `TIME` will be affected by the new shader time scale, that is set via the also new `VisualServer::set_time_scale()`.
2020-06-06 23:59:48 +02:00
lawnjelly
bf54fa5a62 Light2D shadow mask construction fix
When using the default setting (layer 1 set only) nothing is stored in the tscn file for a Light2D, hence it relies on the value in the constructor.

The problem is the constructed value is 1 in Light2D, and -1 in RasterizerCanvas::Light. -1 results in all bits being set so all occluders are shown, rather than just those in layer 1.

This PR changes Rasterizer::Canvas constructor to set to 1. An alternative is to have -1 as the value for layer 1 throughout.
2020-05-30 09:29:38 +01:00
lawnjelly
c7d18dec70 Rename batching project settings in preparation for GLES3
As it now seems like we will soon have GLES3 batching working using the same intermediate layer as GLES2, it makes more sense to reuse the same batching settings for both renderers rather than duplicate project settings for GLES2 and GLES3.
2020-05-26 18:15:35 +01:00
Fabio Alessandrelli
92031098bf Move mixrate and latency definition to AudioServer
Each driver used to define the (same) project settings value, but the
setting names are not driver specific. Ovverriding is still possible via
platform tags.

(cherry picked from commit 90c7102b51)
2020-05-18 16:40:33 +02:00
Marcel Admiraal
253d211102 Silence EQ::Band::c1, c2 and c3 may be used uninitialized warnings.
(cherry picked from commit d02143905f)
2020-05-13 16:12:37 +02:00
Rémi Verschelde
d20485039c
Merge pull request #38453 from lawnjelly/ios_halffloat_hacky
GLES2 disable half-float project setting
2020-05-04 16:29:27 +02:00
lawnjelly
30a3f16e34 GLES2 disable half-float project setting
It seems that particles (and some other features) do not work correctly on iOS in GLES2 because either many of the devices do not support half float compression, or the GL constant used to reference it from Godot is incorrect.

This PR adds a project setting in rendering/gles2/ to disable half-float compression on iOS.
2020-05-04 13:11:23 +01:00
Pedro J. Estébanez
d8be5a9986 Add MODULATE builtin to canvas item shaders 2020-05-04 00:10:24 +02:00
Rémi Verschelde
01a085d05f
Merge pull request #38320 from lawnjelly/kessel_pr_light_join
GLES2 2D batching - item reordering, light joining and light modulate fix
2020-05-01 15:03:03 +02:00
Rhathe
768f4e684c Enable setting of collision iterations in Physics2DServer
This allows fine-tuning of collision iterations for more
accurate collision physics with a performance cost.
2020-05-01 03:49:21 -04:00
lawnjelly
451c3fc0fb GLES2 2D batching - item reordering, light joining and light modulate fix
Although 2D draws in painters order with strict ordering, in certain circumstances items can be reordered to increase batching / decrease state changes, without affecting the end result. This can be determined by an overlap test.

In situation with item:
A-B-A
providing the third item does not overlap the second, they can be reordered:
A-A-B

Items already contain an AABB which can be used for this overlap test.

1)
To utilise this, I have implemented item reordering (only for single rects for now), with the lookahead adjustable in project settings. This can increase performance in situations where items may not be grouped in the scene tree by texture. It can also be switched off (by setting lookahead to 0).

2)
This same trick can be used to help join items that are lit. Lit items previously would prevent joining completely, thus missing out on performance gains other than multi-command items such as tilemaps.

In this PR, lights are assigned as bits in a bitfield (up to 64, the optimization is disabled above this), and on each try_item (for joining), the bitfield for lights and shadows is constructed and compared with the previous items. If these match the 2 items can potentially be joined. However, this can only be done without changing the rendered result if an overlap test is successful.

This overlap test can be adjusted to join items up to a specific number of item references, selectable in project settings, or turned off.

3)
The legacy uniform single rect drawing routine seems to have been identified as the source of flicker, particularly on nvidia. However, it can also be up to 2x as fast. Because of the speed the batching contains a fallback where it can use the legacy single rect method, but I have now added a project setting to make this switchable. In most cases with batching it should not be necessary (as single rects are drawn less frequently) and thus the flickering can be totally avoided.

4)
This PR also fixes a color modulate bug when drawing light passes, in certain situations (particularly custom _draw routines with multiple rects).

5)
This PR also fixes #38291, a bug in the legacy renderer where light passes could draw rects in wrong position.
2020-05-01 07:47:33 +01:00
Rémi Verschelde
da68cece7f
Merge pull request #38338 from RandomShaper/time_rollback_3.2
Improve shader time roll over (3.2)
2020-04-30 09:07:34 +02:00
Rémi Verschelde
8d93303483
Merge pull request #37863 from ExpiredPopsicle/culling5
Fixed false positives in the culling system.
2020-04-30 08:05:11 +02:00
Pedro J. Estébanez
7cc0f181c9 Improve shader time roll over
- Resurrect it for GL ES 2
- Apply roll over with `fmod()` instead of resetting it to 0
- Expose the setting from the `VisualServer`, since it does not belong in any specific rasterizer
2020-04-29 22:33:03 +02:00
Rémi Verschelde
f2150d1766
Merge pull request #37462 from Chaosus/shader_fix_const_order
[3.2] Fix shader constant sorting
2020-04-29 09:41:49 +02:00
Kiri Jolly
2c6e859c2d Fixed unbounded dual-paraboloid shadow map culling.
Dual paraboloid shadowmaps were ending up with infinitely large volumes of area behind the hemisphere un-culled.

This change just adds a back plane to the convex shape used for the culling volume.
2020-04-28 17:13:36 -07:00
Rémi Verschelde
008e0748c1
Merge pull request #37349 from lawnjelly/kessel32_1
GLES2 2d Batch rendering (across items)
2020-04-17 12:55:33 +02:00
lawnjelly
72adefa5cf Add frame diagnostics for GLES2 Batch renderer
Added project setting to enable / disable print frame diagnostics every 10 seconds. This prints out a list of batches and info, which is useful to optimize games and identify performance problems.
2020-04-17 08:54:33 +01:00
Marcel Admiraal
3e71992eda Assign zero to range when ConvexPolygonShape2D is empty.
(cherry picked from commit 88d307df14)
2020-04-16 12:57:22 +02:00
lawnjelly
b6d652367b Items and draw calls added to IDE Monitor in '2d' section
This adds 2 new values (items and draw calls) to the performance monitor in a '2d' section, rather than reusing the 3d values in the 'raster' section.

This makes it far easier to optimize games to minimize drawcalls.
2020-04-16 11:52:22 +01:00
lawnjelly
93af8e7d1b Batching across z_indices
Extra functions canvas_render_items_begin and canvas_render_items_end are added to RasterizerCanvas, with noop stubs for non-GLES2 renderers. This enables batching to be spready over multiple z_indices, and multiple calls to canvas_render_items.

It does this by only performing item joining within canvas_render_items, and deferring rendering until canvas_render_items_end().
2020-04-12 13:52:25 +01:00
lawnjelly
45b0b8bff8 GLES2 2d Batch rendering (across items)
2d rendering is currently bottlenecked by drawing primitives one at a time, limiting OpenGL efficiency. This PR batches primitives and renders in fewer drawcalls, resulting in significant performance improvements. This also speeds up text rendering.

This PR batches across canvas items as well as within items.

The code dynamically chooses between a vertex format with and without color, depending on the input data for a frame, in order to optimize throughput and maximize batch size. It also adds an option to use glScissor to reduce fillrate in light passes.
2020-04-04 17:13:58 +01:00
Yuri Roubinsky
ee93c85ef1 Fix shader constant sorting 2020-03-31 14:32:33 +03:00
Rémi Verschelde
acd14e645a Remove unused classes and stray headers
Found by reviewing headers with 1 or less matching includes:
```
find -name thirdparty -prune -o -name "*.h" -exec basename {} \; | sort -u > headers
for header in $(cat headers); do echo "$header: "; rg -l "#include \"(.*/)?$header\"" | wc -l; done > list-includes
```

(cherry picked from commit 9d24541597)
2020-03-25 11:38:54 +01:00
Yuri Roubinsky
4dd1eee769 Enables passing out built-in parameter from parent function in shaders
(cherry picked from commit 7a2c6a8c0e)
2020-03-25 11:38:53 +01:00
Rémi Verschelde
cc70b2fa0a
Merge pull request #36342 from m4gr3d/external_texture_support_for_godot_3_2
Add support for opengl external textures
2020-03-17 16:29:14 +01:00
Michael Alexsander
bd2a2a7e40 Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()'
(cherry picked from commit 8c8c48a7ad)
2020-03-06 23:51:26 +01:00
fhuya
30d738eda7 Add support for opengl external textures as defined by https://www.khronos.org/registry/OpenGL/extensions/OES/OES_EGL_image_external.txt 2020-03-05 13:09:49 -08:00
Bastiaan Olij
0ab8889c0d Exposing get_tracker_id for ARVRPositionalTracker to GDScript
(cherry picked from commit f0b1edef8b)
2020-03-04 12:52:47 +01:00
Rémi Verschelde
ac63e5d613 Workaround WebM playback bug after AudioServer latency fixes
af9bb0ea15 fixed AudioServer's
`get_output_delay()` (which used to always return 0) while renaming it
to `get_output_latency()`. It now returns the latency from the
AudioDriver, which can be non-0.

While this was a clear bugfix, it broke playback for WebM files without
audio track. It seems like the playback code, even though it queried
the output delay to calculate a time compensation, was designed to work
even though the delay value was actually bogus. Now that it's correct,
it's not working.

As a workaround we comment out uses of the output latency, restoring
the behavior of Godot 3.1.

This code should still be reviewed by someone more versed in video
playback and fixed to properly account for the non-0 driver latency.

Fixes #35760.

(cherry picked from commit da411d1625)
2020-02-14 16:02:34 +01:00
Yuri Roubinsky
3b2490f19c Prevent shader crash if invalid builtin used after array member accessor
(cherry picked from commit 3a70566b15)
2020-02-14 16:02:21 +01:00
nathanwfranke
2d8289579a Fix bug where Control at origin with 0 size not rendered
Make a new method instead to make the code more elegant


Move Function down a bit


(cherry picked from commit e5cb557b73)
2020-02-14 15:56:12 +01:00
Yuri Roubinsky
0995696e08 Prevent shader crash when name conflict with "dus" and "__" occured
(cherry picked from commit 2c4367441c)
2020-02-06 13:02:07 +01:00
Rémi Verschelde
bb6c0d3e8b doc: Complete documentation for VideoStreams
Also quick clean up of the matching C++ files.
2020-01-26 11:29:07 +01:00
clayjohn
eb5cb5d016 Add project setting for max irradiance size 2020-01-25 13:27:13 -08:00
Yuri Roubinsky
3473a195fc Hides high-level functions from GLES2 shader autocompletion 2020-01-23 12:41:21 +03:00
Rémi Verschelde
46820527de
Merge pull request #35360 from Chaosus/restrict_uint_gles2
Disallow uint/uvec usage on GLES2 platform
2020-01-23 10:12:30 +01:00
Rémi Verschelde
37897dba80
Merge pull request #35406 from lawnjelly/ortho-shadow
Replace CameraMatrix::get_viewport_size with get_viewport_half_extents, shadow culling with ortho camera and other affected issues
2020-01-22 22:02:09 +01:00
lawnjelly
eaf8e5ce52 Change CameraMatrix::get_viewport_size to get_viewport_half_extents
Fixes #26637.
Fixes #19900.

The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.

Code which called this function has also been modified accordingly.

This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.

It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
2020-01-22 18:22:00 +00:00
Rémi Verschelde
4faaf6089a Remove unused #if 0'ed code 2020-01-21 21:41:54 +01:00
Yuri Roubinsky
4c456ef979 Disallow uint/uvec usage on GLES2 platform 2020-01-20 18:59:35 +03:00
Rémi Verschelde
837adb30fd Revert "Exposes capture methods to AudioServer + documentation" #30468
Reverts the following commits:

- c81ec6f26d:
  "Exposes capture methods to AudioServer, variable renames for
  consistency, added documentation."
- 47c558b98a:
  "Expose audio callbacks as signals."
- dabaa11b3c:
  "Fix to make sure the capture buffers are deallocated at shutdown.
  Silences warnings."

Some documentation improvements were kept for pre-existing methods.

See rationale for reverting these changes in #30468.
2020-01-20 13:18:01 +01:00
Yuri Roubinsky
3dea1c725e Clears completion_class in shaders (may cause troubles if not). 2020-01-19 16:35:54 +03:00
Yuri Roubinsky
1eb8d5e142 Added missing form of array constructor in shaders 2020-01-18 11:41:55 +03:00
Rémi Verschelde
669cd46495
Merge pull request #35215 from clayjohn/multimesh-error
Add multimesh format max for proper error checking
2020-01-16 23:06:20 +01:00
Rémi Verschelde
6fd4afa96b
Merge pull request #33615 from raphael10241024/fix_shape_change
refresh area2d collision when shape changes
2020-01-16 22:56:16 +01:00
clayjohn
041fa57a88 Add multimesh format max for proper error checking 2020-01-16 13:31:17 -08:00
Yuri Roubinsky
5098232ee6 Disabled array initialization, const array and arr.length in shaders 2020-01-16 11:46:11 +03:00
clayjohn
3579187f90 Make texture_debug_usage thread safe 2020-01-12 15:22:54 -08:00
Yuri Roubinsky
1e154e0947 Fix nested break/return in shader switch statement 2020-01-10 11:57:56 +03:00
Rémi Verschelde
5edd1a27d2
Merge pull request #34671 from Chaosus/shader_hex_support
Support for hex numbers in shaders
2020-01-08 10:01:49 +01:00
Hugo Locurcio
0cad2c0cd1
Add VisualServer methods to get the video adapter name and vendor
These methods can be used in scripts to retrieve the OpenGL
`GL_RENDERER` and `GL_VENDOR` strings (respectively).

This closes #28404.
2020-01-06 00:37:56 +01:00
Rémi Verschelde
fa82664419
Merge pull request #34726 from nekomatata/polygon2d-antialiasing-fix
Fixed antialiasing option for Polygon2D with concave/hollow shapes
2020-01-03 14:17:05 +01:00
PouleyKetchoupp
1591677eb8 Fixed antialiasing option for Polygon2D
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases.

Fixes #34568
2020-01-01 11:40:14 +01:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Yuri Roubinsky
99b92c885f Support for hex numbers in shaders 2019-12-29 12:19:10 +03:00
Catchawink
86096313be Fixed an issue with recording audio.
Prior to this fix, AudioEffectRecordInstance::init() was called before recording_active is set to true in AudioEffectRecord::set_recording_active(). This was setting is_recording to false in AudioEffectRecordInstance, because is_recording updates to the value of recording_active in AudioEffectRecordInstance::_io_thread_process(). To fix this issue, AudioEffectRecordInstance::init() is now called after recording_active is set to true.
2019-12-12 10:28:46 -05:00
Rémi Verschelde
2845e6a21a
Merge pull request #34040 from qarmin/unused_variable_more_precise_numbers
Removed unused variables, add some constants numbers
2019-12-10 08:25:31 +01:00
Rafał Mikrut
ed1c4bc77d Removed unused variables, add some constants numbers 2019-12-10 05:13:02 +01:00
Rémi Verschelde
4eff13d768 doc: Markup fixes for enums and constants 2019-12-06 23:09:20 +01:00
Rémi Verschelde
99b81aa1b9
Merge pull request #34039 from Eoin-ONeill-Yokai/multimeshfix
Added Missing Binding for `multimesh_create` to VisualServer
2019-12-05 06:49:43 +01:00
Eoin O'Neill
f7f7544997 Added method binding for multimesh_create that was missing from VisualServer class. 2019-12-04 16:00:18 -08:00
Rémi Verschelde
e77c34ab4a
Merge pull request #34061 from Chaosus/fix_shader_const
Fix expressions for global constants in shaders
2019-12-03 08:53:55 +01:00
Rémi Verschelde
10bae7c05b
Merge pull request #33857 from nekomatata/polygon-2d-antialiasing
Fixed antialiased option for Polygon2D
2019-12-03 07:51:16 +01:00
Yuri Roubinsky
8b8faf03d5 Fix expressions for global constants in shaders 2019-12-02 19:00:21 +03:00
bruvzg
2ef8c5fac5
iOS modular build and export implementation. 2019-12-01 21:57:18 +02:00
PouleyKetchoupp
e6ebc43d72 Fixed antialiased option for Polygon2D / Line2D
Polygon2D:
The property wasn't used anymore after switching from canvas_item_add_polygon() to canvas_item_add_triangle_array() for drawing.

Line2D:
Added the same property as for Polygon2D & fixed smooth line drawing to use indices correctly.

Fixes #26823
2019-11-28 22:57:27 +01:00
Bojidar Marinov
2952dc3fe2
Fix crash when disabling a YSort node
Fixes #33932
2019-11-27 10:47:11 +02:00
Marcel Admiraal
6c3be2ca74 Fix Visual Studio throwing C4146 warning. 2019-11-18 15:14:04 +00:00
RaphaelHunter
8330e70e2c refresh area2d collision when shape changes, close #33369 2019-11-14 15:48:41 +08:00
Rémi Verschelde
4b8feff594
Merge pull request #33518 from BastiaanOlij/msaa_ext_modes
Add MSAA mode for Quest
2019-11-11 11:46:50 +01:00
Bastiaan Olij
4e2343160c Add special external MSAA modes for GLES2 Rift S/Quest and OpenXR optimisation 2019-11-11 21:02:06 +11:00
Rémi Verschelde
2143f46df2
Merge pull request #33516 from qarmin/small_fixes
Memory leaks and crash fixes
2019-11-10 10:17:19 +01:00
Rafał Mikrut
7dda9309f9 Memory leak and crash fixes 2019-11-10 09:49:13 +01:00
PouleyKetchoupp
530665197f Fixed Particles restart after visibility has been set to off and on again
Make sure particles are processed during the same frame when visibility is set to on, in case they are still active from before and need to be restarted.

Fixed #33476
2019-11-09 09:51:17 +01:00
Rémi Verschelde
621dc7022f
Merge pull request #27742 from rxlecky/camera-replication
Game camera override
2019-11-08 10:02:18 +01:00
Marcel Admiraal
fea58321e6 Fix 'r1' (and r2) may be used uninitialized warning in eq.cpp. 2019-11-08 08:37:06 +01:00
Rémi Verschelde
341f37aaed
Merge pull request #33153 from raphael10241024/fix_occluder
fix occluders positions error under canvas_layer
2019-11-05 14:41:28 +01:00
Yuri Roubinsky
5e44b5be81 Prevents usage of unsupported texture shader types in GLES2 2019-11-03 13:41:15 +03:00
Rémi Verschelde
d89f24b6c9
Merge pull request #33259 from Chaosus/remove_gles2_switch_op
Removed switch operator from GLES2 shader back-end
2019-11-02 19:28:18 +01:00
Yuri Roubinsky
6b7f8558d9 Removed switch operator from GLES2 shader back-end 2019-11-02 12:43:32 +03:00
Rémi Verschelde
af4fd9de9c
Merge pull request #33238 from qarmin/other_fixes
Fix some crashes, overflows and using variables without  values
2019-11-01 22:12:47 +01:00
Rafał Mikrut
9ddb3265e1 Fix some crashes, overflows and using variables without values 2019-11-01 16:16:31 +01:00
Yuri Roubinsky
1b003f3d64 Prevents shader crash on GLES2 if unsupported built-in has been used 2019-10-31 09:21:44 +03:00
Yuri Roubinsky
76eb486413 Added check if field name in the shader is equal to builtin 2019-10-29 15:37:19 +03:00
RaphaelHunter
c4cea10402 fix occluders positions error under canvas_layer, close #32880 2019-10-29 14:51:58 +08:00
Yuri Roubinsky
ef6161532d Fix shader crash if non-boolean expression inserted into "if" 2019-10-28 08:35:33 +03:00
Hugo Locurcio
701581d1d3
Improve error messages related to shader_type
The list of allowed shader types is now displayed if any
`shader_type`-related error is emitted.

This makes it easier to remember which shader types are allowed
when creating a new shader.
2019-10-26 17:43:14 +02:00
Rémi Verschelde
5cdecb8227
Merge pull request #32845 from madmiraal/rigidbody-mode-change
Activate Body(2D)SW when switching to rigid or character mode.
2019-10-25 23:36:17 +02:00
Rafał Mikrut
d468e28874 Fix leak in Physics2DServerSW 2019-10-24 20:12:46 +02:00
Erik
8b0546d93b Implement game camera override
Implemented uniform API in Viewport class to override 2D and/or
3D camera.

Added buttons in 2D and 3D editor viewport toolbars that override
the running game camera transform with the editor viewport camera
transform. Implemented via remote debugger protocol and camera
override API.

Removed LiveEditFuncs function pointers from ScriptDebugger class.
Since the debugger got access to the SceneTree instance (if one
exists), there is no need to store the function pointers. The live
edit functions in SceneTree are used directly instead. Also removed
the static version of live edit functions in SceneTree for the same
reason. This reduced the SceneTree -> Debugger coupling too since
the function pointers don't need to be set from SceneTree anymore.

Moved script_debugger_remote.h/cpp from 'core/' to 'scene/debugger/'.
This is because the remote debugger is now using SceneTree directly
and 'core/' classes should not depend on 'scene/' classes.
2019-10-23 02:51:32 +01:00
Marcel Admiraal
13798746e7 Activate Body(2D)SW when switching to rigid or character mode. 2019-10-15 07:41:13 +02:00
Rémi Verschelde
d0628180ae
Merge pull request #32799 from clayjohn/free_pools
Properly free sky and lightmap caches in multithreaded server
2019-10-13 19:44:04 +02:00
clayjohn
62fb462165 Properly free sky and lightmap caches in multithreaded server 2019-10-13 09:31:00 -07:00
Rémi Verschelde
5d63cf1610
Merge pull request #32767 from madmiraal/body2d-can_sleep-default
Fix mismatch between RigidBody2D and Body2DSW can_sleep defaults.
2019-10-12 14:06:46 +02:00
Marcel Admiraal
42a9ae7a82 Fix mismatch between RigidBody(2D) and Body(2D)SW can_sleep defaults.
- Set Body2DSW can_sleep default to true.

- Set Body2D can_sleep default to true.
2019-10-12 12:11:11 +02:00
Saracen
dabaa11b3c Fix to make sure the capture buffers are deallocated at shutdown. Silences warnings. 2019-10-11 23:40:43 +01:00
Yuri Roubinsky
ada4bcbe30 Fix invalid autocompletion pasting of shader param name 2019-10-08 18:33:22 +03:00
Rémi Verschelde
45577e4233
Merge pull request #32571 from DavidSichma/rect_flip
Correctly flip texture src region
2019-10-08 16:15:45 +02:00
Yuri Roubinsky
76324bec8d Prevent shader crash if name of variable overrides function name 2019-10-06 20:35:41 +03:00
Yuri Roubinsky
d9087e1b44 Prevent shader crash if function call been used on constant 2019-10-06 18:20:05 +03:00
Yuri Roubinsky
5a5a062d61 Fix few redefinition name errors for variable/param/function in shaders 2019-10-06 17:27:28 +03:00
David Sichma
f73e1fae37 Correctly flip texture src region 2019-10-05 16:51:06 +02:00
Yuri Roubinsky
1472fca951 Removed unnecessary shader error log messages 2019-10-02 12:37:22 +03:00
lawnjelly
236ce550c0 Showing and hiding geometry updates shadows
Showing and hiding geometry nodes was not showing or hiding their respective shadows. This fixes this by marking any affected lights as dirty.
Fixes #29856
2019-10-01 19:09:03 +01:00
Rémi Verschelde
dec10dd776
Merge pull request #32051 from qarmin/some_error_explanation
Added some obvious errors explanations
2019-09-25 11:51:54 +02:00
qarmin
17732fe698 Added some obvious errors explanations 2019-09-25 10:28:50 +02:00
Rémi Verschelde
4f294b958f doc: Sync classref with current source
Fix a few missing bindings or unspecified argument names and default values.
2019-09-24 11:52:06 +02:00
Rémi Verschelde
159470df08
Merge pull request #32275 from godotengine/skin_support
Added skin support and simplified APIs to override bone position + glTF 2.0 import fixes
2019-09-23 15:02:15 +02:00
qarmin
50be65bf43 Changed some code found by Clang Tidy and Coverity 2019-09-22 18:45:08 +02:00
Rémi Verschelde
fdc2463a1b
Merge pull request #32150 from luzpaz/typos
Fix misc. source comment typos
2019-09-20 17:09:05 +02:00
luz.paz
91ecd7b6a6 Fix misc. source comment typos
Found using `codespell -q 3 -S ./thirdparty,*.po -L ang,ba,cas,dof,doubleclick,fave,hist,leapyear,lod,nd,numer,ois,paket,seeked,sinc,switchs,te,uint -D ~/Projects/codespell/codespell_lib/data/dictionary.txt `
2019-09-19 14:36:52 -04:00
Rémi Verschelde
28265fb526
Merge pull request #31202 from azagaya/light-data
Create shadow_vec for altering shadow computation
2019-09-19 20:03:04 +02:00
Juan Linietsky
d81ddaf33e Added skin support and simplified APIs to override bone position. 2019-09-18 19:46:32 -03:00
Chaosus
1333ea2a2d Implement shader array support for varyings 2019-09-14 18:23:25 +03:00
azagaya
b835868067 Create shadow_vec for altering shadow computation
In 2.1 and 3.0, light_vec could be modified for altering shadow_computations.
But it broke shadows when rotating light. shadow_vec would do the same, but without breaking
shadows in rotated lights if not used.

Add inverse light transformation to shadow vec, so it's not affected when rotating lights;

Added usage define for shadow vec.

For shadow vec working properly when rotating a light, it's needed to multiply it by light_matrix normalized. Added usage define in order to don't do that if shadow_vec not used.
2019-09-06 13:55:49 -03:00
Yuri Roubinsky
96ea1e6fb0
Merge pull request #31600 from Chaosus/shader_func_return_fix
Fix shader crash when users miss the return statement
2019-08-28 16:39:33 +03:00
Yuri Roubinski
38601dd3e9 Fix shader crash when users miss the return statement 2019-08-28 11:32:33 +03:00
follower
8499033354
Typo fix: "differt" -> "different" 2019-08-28 19:12:54 +12:00
Rémi Verschelde
f2777c04c3
Merge pull request #31596 from Chaosus/shader_switch
Implements switch flow control operator in shaders
2019-08-24 14:47:44 +02:00
Andrii Doroshenko (Xrayez)
718f09ad20 Fix uninitialized inertia value in Body2DSW 2019-08-23 20:13:57 +03:00
Yuri Roubinski
4dda253ee0 Implements switch to shaders 2019-08-23 14:43:09 +03:00
RaphaelHunter
74713fe970 Fix custom inertia in physics2d, closes#30838 2019-08-22 20:30:03 +08:00
Rémi Verschelde
6c607c3564
Merge pull request #31266 from IAmActuallyCthulhu/pr/remove-redundant-author-comments
Remove redundant author doc comments
2019-08-14 13:45:54 +02:00
Yuri Roubinski
a525e3c5ce Implemented do/while loops for shaders 2019-08-13 18:39:55 +03:00
Yuri Roubinski
24417f1975 Force user to initialize local shader constants 2019-08-13 12:31:25 +03:00
IAmActuallyCthulhu
82b9557803
Remove redundant author doc comments 2019-08-12 04:26:38 -05:00
Saracen
d8ba9f1824 Fix recording bus regression. 2019-08-12 08:10:56 +01:00
Cameron Reikes
9f7a166c35 Show that identifier found in function names 2019-08-09 21:15:33 -07:00
Michael Alexsander Silva Dias
5ca7460421 Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories 2019-08-09 11:27:39 -03:00
Rémi Verschelde
7b514d920d
Merge pull request #31099 from Chaosus/shader_local_const
Implemented local shader constants
2019-08-07 15:14:35 +02:00
Rémi Verschelde
ba541bceca
Merge pull request #31077 from qarmin/coverity_bugs
Change some code proposed by Coverity and Cppcheck
2019-08-07 13:49:33 +02:00
Rémi Verschelde
af935af38d
Merge pull request #30468 from SaracenOne/expose_audio_capture
Exposes capture methods to AudioServer + documentation
2019-08-07 13:27:25 +02:00
qarmin
e0b5b21863 Add some code changes/fixes proposed by Coverity and Clang Tidy 2019-08-07 12:54:30 +02:00
Yuri Roubinski
b24b3497d6 Implemented local shader constants 2019-08-05 10:35:53 +03:00
Rémi Verschelde
507e41e698
Merge pull request #30999 from nekomatata/fix-regression-godot-physics
Fixed regression in Godot Physics
2019-07-31 19:47:33 +02:00
PouleyKetchoupp
53ac260d19 Reverted fix that makes sense for collision_solver_2d_sat but not for the 3d version
(original commit: aab8da25ad)

Fixes #30886
2019-07-31 17:36:09 +02:00
IAmActuallyCthulhu
4e617d2ca2
Correct typo and format of comments 2019-07-30 16:43:07 -05:00
santouits
472cda9047 Remove physics thread getting the gl context 2019-07-27 22:08:10 +03:00
Michael Alexsander Silva Dias
12ae7a4c02 Update some dead links in the codebase 2019-07-23 21:06:12 -03:00
Rémi Verschelde
4c943cca2c
Merge pull request #30716 from qarmin/fixed_static_analiser_code
Fix some code found by Coverity Scan and PVS Studio
2019-07-23 15:08:44 +02:00
qarmin
aab8da25ad Fix some code found by Coverity Scan and PVS Studio 2019-07-23 09:14:31 +02:00
Rémi Verschelde
fec28da0ad
Merge pull request #30349 from qarmin/fix_arvr_crash_at_exit
Fix ARVRServer crash at exit
2019-07-20 12:41:56 +02:00
Rémi Verschelde
d15cf7b672
Merge pull request #30576 from qarmin/lgtm_coverage
Changed some code reported by LGTM and Coverity
2019-07-20 12:00:13 +02:00
qarmin
6cbaf7662f Changed some code showed in LGTM and Coverage 2019-07-20 08:09:57 +02:00
Rémi Verschelde
df62bfdd49
Merge pull request #30548 from Calinou/tweak-audio-cutoff-property-hints
Tweak audio cutoff property hints to allow reasonable values only
2019-07-16 08:54:25 +02:00
Chaosus
cfcc9ee9c1 Allows to use non-constants in the local shader array initializer 2019-07-16 08:04:49 +03:00
Chaosus
9379cbc774 Added local array initializer 2019-07-16 07:13:37 +03:00
Saracen
47c558b98a Expose audio callbacks as signals. 2019-07-16 04:10:26 +01:00
Saracen
c81ec6f26d Exposes capture methods to AudioServer, variable renames for consistency,
added documentation.
2019-07-15 15:12:29 +01:00
Chaosus
c37379456f Implemented local shader arrays 2019-07-15 15:57:39 +03:00
Chaosus
e7f5640632 Added missed "textureProjLod" shader built-in overload for 3D textures 2019-07-15 09:59:11 +03:00
Hugo Locurcio
9387114ce1
Tweak audio cutoff property hints to allow reasonable values only
This also makes all cutoff property hints consistent.

This closes #29588.
2019-07-12 22:44:17 +02:00
hbina085
26c0609656 Make the default return value on crash explicit
Noticed that the error condition will return a NULL instead of something more explicit like "false".
Should make the code more readable at a glance.
2019-07-11 23:06:58 -04:00
Chaosus
a2b2da2454 Removed invalid mix shader overloads 2019-07-11 17:16:26 +03:00
Rémi Verschelde
34d7484039
Merge pull request #30455 from qarmin/const_reference
Pass by reference to const
2019-07-10 15:43:15 +02:00
qarmin
01cc7a996b Use reference to constant in functions 2019-07-10 11:54:12 +02:00
Chaosus
4083d0c784 Fix "not" shader function return type 2019-07-09 15:55:00 +03:00
Rémi Verschelde
af80182016
Merge pull request #30407 from qarmin/small_fixess
Fixes minor issues found by static analyzer
2019-07-08 08:16:50 +02:00
qarmin
9a77d748c0 Fixes minor issues found by static analyzer 2019-07-07 23:08:51 +02:00