Opened 11 years ago
Last modified 4 years ago
#2026 new defect
[PATCH] Skinning optimisations.
Reported by: | tuan kuranes | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Patch: | Phab:D2458 |
Description (last modified by )
Skeletal animations skinning optimisations
A TODO patch followup, must have is :
Note that there is a serious questions about them being useful at all CPU side, and a flag in model.xml file should be telling code wheter or not computing bounding box each frame for each unit. check with breakpoints in CModel::GetWorldBoundsRec
Unless in the case of a "crane" or very long object with animation changing significantly its bounding box, keeping the static compute box is more than enough and would give serious CPU perf gains.
Attachments (4)
Change History (20)
by , 11 years ago
Attachment: | skinning.patch added |
---|
comment:1 by , 11 years ago
Description: | modified (diff) |
---|---|
Summary: | Skinning optimisations. → [PATCH] Skinning optimisations. |
comment:2 by , 11 years ago
Keywords: | patch review added |
---|---|
Milestone: | Backlog → Alpha 14 |
Priority: | Should Have → Nice to Have |
comment:3 by , 11 years ago
Description: | modified (diff) |
---|
comment:4 by , 11 years ago
Owner: | set to |
---|
comment:5 by , 11 years ago
Milestone: | Alpha 14 → Alpha 15 |
---|
by , 11 years ago
Attachment: | skinning_update.patch added |
---|
comment:6 by , 11 years ago
comment:7 by , 10 years ago
Milestone: | Alpha 15 → Alpha 16 |
---|
by , 10 years ago
Attachment: | cleanedup.patch added |
---|
follow-up: 9 comment:8 by , 10 years ago
Removed everything that definitely wasn't an optimization/was too big an obfuscation. As you can see, there is not much left.
comment:9 by , 10 years ago
Replying to wraitii:
Removed everything that definitely wasn't an optimization/was too big an obfuscation. As you can see, there is not much left.
Thanks! Looks pretty good, in the sense of eliminating some copies and allocations. But the functions aren't very intuitive now, it's unusual to have a function with one input parameter that it appends and returns the result into. At least the doxygen comments should be updated to reflect that (we can pretend people actually read them).
It's better to add a forward class declaration to header files and include headers in the cpp file (for CBoundingBoxAligned
).
Line 45 in ModelDef.cpp
should be indented.
Line 428 of Model.cpp
breaks rendering, A *= B
isn't the same as A = A * B
, it seems to be premultiplying (A = B * A
).
comment:10 by , 10 years ago
Milestone: | Alpha 16 → Alpha 17 |
---|
comment:11 by , 10 years ago
Owner: | removed |
---|
comment:12 by , 10 years ago
Keywords: | review removed |
---|
comment:13 by , 10 years ago
Milestone: | Alpha 17 → Alpha 18 |
---|
comment:14 by , 9 years ago
Milestone: | Alpha 18 → Backlog |
---|
comment:15 by , 8 years ago
I have attached a slightly different approach, SkinPoint gets a "batched" version. For some odd reason, this seems to speed it up significantly. Maybe it's because of less function call overhead, maybe it's because GCC optimized this version to use SSE. Overall, it shaved around 0.5% CPU time off a full replay.
comment:16 by , 4 years ago
Description: | modified (diff) |
---|---|
Keywords: | patch removed |
Patch: | → Phab:D2458 |
I had a look at the code fsincos but it doesn't work for me. The non-rigged meshes look fine, but the animated ones are totally broken, because the logic is incorrect. If you look carefully your batch processing doesn't batch them in the same way.
updated the patch to SVN r13672