Commit graph

360 commits

Author SHA1 Message Date
reduz ab2456b740 Rename VisibilityNotifierXD to VisibleOnScreenNotifierXD
* Renames for 2D and 3D
* Class name was confusing, given both 2D and 3D have a "visible" property that is unrelated to actual on-screen visibility.
* New name makes it clear that this is about visibility on screen.
2021-06-16 22:01:39 -03: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
Rémi Verschelde c8523038cc
Merge pull request #40268 from DanielZTing/master
Fix cancel/OK button order on macOS
2020-07-15 09:21:04 +02:00
Paulb23 bc4cee4458 Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighter
- Extacted all syntax highlighting code from text edit
- Removed enable syntax highlighting from text edit
- Added line_edited_from signal to text_edit
- Renamed get/set_syntax_highlighting to get/set_syntax_highlighter
- Added EditorSyntaxHighligher
2020-07-11 17:09:58 +01:00
Paulb23 2f1080be9b Convert syntax highlighters into a resource 2020-07-11 15:26:58 +01:00
Daniel Ting 9605fc54c7 Fix cancel/OK button order on macOS
The macOS platform convention regarding button order is cancel on left,
OK on right.
2020-07-10 15:10:11 -05:00
Yuri Roubinsky ecb5f7ea23 Added 'fma' function to shader language 2020-07-10 19:58:03 +03:00
Rémi Verschelde 372136fe75 Environment: Refactor code for readability + more
- Makes all boolean setters/getters consistent.
- Fixes bug where `glow_hdr_bleed_scale` was not used.
- Split CameraEffects to their own source file.
- Reorder all Environment method and properties declarations,
  definitions and bindings to be consistent with each other
  and with the order of property bindings.
- Bind missing enum values added with SDFGI.
- Remove unused SDFGI enhance_ssr boolean.
- Sync doc changes after SDFGI merge and other misc changes.
2020-07-01 14:44:45 +02:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Yuri Roubinsky cb9cbf840d Added Texture2DArray support to visual shaders 2020-06-19 18:02:05 +03:00
Andrii Doroshenko (Xrayez) 9bb070b030 Move RayShape2D implementation into its own translation unit 2020-06-01 01:52:07 +03:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Ignacio Etcheverry af78a69b6f Fix C# bindings after lightmapper changes 2020-05-13 15:54:30 +02:00
Juan Linietsky 1bea8e1eac New lightmapper
-Added LocalVector (needed it)
-Added stb_rect_pack (It's pretty cool, we could probably use it for other stuff too)
-Fixes and changes all around the place
-Added library for 128 bits fixed point (required for Delaunay3D)
2020-05-10 15:59:09 -03:00
Rémi Verschelde 0ef8bcac4d DocData: Skip unexposed classes
Properly expose classes that we actually want accessible.
2020-04-20 12:51:10 +02:00
Juan Linietsky 0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03:00
Juan Linietsky 5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
Bastiaan Olij afc8c6391c Renaming all ARVR nodes to XR 2020-04-09 15:33:01 +10:00
Rémi Verschelde 59d44ee872
Merge pull request #37505 from YeldhamDev/viewcont_rename
Rename ViewportContainer to SubViewportContainer
2020-04-03 15:53:35 +02:00
Juan Linietsky 87c658b304 Re-Added screen space reflection. 2020-04-02 11:25:21 -03:00
Michael Alexsander 0c6851ae53 Rename ViewportContainer to SubViewportContainer 2020-04-01 16:11:44 -03:00
Michael Alexsander 46a6751302 Register SubViewport class 2020-03-30 16:43:55 -03:00
Rémi Verschelde eaaee63b62 doc: Update classref with node renames
A few extra renames for classes which were missed in last week's PRs.
2020-03-30 18:23:02 +02:00
Rémi Verschelde 0c320a6bf3 More server renames for consistency after #37361 2020-03-28 13:20:48 +01:00
Rémi Verschelde d1acbbce7f Rename more 2D and 3D nodes to follow convention
Rename editor plugins to match the new node names.
2020-03-27 16:26:34 +01:00
Rémi Verschelde c3a760c507 Fix build with disable_3d=yes, remove dependency on WorldEnvironment 2020-03-27 14:55:14 +01:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Juan Linietsky 4758057f20 Working multiple window support, including editor 2020-03-26 15:49:40 +01:00
Juan Linietsky 9e08742de8 Added a Window node, and made it the scene root.
Still a lot of work to do.
2020-03-26 15:49:38 +01:00
Juan Linietsky f8a79a97c7 Effective DisplayServer separation, rename X11 -> LinuxBSD 2020-03-26 15:49:34 +01:00
clayjohn 61a74739ca Working sky shader implementation 2020-03-21 20:43:44 -07:00
Bastiaan Olij c3fee7ba6c Add shader based background mode 2020-03-19 18:30:39 -07:00
Andrea Catania 483994601d Renamed NavigationPolygonInstance to NavigationRegion2D 2020-02-28 08:28:53 +01:00
Andrea Catania 2e0fb66c6f Renamed PlaneShape to WorldMarginShape 2020-02-27 17:45:16 +01:00
Andrea Catania 3b64ecbc4b Renamed NavigationMeshInstance to NavigationRegion 2020-02-27 17:42:53 +01:00
Yuri Roubinsky 4a3d277623 Add support for integer type in visual shaders 2020-02-26 10:12:06 +03:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Rémi Verschelde 54ac8eaba6 Remove more deprecated methods and code 2020-02-13 12:37:45 +01:00
Juan Linietsky f14defb6f9 WIP CameraEffects implementation (bokeh not working for now) 2020-02-11 12:15:03 +01:00
Juan Linietsky acf0f6c8a7 GIProbes working. 2020-02-11 12:03:20 +01:00
Juan Linietsky dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +01:00
Juan Linietsky 42b44f43ee Basic 2D engine is more or less working, needs more work for editor to be usable. 2020-02-11 11:53:27 +01:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Michael Alexsander 021fdb1b58 Remove AnimationTreePlayer node 2020-02-10 16:25:50 -03:00
Andrea Catania e6be3f68da - Integrated NavigationServer and Navigation2DServer.
- Added Navigation Agents and Obstacles.
- Integrated Collision Avoidance.

This work has been kindly sponsored by IMVU.
2020-02-10 14:38:52 +01:00
Marcel Admiraal 5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Rémi Verschelde 4faaf6089a Remove unused #if 0'ed code 2020-01-21 21:41:54 +01:00
William Tumeo c1853eeb59 Fix AnimationTree not available when compiled with disable_3d 2020-01-07 00:04:30 -03: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
Hugo Locurcio 379e1789dd
Remove unused stb_truetype-based DynamicFont implementation
The DynamicFont implementation currently in use is based on
FreeType, which provides much better visual quality.

This old implementation wasn't exposed anywhere, so this shouldn't
break compatibility.

This decreases binary sizes by a few kilobytes.
2019-10-03 01:19:02 +02:00
Juan Linietsky d81ddaf33e Added skin support and simplified APIs to override bone position. 2019-09-18 19:46:32 -03:00
Eoin O'Neill b85b2da988 Bug Fix 31973 Type Hint Error
Fixed a bug introduced in my previous PR involving CharFXTransform not
allowing the use of type hinting. Should now work properly. This should
also help with Godot Mono issues...
2019-09-04 16:42:51 -07:00