Comments (6)
Since I've been delving into performance stuff, here's a shot of Tracy profiling of animations with my fairly simple low-poly enemies in KOOK:
So the average _process_animation takes around 40 microseconds. With 100 enemies, that's like 4ms, which isn't super great.
Here's the tracy file if anybody wants to poke around:
kook trace 20240621.zip
Most of the time is spent in AnimationMixer:_blend_process followed by _blend_calc_total_weight. About 20 microseconds and 9 microseconds there.
If manually stepping is the solution, it would be nice to have some sort of built in system to prioritize closer/in view objects so they update every frame and then have a max number of animations played per frame or something.
I do feel like some optimizations could be done, though, outside of that and multithreading.
Edit: Just realized there's a PR to do some optimizations here: #92838 Nice!
from godot.
With such an high number of active animation players on characters, you'd need SceneTree multithreading to achieve reasonable performance. However, this isn't finalized yet.
Your best bet for now is to disable animation playback for nodes that are far away, or set their process mode to Manual and step through their animation less often (e.g. once every 2 frames). This is a common approach in AAA games.
VisibilityNotifier3D in 3.x has a Max Distance property that can be used to disable animation playback in the distance automatically. It hasn't been ported to 4.x's VisibleOnScreenNotifier3D yet though.
from godot.
The manual process mode trick should be documented somewhere
from godot.
Animation does not support multi-core
from godot.
Animation does not support multi-core
This is expected for now, as SceneTree multithreading isn't finished yet. Work on this started in 4.1 but it's only applied to a few parts of the engine, so I don't think AnimationTree is able to work in a thread-safe manner currently.
Despite this, it's still possible to optimize AnimationTree significantly as evidenced by the PRs linked above.
from godot.
For more performance minimize or close the editor windows as that is alos consuming fps , and also what calinou said and make the debug screen fullscreen , as they are not the same size as flax so it not quite fair as a comparison...
from godot.
Related Issues (20)
- `EditorNode3DGizmo::add_collision_triangles` replaces previous meshes instead of adding HOT 1
- RectangleShape2D Differs In-Game
- Godot freezes my entire computer under several different conditions
- Godot application does not focus the window when launched from another client (itch, editor, steam, etc)
- [AnimationTree Optimizer] .blend / .glb animation interpolation error HOT 2
- Local to scene resource unlinks in inherited scenes when changed outside them HOT 4
- Crash when trying to modify Emitting parameter on CPUParticles2D when Signal finished() is linked to queue_free() HOT 1
- Crash when transitioning between scenes with SDFGI enabled and disabled respectively HOT 1
- Web export with gdextension not working on 4.3 HOT 4
- AudioStreamInteractive: Pop and mistiming in seamless transitions
- Version 3.6.rc1 freezing when try to export AAB. APK export works fine.
- Animation panel: moving cursor to Scene view focuses it, preventing further use of Animation keyboard shortcuts
- `RichTextLabel.get_line_offset` returns incorrect value for MSDF fonts
- Godot 4.3 Beta 3 - Failed loading resource , wav files and assigning it to export var HOT 2
- AddressSanitizer: heap-buffer-overflow caused by embree buffer check miscalculation HOT 1
- Screen will flash white on startup when the resizable window option is turn off
- Errors while reimporting assets on mac HOT 1
- `godot --headless --import` hangs indefinitely the first time it is run HOT 3
- Windows 10 - Blender Path does not contain a Blender installation HOT 4
- Godot4.2 does not have WebSocketServer and WebSocketClient class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from godot.