Commit graph

2036 commits

Author SHA1 Message Date
Rémi Verschelde 7449d6c752
Merge pull request #48435 from BastiaanOlij/no_repeat_mobile_renderer
Remove repeat from forward mobile renderer
2021-05-05 16:19:03 +02:00
Rémi Verschelde 508fbf4abe
Merge pull request #48221 from nekomatata/solver-multithreaded
Godot Physics collisions and solver processed on threads
2021-05-04 09:22:20 +02:00
Bastiaan Olij cc45ed448b Remove repeat from forward mobile renderer 2021-05-04 11:37:58 +10:00
jfons 6995b0429c Assorted fixes to UV unwrapping and GPU lightmapper
Various fixes to UV2 unwrapping and the GPU lightmapper. Listed here for
context in case of git blame/bisect:

* Fix UV2 unwrapping on import, also cleaned up the unwrap cache code.
* Fix saving of RGBA images in EXR format.
* Fixes to the GPU lightmapper:
	- Added padding between atlas elements, avoids bleeding.
	- Remove old SDF generation code.
	- Fix baked attenuation for Omni/Spot lights.
	- Fix baking of material properties onto UV2 (wireframe was
	  wrongly used before).
	- Disable statically baked lights for objects that have a
	  lightmap texture to avoid applying the same light twice.
	- Fix lightmap pairing in RendererSceneCull.
	- Fix UV2 array generated from `RenderingServer::mesh_surface_get_arrays()`.
	- Port autoexposure fix for OIDN from 3.x.
	- Save debug textures as EXR when using floating point format.
2021-05-03 18:10:34 +02:00
Bastiaan Olij 58ff0dac1a Create mobile renderer 2021-05-03 21:54:11 +10:00
Rémi Verschelde dea84c9d28
Merge pull request #48341 from sboron/fix-tangent-issue
Fix broken tangents in vulkan rendering server on godot 4
2021-05-01 13:37:43 +02:00
Stefan Boronczyk 7571348a5f fix-tangents-on-rendering-server 2021-05-01 06:19:40 +02:00
reduz 90056460ad Implement Particle Trails
-Enable the trails and set the length in seconds
-Provide a mesh with a skeleton and a skin
-Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh
-Works deterministically
-Fixed particle collisions (were broken)
-Not working in 2D yet (that will happen next)
2021-04-30 17:38:02 -03:00
Rafał Mikrut efcb097674 Prevent setting too big or too small Collision Mask and Layer 2021-04-30 17:19:04 +02:00
Rémi Verschelde 305b2a15bf
Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
Rémi Verschelde 95cfce661b
Merge pull request #48050 from JFonS/occlusion_culling 2021-04-27 19:07:12 +02:00
Rémi Verschelde 8247667a3e
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
Yuri Roubinsky 3c82f01134 Fix shader handle constant expressions in function call 2021-04-27 15:23:01 +03:00
Rémi Verschelde 83cc6bcf55
Merge pull request #48187 from brakhane/remove-dupe-comments
Remove duplicate comments
2021-04-27 09:42:09 +02:00
PouleyKetchoupp 448c41a3e4 Godot Physics collisions and solver processed on threads
Use ThreadWorkPool to process physics step tasks in multiple threads. Collisions are all processed in parallel and solving impulses is
processed in parallel for rigid body islands.

Additional changes:
- Proper islands for soft bodies linked to active bodies
- All moving areas are on separate islands (can be parallelized)
- Fix inconsistencies with body islands (Kinematic bodies could link
bodies together or not depending on the processing order)
- Completely prevent static bodies to be active (it could cause islands
to be wrongly created and cause dangerous multi-threading operations as
well as inconsistencies in created islands)
- Apply impulses only on dynamic bodies to avoid unsafe multi-threaded
operations (static bodies can be on multiple islands)
- Removed inverted iterations when populating body islands, it's now
faster in regular order (maybe after fixing inconsistencies)
2021-04-26 18:26:00 -07:00
Dennis Brakhane 31d41d83c3 Remove duplicate comments
A few single line comments were duplicated, probably due to bad merges.

This commit removes the obviously duplicate ones.
2021-04-25 20:03:52 +02:00
Maganty Rushyendra ccc375f163 Fix AudioServer Crash when bus count equals 0 2021-04-24 11:22:19 -04:00
jfons 4d9d99bb82 Implement occlusion culling
Added an occlusion culling system with support for static occluder meshes.
It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`.

Occluders are defined via the new `Occluder3D` resource and instanced using the new
`OccluderInstance3D` node. The occluders can also be automatically baked from a
scene using the built-in editor plugin.
2021-04-23 21:45:23 +02:00
rafallus cfa06f0f76 Unexpose _direct_state_changed in PhysicsBody
Removed _direct_state_changed bindings
Affects 2D and 3D nodes
Callbacks now use Callable
Tests were changed accordingly
2021-04-22 23:20:58 -05:00
Rémi Verschelde f6d5b2f3c2
Merge pull request #48046 from BastiaanOlij/fix_reflection_probe
Fix reflection probe
2021-04-21 16:12:58 +02:00
Bastiaan Olij ebf10fe736 Fix reflection probe 2021-04-21 23:42:29 +10:00
Rémi Verschelde fdf041a466
Merge pull request #47347 from nekomatata/heightmap-support
Heightmap collision shape support in Godot Physics
2021-04-20 17:40:28 +02:00
reduz 906882ee66 Split particle shader entry points
* Particle shaders now have start() and process()
* Particle collision happens between them.
* The RESTART property is kept, so porting an old shader is still possible.

This fixes the problem of particle collisions not functioning on the first particle frame.
2021-04-17 12:22:55 -03:00
Rémi Verschelde c022582c1e
Merge pull request #47942 from nekomatata/joint-check-body-types
Fix errors related to joints setup with two non-dynamic bodies
2021-04-16 08:51:19 +02:00
PouleyKetchoupp 60ae264db1 Fix errors related to joints setup with two non-dynamic bodies 2021-04-15 17:37:45 -07:00
Henry Conklin 9b65b00296 Optimize BroadPhase2dHashGrid to not pair elements on different layers
Clean up logic in _check_motion

Closes 45824
2021-04-15 17:20:07 -04:00
Rémi Verschelde c7a4e2196e
Merge pull request #47878 from clayjohn/rename-get_surface_material
Rename get_surface_material to get_surface_override_material
2021-04-15 07:57:15 +02:00
clayjohn 92731d292c Rename get_surface_material to get_surface_override_material 2021-04-14 20:24:03 -07:00
Rémi Verschelde 9e0f87359b
Merge pull request #47846 from nekomatata/solver-optimization
Godot Physics solver optimization
2021-04-14 18:04:30 +02:00
reduz d3b49c416a Refactor GLSL shader compilation
-Used a more consistent set of keywords for the shader
-Remove all harcoded entry points
-Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization.
-Entry point for sky shaders is now sky().
-Entry point for particle shaders is now process().
2021-04-14 11:37:52 -03:00
PouleyKetchoupp b65d6b56fb Godot Physics solver optimization
Several optimizations in the way solver islands are processed in both
2D and 3D physics:
- Use LocalVector instead of linked list to avoid cache misses (with
persistent storage based on worst case scenario)
- Remove pairs when setup fails (no valid contact) to avoid unnecessary
solving of non-colliding rigid bodies just to return immediately
2021-04-12 18:59:49 -07:00
PouleyKetchoupp 70aa39d127 Fix SoftBody contact impulses applied on rigid bodies
Parameters were inverted in `apply_impulse` and `apply_bias_impulse` due
to a modification on master.
2021-04-12 17:38:14 -07:00
Bastiaan Olij 71c5d73b5e Remove low_end option from renderer, being replaced by separate implementation 2021-04-09 22:04:56 +10:00
Rémi Verschelde 68b28c6cd4
Merge pull request #47678 from madmiraal/fix-47436.1
Check for empty ConcavePolygonShape2D before checking for intersection
2021-04-06 22:35:49 +02:00
Rémi Verschelde 7fa84d8bd3
Merge pull request #47675 from madmiraal/fix-47436
Check ConvexPolygonShape2D point count before calcuating moment of inertia
2021-04-06 22:35:01 +02:00
Rémi Verschelde 0485a0d8b2
Merge pull request #47668 from madmiraal/fix-47438
Ensure ConvexPolygonShape3D support count variable is initialised
2021-04-06 22:30:07 +02:00
Marcel Admiraal 2abfc0518f Check for empty ConcavePolygonShape2D before checking for intersection 2021-04-06 20:05:10 +01:00
Marcel Admiraal 25593a481a Check ConvexPolygonShape2D point count before calcuating moment of inertia 2021-04-06 19:15:09 +01:00
Marcel Admiraal 6544f8422f Ensure ConvexPolygonShape3D support count variable is initialised 2021-04-06 16:46:15 +01:00
Marcel Admiraal 0d4d8925b7 Ensure ConvexPolygonShape support count variable is initialised 2021-04-06 16:18:49 +01:00
Bastiaan Olij dad40fa2df Move clustered renderer functionality 2021-04-05 23:11:38 +10:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
Rémi Verschelde 9bbe51dc27
Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
Rémi Verschelde 65a2888057
Style: Apply clang-tidy's modernize-use-default-member-init 2021-04-05 13:37:27 +02:00
Rémi Verschelde ed2f51b15f
Merge pull request #47452 from BastiaanOlij/xr_positional_tracker_ref
Change XRPositionalTracker to a reference (master)
2021-04-03 10:13:23 +02:00
lucicam c158a63a8a Fix crash caused by null parameter passed to CameraServer.add_feed()
Fixes #46181

CameraServer.add_feed() takes a CameraFeed object type as parameter.
Passing in another type of data while binding the method it will make
tha parameter null.
Added a check for null which returns from function and does not make the
engine crash anymore.
2021-04-02 17:11:30 +03:00
Rémi Verschelde 9cd1e50969
Merge pull request #47250 from BastiaanOlij/check_vulkan_version
Obtain supported Vulkan API
2021-03-31 13:45:43 +02:00
Bastiaan Olij e93c9fc4ed As GLSLang seems to be all or nothing, added our own defines 2021-03-31 21:47:25 +11:00
bruvzg 0d3fa2a125
[Complex Text Layouts] Provide access to glyph contour points. 2021-03-31 09:32:14 +03:00
Bastiaan Olij 454c889e61 Change XRPositionalTracker to a reference and better expose it to GDNative 2021-03-29 23:01:47 +11:00