Commit graph

90 commits

Author SHA1 Message Date
kleonc e2e149f4df Fix rendering centered odd-size texture in AnimatedSprite/AnimatedSprite3D 2021-10-03 14:15:21 +02:00
Lewis Pollard 4e68f089e0
Fix is_playing() method in AnimatedSprite3D
(cherry picked from commit 2450173495)
2021-09-14 13:41:26 +02:00
Rémi Verschelde 92a7ae022d
Merge pull request #51769 from The-O-King/oct_split_stream_fix
Fix Octahedral/Split Stream Options
2021-08-18 08:01:56 +02:00
Omar El Sheikh a63028e172 Fix Octahedral/Split Stream Options
Update mesh_surface_get_format_stride and
mesh_surface_make_offsets_from_format to return an array of offsets and
an array of strides in order to support vertex stream splitting

Update _get_array_from_surface to also support vertex stream splitting

Add a condition on split stream usage to ensure it does not get used on
dynamic meshes

Handle case when Tangent is compressed but Normal is not compressed

Make stream splitting option require a restart in the settings

Update SoftBody and Sprite3D to support and use strides and offsets
returned by updated visual_server functions

Update Sprite3D to use the dynamic mesh flag
2021-08-17 16:11:47 -04:00
Gordon MacPherson f038c6a926 Fix octahedral compression with Sprite3D
Needs a default which is not zero
2021-08-16 22:25:44 +01:00
clayjohn f7dbcf95e1 Allow unclamped colors in Sprite3D 2021-08-09 21:44:21 -07:00
Omar El Sheikh d274284069 Octahedral Normal/Tangent Compression
Implement Octahedral Compression for normal/tangent vectors
*Oct32 for uncompressed vectors
*Oct16 for compressed vectors

Reduces vertex size for each attribute by
*Uncompressed: 12 bytes, vec4<float32> -> vec2<unorm16>
*Compressed: 2 bytes, vec4<unorm8> -> vec2<unorm8>

Binormal sign is encoded in the y coordinate of the encoded tangent

Added conversion functions to go from octahedral mapping to cartesian
for normal and tangent vectors

sprite_3d and soft_body meshes write to their vertex buffer memory
directly and need to convert their normals and tangents to the new oct
format before writing

Created a new mesh flag to specify whether a mesh is using octahedral
compression or not
Updated documentation to discuss new flag/defaults

Created shader flags to specify whether octahedral or cartesian vectors
are being used

Updated importers to use octahedral representation as the default format
for importing meshes

Updated ShaderGLES2 to support 64 bit version codes as we hit the limit
of the 32-bit integer that was previously used as a bitset to store
enabled/disabled flags
2021-07-30 10:29:09 -04:00
clayjohn 3dd2e5d870 Only set base in Sprite3D when needed 2021-05-05 22:35:21 -07:00
Rémi Verschelde 140350d767
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2021-05-05 15:02:01 +02:00
Rémi Verschelde a828398655
Style: Replaces uses of 0/NULL by nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2021-05-04 16:30:23 +02:00
Rémi Verschelde b5e1e05ef2
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks 2021-05-04 14:45:16 +02:00
Rémi Verschelde 70ae90e0e8
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.

Backport of #48239.
2021-04-29 12:34:11 +02:00
Jitesh d968a03cbc
Add animation_finished signal and fix frame_changed signal for AnimatedSprite3D
Fixes #40301.
Fixes #45947.

(cherry picked from commit c3be0c2c04)
2021-02-18 00:36:20 +01:00
Rémi Verschelde 49646383f1
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 🎆

(cherry picked from commit b5334d14f7)
2021-01-13 16:17:06 +01:00
clayjohn 89677b5b7f Use full float UVs in Sprite3D 2020-10-03 10:54:14 -07:00
Rémi Verschelde e40b4eeeea
Merge pull request #37226 from arrowinaknee/fix-node-config-warnings
[3.2] Update get_configuration_warning() overrides to retrieve warnings from parent class
2020-10-01 14:04:26 +02:00
clayjohn b730c5596c Restore default alpha_scissor_threshold to Sprite3D 2020-09-27 22:54:50 -07:00
Jonathan Vice 96ca267209
Reorder sprite h_frames & v_frames
(cherry picked from commit 28326aec60)
2020-09-24 14:43:10 +02:00
clayjohn a4f2fea2ae Fix axis bug regression in Sprite3D 2020-09-15 08:02:19 -07:00
clayjohn d33a9aaacb Check for uncompressed uvs in Sprite3D 2020-08-16 19:19:14 -07:00
clayjohn fb4e55bb7a Pass Sprite3D AABBs to VisualServer 2020-07-20 20:22:12 -07:00
ArrowInAKnee e48430b1d4 Make all get_configuration_warning() overrides retrieve warnings from parent 2020-07-13 01:50:02 +03:00
clayjohn 6c0ff26f35 Use mesh instead of immediate for drawing Sprite3D 2020-07-03 12:19:26 -06: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
Tomasz Chabora 6c0ef9f729 Auto-increment frame_coords when keying 2019-10-22 20:12:55 +02:00
qarmin 616ab4fac2 Small fixes to redundand code, copy paste bugs 2019-10-14 11:40:55 +02:00
Gilles Roudiere b27ec4aea7 Fixes Sprite frame_coords 2019-10-13 08:44:44 +02:00
Rémi Verschelde 9762372329
Merge pull request #30635 from KoBeWi/billbo_3dns
Add a Billboard property for Sprite3D
2019-08-29 13:06:37 +02:00
Tomasz Chabora b055ade1c3 Add a Billboard property for Sprite3D 2019-08-28 23:00:44 +02:00
groud 11cb4eb363 Add frame_cords accessors to Sprite and Sprite3D 2019-07-27 13:05:02 +02:00
Rémi Verschelde 336846e547 Inspector: Fix PROPERTY_HINT_SPRITE_FRAME not behaving as RANGE
This was a regression in 3.1 and later from the new inspector, where
PROPERTY_HINT_SPRITE_FRAME was not fully re-implemented. It's meant to
be a normal PROPERTY_HINT_RANGE which also automatically increments its
value when keyed in the animation player.

To avoid code duplication, I made the frames properties use the actual
PROPERTY_HINT_RANGE and introduced a PROPERTY_USAGE_KEYING_INCREMENTS
usage flag instead.
2019-07-25 09:29:51 +02:00
qarmin 6cbaf7662f Changed some code showed in LGTM and Coverage 2019-07-20 08:09:57 +02:00
Hugo Locurcio ff7184c5cb
Improve the node configuration warning display
- Refer to properties explicitly when possible
- When multiple warnings are returned, always separate them by one
  blank line to make them easier to distinguish
- Improve grammar and formatting
2019-07-09 00:18:00 +02:00
Ibrahn Sahir 4e4697b1c4 Added release function to PoolVector::Access.
For clarity, assign-to-release idiom for PoolVector::Read/Write
replaced with a function call.
Existing uses replaced (or removed if already handled by scope)
2019-07-06 12:04:27 +01:00
qarmin 33c15799c7 Set to enum variables, only correct values 2019-06-24 14:53:26 +02:00
Michael Alexsander Silva Dias 1e3e770073 Add frame support for Sprite3D with region enabled 2019-02-04 20:31:45 -02:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Bastiaan Olij fa63a0fe83 Reverse bitangent on everythings to ensure default normal map behavriour is consistent 2018-12-08 13:43:46 +11:00
Bastiaan Olij bcef4b8dc6 Fixing tangent and binormal logic 2018-11-19 22:27:05 +11:00
Rémi Verschelde 5613aa489e
Merge pull request #23299 from FlamyAT/sprite3d-floating-offset
Changed Sprite3D to float based drawing
2018-11-13 21:28:08 +01:00
Juan Linietsky f2e54057ae -Moved EditorDefaultValue to ClassDB, made it core
-Removed one and zero hints for properties, replaced by default value
2018-11-08 11:30:59 -03:00
FlamyAT 3d07a1c10f
Changed integer based drawing to floating numbers 2018-10-26 11:50:21 +02:00
Rémi Verschelde c52a3646f1
Merge pull request #21502 from Web-eWorks/atlasfixes
AtlasTexture fixes, part 2.
2018-09-14 15:02:23 +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
Webster Sheets c522fe05e0 AtlasTexture fixes, part 2. 2018-08-27 15:24:56 -04:00
JFonS 9cd1c20f6a Polished 3D selection 2018-06-13 17:52:37 +02:00
Webster Sheets 4b545e3105 Fix AtlasTexture usage in Sprite3D.
Changes as requested in b484d5c.
2018-05-08 11:22:56 -04:00
Juan Linietsky b484d5c2d8
Revert "Fix Sprite3D's incorrect behavior when using AtlasTextures." 2018-05-07 15:44:27 -03:00
Webster Sheets 973be3711a Fix Sprite3D's incorrect behavior when using AtlasTextures. 2018-02-15 10:33:58 -05:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00