Commit graph

310 commits

Author SHA1 Message Date
Tomasz Chabora 900b2e0fdc Complete rewrite of Tweens
* Tweens were changed from Node to RefCounted. New API is inspired by DOTween.
* Tweens are created and managed by SceneTree, similar to SceneTreeTimer, which makes them ultra cheap to use a lot.
* Animating with Tweens is done by creating sequences of Tweeners. You create them from code and they autostart by default (fire-and-forget).
* There are 4 Tweeners that cover the former Tween functionality: PropertyTweener, IntervalTweener, CallbackTweener and MethodTweener.
* The methods were simplified a lot. Long argument lists are replaced with chained calls on Tweens and Tweeners.
* Tweeners by default execute in sequence, so it's easy to create complex chained animations.
* You can bind a Tween to a node. Tween will be removed automatically when the bound node is freed.
2021-06-19 12:08:50 +02:00
Yuri Roubinsky f632e36ae5 Continuation of work on visual particles system 2021-06-07 20:33:17 +03:00
Yuri Roubinsky b2d2822a39 Adds UVFunc for panning/scaling on UV's to VisualShader's. 2021-06-07 08:31:48 +03:00
Rémi Verschelde aa251c310a
Merge pull request #49325 from reduz/rename-gi-classes
Rename GI Classes
2021-06-06 09:50:06 +02:00
TwistedTwigleg 8aa3c2f091 New and improved IK system for Skeleton2D
This PR and commit adds a new IK system for 2D with the Skeleton2D node
that adds several new IK solvers, a way to control bones in a Skeleton2D
node similar to that in Skeleton3D. It also adds additional changes
and functionality.

This work was sponsored by GSoC 2020 and TwistedTwigleg.

Full list of changes:
* Adds a SkeletonModifier2D resource
  * This resource is the base where all IK code is written and executed
  * Has a function for clamping angles, since it is so commonly used
  * Modifiers are unique when duplicated so it works with instancing
* Adds a SkeletonModifierStack2D resource
  * This resource manages a series of SkeletonModification2Ds
  * This is what the Skeleton2D directly interfaces with to make IK possible
* Adds SkeletonModifier2D resources for LookAt, CCDIK, FABRIK, Jiggle, and TwoBoneIK
  * Each modification is in its own file
  * There is also a SkeletonModifier2D resource that acts as a stack for using multiple stacks together
* Adds a PhysicalBone2D node
  * Works similar to the PhysicalBone3D node, but uses a RigidBody2D node
* Changes to Skeleton2D listed below:
  * Skeleton2D now holds a single SkeletonModificationStack2D for IK
  * Skeleton2D now has a local_pose_override, which overrides the Bone2D position similar to how the overrides work in Skeleton3D
* Changes to Bone2D listed below:
  * The default_length property has been changed to length. Length is the length of the bone to its child bone node
  * New bone_angle property, which is the angle the bone has to its first child bone node
  * Bone2D caches its transform when not modified by IK for IK interpolation purposes
  * Bone2D draws its own editor gizmo, though this is stated to change in the future
* Changes to CanvasItemEditor listed below:
  * Bone2D gizmo drawing code removed
  * The 2D IK code is removed. Now Bone2D is the only bone system for 2D
* Transform2D now has a looking_at function for rotating to face a position
* Two new node notifications: NOTIFICATION_EDITOR_PRE_SAVE and NOTIFICATION_EDITOR_POST_SAVE
  * These notifications only are called in the editor right before and after saving a scene
  * Needed for not saving the IK position when executing IK in the editor
* Documentation for all the changes listed above.
2021-06-05 15:19:51 -04:00
reduz 32625145c8 Rename GI Classes
* GIProbe is now VoxelGI
* BakedLightmap is now LightmapGI

As godot adds more ways to provide GI (as an example, SDFGI in 4.0), the different techniques (which have different pros/cons) need to be properly named to avoid confusion.
2021-06-05 09:28:56 -03:00
andriyDev 9f4bf5ec80 Deleted YSort, moved its functionality directly into Node2D.
YSort now has a compatibility alias to Node2D.
Updated TileMap to use the existing Node2D y_sort_enabled property instead
of its own property.
Updated Node2D doc to include the new y_sort_enabled member.
Updated TileMap doc to remove its mention of cell_y_sort.
Deleted YSort doc.
2021-06-05 00:55:25 -07:00
PouleyKetchoupp ba13d23140 KinematicBody split between new CharacterBody and PhysicsBody
PhysicsBody now has methods move_and_collide/test_move and needed
properties for these methods: safe margin, locked axes (3D only).

Moved collision_exceptions from StaticBody to PhysicsBody for 3D
(same as 2D, and conforms to documentation).

RigidBody doesn't have test_motion method anymore, it's now redundant
with PhysicsBody.test_move.
2021-06-04 11:40:36 -07:00
Aaron Franke bbd49dec23
Disable Skeleton3D when compiling without 3D
Make animation code not depend on Skeleton3D or even Node3D
2021-06-04 08:33:50 -04:00
Yuri Roubinsky f06db8b778 Added Billboard Node to Visual Shaders 2021-05-28 09:24:06 +03:00
Gilles Roudière d8bb53cd21 Implement scenes tiles in TileMaps 2021-05-20 13:12:03 +02:00
kobewi 877dbda209 Create ColorPicker shaders statically 2021-05-17 11:39:20 +02:00
Gilles Roudière a3dda2df85 Rework the TileSet resource and TileMap nodes:
- Move most properties from TileMap to TileSet,
- Make TileSet more flexible, supporting more feature (several
  collision layers, etc...),
- Fusion both the TileMap and TileSet editor,
- Implement TileSetSources, and thus a new way to index tiles in the TileSet,
- Rework the TileSet and TileMap editors completely,
- Implement an editor zoom widget (and use it in several places)
2021-05-07 18:06:17 +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
Rémi Verschelde 0e93a1df79
Remove obsolete LargeTexture, it's no longer useful since 3.x
It existed in early Godot releases to allow working around hardware limitations
on max texture sizes (e.g. hardware limits of 1024x1024 pixels).

Nowadays the max texture size supported natively by Godot is 16384x16384, and
even low end mobile hardware should support at least 4096x4096.

The LargeTexture implementation is basically just an array with offsets, sizes
and textures and should be easy to replicate with a custom Texture resource if
needed - solving most of its bugs on the way as the implementation removed here
has various unimplemented or incomplete methods.
2021-04-28 15:51:55 +02: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
Rémi Verschelde cbf5408685
Merge pull request #46273 from Chaosus/vs_comment
Added Comment node to Visual Shaders
2021-04-04 16:04:12 +02:00
Hugo Locurcio 0724424179
Require editor restart after changing GUI custom theme or font
The `restart_if_changed` project setting hint wasn't set correctly.
2021-03-30 15:33:24 +02:00
Gilles Roudière ba1344408f Implement Navigation layers 2021-03-10 11:23:06 +01:00
Gilles Roudière a9dc53d152 Remove Navigation2D/3D nodes, and move the navigation map to the world resource 2021-03-10 11:23:06 +01:00
Yuri Roubinsky fe3051fcce Added Comment node to Visual Shaders 2021-02-21 12:40:17 +03:00
reduz 64140eaf42 Reorganize Project Settings
-Advanced Settings toggle also hides advanced properties when disabled
-Simplified Advanced Bar (errors were just plain redundant)
-Reorganized rendering quality settings.
-Reorganized miscelaneous settings for clean up.
2021-02-18 11:23:34 -03:00
Rémi Verschelde d811f86102
Merge pull request #45281 from Chaosus/vs_unify
Unified several visual shader nodes
2021-02-01 08:56:03 +01:00
Yuri Roubinsky 4618e09f3b
Added SDF nodes to visual shader 2021-01-18 15:04:54 +01:00
Yuri Roubinsky de5a8128d7 Unified several visual shader nodes 2021-01-18 13:32:12 +03:00
Rémi Verschelde c7fb7674c8
Merge pull request #44805 from Chaosus/vs_convert
Add convert options between constants and uniforms in visual shaders
2021-01-15 16:58:26 +01:00
Rémi Verschelde 96aff740fe
Merge pull request #44809 from Calinou/physics-render-layers-zero-index
Use zero-indexing for physics and render layer names
2021-01-01 23:37:37 +01:00
Rémi Verschelde b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Hugo Locurcio f87d42f4ca
Use zero-indexing for physics and render layer names
The first layer is now Layer 0 instead of Layer 1, and the last
layer is now Layer 19 instead of Layer 20.

This helps reference physics and render layers from scripts since
layers start from 0 there.
2020-12-30 16:03:11 +01:00
Yuri Roubinsky c98c6eadbe Add convert options between constants and uniforms in visual shaders 2020-12-30 13:07:08 +03:00
Hugo Locurcio 57dcc83152
Rename the TextureProgress node to TextureProgressBar
Advantages:

- When searching for "progressbar", you'll see both nodes in the
  search results.
- More consistent with Button/TextureButton.
2020-12-14 21:35:13 +01:00
Rémi Verschelde 92c001ef09
Merge pull request #43931 from bruvzg/ctl_comp_font
[Complex Text Layouts] Add compatibility for legacy Font resources.
2020-12-09 11:28:11 +01:00
Marcel Admiraal df6b061dbb Rename CubeMesh BoxMesh 2020-12-05 11:48:26 +00:00
bruvzg 3c3590522f
[Complex Text Layouts] Add compatibility for legacy Font resources. 2020-12-03 10:34:03 +02:00
bruvzg 99666de00f
[Complex Text Layouts] Refactor Font class, default themes and controls to use Text Server interface.
Implement interface mirroring.
Add TextLine and TextParagraph classes.
Handle UTF-16 input on macOS and Windows.
2020-11-26 14:25:48 +02:00
Andrii Doroshenko (Xrayez) ba68383706 Add AspectRatioContainer class
Co-authored-by: Ugis Brekis <ugis.brekis@productmadness.com>
2020-11-25 15:06:40 +02:00
reduz 127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
reduz f123981a96 Implement DirectionalLight2D
Also separated Light2D in PointLight2D and DirectionalLight2D.
Used PointLight2D because its more of a point, and it does not work
the same as OmniLight (as shape depends on texture).
Added a few utility methods to Rect2D I needed.
2020-11-04 10:03:01 -03:00
reduz 8ab9b39707 Implement CanvasGroup and CanvasItem clipping
-Allows merging several 2D objects into a single draw operation
-Use current node to clip children nodes
-Further fixes to Vulkan barriers
-Changed font texture generation to white, fixes dark eges when blurred
-Other small misc fixes to backbuffer code.
2020-10-28 18:53:32 -03:00
reduz 84d734da0e Refactored 2D shader and lighting system
-Removed normal/specular properties from nodes
-Create CanvasTexture, which can contain normal/specular channels
-Refactored, optimized and simplified 2D shaders
-Use atlas for light textures.
-Use a shadow atlas for shadow textures.
-Use both items aboves to make light rendering stateless (faster).
-Reorganized uniform sets for more efficiency.
2020-10-24 15:57:25 -03:00
Yuri Roubinsky f402e1e675 Added VisualShaderNodeCurve to easy gather data from a CurveTexture 2020-10-18 09:57:15 +03:00
reduz 26f5bd245c Implement GPU Particle Collisions
-Sphere Attractor
-Box Attractor
-Vector Field
-Sphere Collider
-Box Collider
-Baked SDF Collider
-Heightmap Collider
2020-10-09 13:25:47 -03:00
Paulb23 a0b409cb14 Add and convert editor to use CodeEdit 2020-09-10 20:35:27 +01:00
Yuri Roubinsky 5ba8246cfb Added Texture3D to visual shaders 2020-09-10 07:40:06 +03:00
Hugo Locurcio 3e0226515e
Rename ShortCut to Shortcut which is more grammatically correct
See https://github.com/godotengine/godot/issues/16863#issuecomment-685236980.
2020-09-09 21:54:54 +02:00
reduz a674da4eec Implement 3D textures as import and resource format. 2020-09-09 13:50:21 -03:00
PouleyKetchoupp e869e6eb0c Add Viewport/SubViewport node compatibility 2020-08-23 20:18:11 +02:00
Andrii Doroshenko (Xrayez) 6f426c3360 Port ClassDB tests to use doctest
Extracted the most minimal core initialization functionality from
`setup()` and `setup2()` so that `ClassDB` could be tested properly
(input, audio, rendering, physics etc, are excluded).

Display and rendering servers/singletons are not initialized at all.

Due to the fact that most subsystems are disabled, fixed various crashes in the
process (in order):
- `AcceptDialog` OK/cancel swap behavior (used `DisplayServer` while
  `register_scene_types()`);
- `make_default_theme` which depends on `RenderingServer`;
- `XRServer` singleton access while calling `register_modules_types()`;
- hidden bug in a way joypads are cleaned up (MacOS and Linux only).

Removed manual `ClassDB` init/cleanup calls from `test_validate_testing.h`.

ClassDB tests:

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-08-16 16:41:02 +03:00
Yuri Roubinsky 7ddaff47a3 Added UniformRef visual shader node 2020-07-28 14:44:53 +03:00
bruvzg 0181c3dde1
Docs: Ignore OS specific values (constants, project settings, properties). 2020-07-15 12:24:59 +03:00