Uzixt
(Uzi)
January 5, 2025, 12:55am
1
Setting EditableMesh:SetNormal()
can be extremely slow, especially as the number of vertices sharing the same normal id increases.
The problem seems to be because of
DynamicGeometryManager :: transcodeVerticesAndCalculateBounds
. In my case, it took 135ms to process when
:SetNormal()
was called on a normal id, where 1000 vertices are sharing the same normalId.
The problem is made even worse since the time complexity is O(n^2)
where the x-axis is time (seconds) and the y-axis is number of vertices sharing the same normal id that is being set.
This means that if you have 20,000 vertices sharing a normal id, it’ll crash the game since it takes too long to compute.
System Information:
Windows 10
Intel i5-9400F
NVidea GeForce GTX 1650
16GB RAM
Expected behavior
It should only be taking a few milliseconds.
1 Like
L3Norm
(L3Norm)
January 6, 2025, 6:06pm
2
Thanks for the report, this is definitely something that needs to be optimized.
It seems that the likely culprit is automatic normal computation. For the normal in question, does setting its value manually improve the performance?
emesh:SetNormal(nid, emesh:GetNormal(nid))
2 Likes
Uzixt
(Uzi)
January 6, 2025, 6:38pm
3
L3Norm:
For the normal in question, does setting its value manually improve the performance?
emesh:SetNormal(nid, emesh:GetNormal(nid))
Unfortunately not, it still takes the same amount of time.
1 Like
L3Norm
(L3Norm)
January 8, 2025, 12:07am
4
Okay, thanks for checking, and for the report. I’ll give it a look.
2 Likes
Uzixt
(Uzi)
February 9, 2025, 7:36am
5
Hey there, just checking in - any updates?
L3Norm
(L3Norm)
February 10, 2025, 9:34pm
6
Hi, I haven’t taken a look at it yet, it’s still on my backlog. Thanks for the reminder
1 Like
Hey,
This is now in the release notes.
Hi everyone, and happy March 13!
On this day in 1781, William Herschel observed a celestial object with his homemade telescope and determined that it was moving too quickly to be a star — so it had to be a comet. His discovery kicked off further investigation into the object, which turned out to be the seventh planet in our solar system, Uranus, located a mere 3 billion kilometers from the Sun.
Fixes quadratic time complexity of render transcode step for meshes containing duplicate normal index as described in on the DevForum
That’s the sort of notes that got me to check the link to see what this meant
2 Likes
L3Norm
(L3Norm)
May 7, 2025, 4:37pm
8
The fix for this has been enabled, let me know if you’re still seeing the bad behavior.
1 Like
system
(system)
Closed
June 21, 2025, 1:57am
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.