godot-module-template/modules
Jesusemora 6114c6a266 autosmooth
added properties

update inspector

UX improvements

and minor optimizations

deg_to_rad

moved methods

move variables

performance and cleanup

Faster

Compare the angles/smooth of faces instead of vertices, skipping for loop.
Using a LocalVector instead of Vector, this simplifies the code while making it faster, and I don't think we need COW.

all done and working

Optimizations and cleanup

Clarifying and expanding the description of autosmooth and smoothing_angle properties.
Optimizations to skip steps in the loops:
Split loops to be able to skip vertices better and replace division with multiplication.
Suggestions for future changes.
Skip loop if smoothing_angle is lower than 0.1, as a more performant alternative to default smoothing.
Do not compare vertices that belong to the same triangle.
Remove has_smooth. Use a check at the start of the loop instead. This allows us to skip faces.
Perform normalize() at the end of the loop as we don't need the normal of the vertex afterwards, as we use the normal of the face for smoothing.  This way we skip normalizing flat faces.
If one vertex of a triangle is connected to the current vertex, the other 2 can never physically connect, so we skip them (break;). This isn't as reliable but it could add a slight performance increase.
I calculate a decrease of at least 80% of calculations in the for loops compared to the previous code.

Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2026-03-04 15:30:33 -03:00
..
astcenc Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
basis_universal BasisUniversal: Disable strict aliasing to fix GCC optimization issue 2026-01-10 23:15:22 +01:00
bcdec bcdec: Fix decompressing mipmaps of non-power-of-2 textures 2025-05-08 23:39:47 +02:00
betsy CommandQueueMT: Make re-entrant again + Fix multiple flushers case 2025-12-09 16:09:08 +01:00
bmp Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
camera [Accessibility] Handle adapter activation/deactivation. 2026-02-18 16:54:40 +02:00
csg autosmooth 2026-03-04 15:30:33 -03:00
cvtt Merge pull request #111015 from Alexofp/texture-compression-build-option 2025-10-21 15:10:56 -05:00
dds Merge pull request #116307 from Quantx/dds_r8_rg8 2026-02-19 09:46:02 -06:00
enet Use actual class names in resource type hints 2026-01-29 21:07:56 +01:00
etcpak Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
fbx Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history. 2026-02-04 19:31:28 +01:00
freetype Use HarfBuzz to fix variant hinting in TextServerAdvanced 2025-10-10 18:01:03 -03:00
gdscript Tests: Tidy up compiled tests 2026-02-19 19:31:09 -06:00
glslang Vulkan: Update all components to Vulkan SDK 1.4.335.0 2026-02-04 11:22:17 +01:00
gltf Tests: Convert test headers to compilation files 2026-02-19 07:36:26 -06:00
godot_physics_2d Merge pull request #104736 from szunami/master 2026-02-10 08:29:38 -06:00
godot_physics_3d Synchronize the names for RequiredParam<T> arguments in header files 2025-12-03 04:14:52 -06:00
gridmap Merge pull request #113396 from KoBeWi/Grock 2026-02-20 11:16:26 +01:00
hdr Core: Replace C math headers with C++ equivalents 2025-04-16 15:49:02 -05:00
interactive_music Add missing background panel to audio stream interactive transition editor tree 2026-02-20 18:20:43 +04:00
jolt_physics Add ability for Area3D to detect/influence SoftBody3D with Jolt Physics 2026-02-12 16:30:05 +01:00
jpg Merge pull request #109433 from KoBeWi/hastension 2025-10-31 09:23:30 -05:00
jsonrpc Tests: Tidy up compiled tests 2026-02-19 19:31:09 -06:00
ktx Merge pull request #109433 from KoBeWi/hastension 2025-10-31 09:23:30 -05:00
lightmapper_rd Move binary math functions to Math namespace in math_funcs_binary header. 2026-02-17 12:24:35 +01:00
mbedtls Tests: Tidy up compiled tests 2026-02-19 19:31:09 -06:00
meshoptimizer meshoptimizer: Update to 0.24 2025-06-27 01:02:34 +02:00
mobile_vr Move server files into their subfolders 2025-09-30 19:39:39 -07:00
mono Bugfix: Replace // with \\ before sending project path to MSBuild 2026-02-08 20:02:17 -07:00
mp3 Replace minimp3 with dr_mp3 2025-12-05 18:54:25 -03:00
msdfgen msdfgen: Update to 1.13 2025-12-12 22:39:53 +01:00
multiplayer Merge pull request #113396 from KoBeWi/Grock 2026-02-20 11:16:26 +01:00
navigation_2d Minimize include dependencies of display_server.h 2026-02-17 19:45:31 +01:00
navigation_3d Minimize include dependencies of display_server.h 2026-02-17 19:45:31 +01:00
noise Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history. 2026-02-04 19:31:28 +01:00
objectdb_profiler Tidy up includes in scene/main and scene/debugger 2026-02-19 15:09:29 +01:00
ogg Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
openxr OpenXR: Fix OpenGL ES driver checks 2026-02-19 13:14:49 +01:00
raycast Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
regex Document RegEx.create_from_string() in RegEx class description 2025-12-21 02:26:57 +01:00
svg Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
text_server_adv Merge pull request #116197 from bruvzg/rtl_wj 2026-02-20 11:36:04 -06:00
text_server_fb Move binary math functions to Math namespace in math_funcs_binary header. 2026-02-17 12:24:35 +01:00
tga Don't right-align escaped newlines, e.g. for #define. This has previously led to long diffs in the commit history. 2026-02-04 19:31:28 +01:00
theora Merge pull request #109433 from KoBeWi/hastension 2025-10-31 09:23:30 -05:00
tinyexr Add missing cstdlib include for EXIT_SUCCESS and free 2025-12-16 11:02:07 +01:00
upnp Fix UPNP code sample using OK constant incorrectly 2026-01-29 01:53:57 +01:00
vhacd Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
vorbis AudioStreamOggVorbis: only show invalid comment warning in Editor 2025-10-24 09:51:44 -07:00
webp libwebp: Update to 1.6.0 2025-12-12 22:51:19 +01:00
webrtc Move binary math functions to Math namespace in math_funcs_binary header. 2026-02-17 12:24:35 +01:00
websocket Move binary math functions to Math namespace in math_funcs_binary header. 2026-02-17 12:24:35 +01:00
webxr Minimize include dependencies of display_server.h 2026-02-17 19:45:31 +01:00
xatlas_unwrap Revert "SCons: Add CPPEXTPATH for external includes" 2025-10-06 13:09:22 -05:00
zip Tests: Tidy up compiled tests 2026-02-19 19:31:09 -06:00
modules_builders.py CI: Enable Ruff preview options; bump version 2026-02-05 12:20:10 -06:00
register_module_types.h GDExtension: Store source of gdextension_interface.h in JSON 2025-11-11 14:58:45 -06:00
SCsub Tests: Tidy up compiled tests 2026-02-19 19:31:09 -06:00