summaryrefslogtreecommitdiffstats
path: root/modules/raycast
Commit message (Collapse)AuthorAgeFilesLines
* Unify bits, arch, and android_arch into env["arch"]Aaron Franke2022-08-252-16/+4
| | | | | | Fully removes the `bits` option and adapts the code that relied on it. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Remove ThreadWorkPool, replace by WorkerThreadPoolJuan Linietsky2022-07-252-23/+31
| | | | | The former needs to be allocated once per usage. The later is shared for all threads, which is more efficient. It can also be better debugged.
* Code quality: Fix header guards consistencyRémi Verschelde2022-07-253-5/+5
| | | | | Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
* Implement Vector4, Vector4i, Projectionreduz2022-07-232-6/+6
| | | | | | | | | | | | | Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
* Clean up Hash Functionsreduz2022-06-201-2/+2
| | | | | | | Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934 * Clean up usage of murmur3 * Fixed usages of binary murmur3 on floats (this is invalid) * Changed DJB2 to use xor (which seems to be better)
* Add a new HashSet templatereduz2022-05-205-13/+15
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Use range iterators for RBSet in most casesAaron Record2022-05-193-11/+11
|
* Replace most uses of Map by HashMapreduz2022-05-166-14/+14
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-10/+7
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Merge pull request #60723 from reduz/refactor-module-initializationRémi Verschelde2022-05-042-4/+14
|\
| * Refactor module initializationreduz2022-05-042-4/+14
| | | | | | | | | | | | | | * Changed to use the same stages as extensions. * Makes the initialization more coherent, helping solve problems due to lack of stages. * Makes it easier to port between module and extension. * removed the DRIVER initialization level (no longer needed).
* | Rename Basis get_axis to get_column, remove redundant methodsAaron Franke2022-05-031-2/+2
|/
* Zero initialize all pointer class and struct membersRémi Verschelde2022-04-041-2/+2
| | | | | This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
* Improvements and fixes to occludersjfons2022-02-071-2/+3
| | | | | | | | | | | | | | | Improvements: * Occluder3D is now an abstract type inherited by: ArrayOccluder3D, QuadOccluder3D, BoxOccluder3D, SphereOccluder3D and PolygonOccluder3D. ArrayOccluder3D serves the same purpose as the old Occluder3D (triangle mesh occluder) while the rest are primitives that can be used to manually place simple occluders. * Occluder baking can now apply simplification. The "bake_simplification_distance" property can be used to set a world-space distance as the desired maximum error, set to 0.1 by default. * Occluders can now be generated on import. Using the "occ" and "occonly" keywords (similar to "col" and "colonly" for colliders) or by enabling on MeshInstance3Ds in the scene's import window. Fixes: * Fixed saving of occluder files after bake. * Fixed a small error where occluders didn't correctly update in the rendering server. Bonus content: * Generalized "CollisionPolygon3DEditor" so it can also be used to edit Resources. Renamed it to "Polygon3DEditor" since it was already being used by other things, not just colliders. * Fixed a small bug in "EditorPropertyArray" where a call to "remove" was left after the "remove_at" rename.
* Update copyright statements to 2022Rémi Verschelde2022-01-038-16/+16
| | | | Happy new year to the wonderful Godot community!
* Add support for PowerPC familyDaniel Kolesa2021-11-011-1/+1
|
* Add support for the RISC-V architectureAaron Franke2021-10-221-0/+2
| | | | Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions)
* Merge pull request #53245 from JFonS/occ_fixes2Rémi Verschelde2021-09-303-59/+89
|\ | | | | Occlusion culling fixes
| * Occlusion culling fixesjfons2021-09-303-59/+89
| | | | | | | | | | | | | | | | Fixes some issues found by UBSAN and other misc things: * Fixed memory leak on exit. * Properly align ray packet buffer to 64 bytes. * Added some compiler flags from Embree's build system. * Fixed ray masks.
* | Merge pull request #52544 from JFonS/lod_fixesJuan Linietsky2021-09-305-8/+209
|\ \ | | | | | | Auto LOD fixes and improvements
| * | Auto LOD fixes and improvementsjfons2021-09-275-8/+209
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixed LODs for shadow meshes. * Added a merging step before simplification. This helps with tesselated meshes that were previously left untouched. The angle difference at wich edges ar considered "hard" can be tweaked as an import setting. * LODs will now start with the highest decimation possible and keep doubling (approximately) the number of triangles from there. This makes sure that very low triangle counts are included when possible. * Given more weight to normal preservation. * Modified MeshOptimizer to report distance-based error instead of including attributes in the reported metrics. * Added attribute transference between the original mesh and the various LODs. Right now only normals are taken into account, but it could be expanded to other attributes in the future.
* | Rename RID's `getornull()` to `get_or_null()`Hugo Locurcio2021-09-291-7/+7
| |
* | Force optimized builds for thirdparty Embree filesjfons2021-09-281-0/+1
|/
* Merge pull request #52545 from JFonS/occ_fixesRémi Verschelde2021-09-202-56/+84
|\ | | | | Occlusion culling fixes
| * Occlusion culling fixesjfons2021-09-102-56/+84
| |
* | Upgrade Embree and enable ray packetsJoan Fons2021-09-132-1/+14
|/ | | | | | Minor patch upgrade. Enabling ray packets results in faster processing of ray streams (i.e. occlusion culling buffer updates) at the cost of slightly larger binary sizes.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-1/+1
|
* Rename Transform to Transform3D in coreAaron Franke2021-06-032-13/+13
|
* Upgrade Embree to the latest official release.jfons2021-05-213-27/+11
| | | | | | | | Since Embree v3.13.0 supports AARCH64, switch back to the official repo instead of using Embree-aarch64. `thirdparty/embree/patches/godot-changes.patch` should now contain an accurate diff of the changes done to the library.
* Add checks for __SSE2__ in the lightmap raycasterJFonS2021-05-111-0/+6
| | | | (cherry picked from commit 20717990fd2a7ad300fd9c6fab0394f25e3b7294)
* SCons: Disable embree-based modules on x86 (32-bit)Rémi Verschelde2021-05-111-1/+7
| | | | | | Fixes #48482. (cherry picked from commit e53422c8f96770c9a9b7497955c84f4b742fdd73)
* Port changes to the "raycast" module build files from 3.xjfons2021-05-042-94/+104
|
* Raycast: Fix use of removed copymem after #48239Rémi Verschelde2021-04-281-1/+1
|
* Implement occlusion cullingjfons2021-04-239-0/+1485
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.