-
-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
gotta fix a failing test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hanzlamateen thank you that's very helpful |
In an apartment scene in which I have placed 6 cyberbots I've noticed low framerates after loading the models in, this was not an issue on dev, and I switched between the two to check, going to triple check now because I'm not immediately sure why this would be happening. Follow up: Switching to dev I got expected framerates, but after switching back to this branch this issue returns. |
Low framerates when models are dropped in seems related to raycasts for drop shadows. We need to enable bounding volume hierarchies by default to speed up CPU raycasts. Currently the default is to have them disabled. I'll invert that. |
We also should not do any drop shadows logic in the editor |
Ready to merge this in; In separate PRs:
|
This is actually a super good point. |
Summary
This PR addresses superfluous state invalidations that were causing some reactors to re-run unnecessarily, including it's side-effects (after making the drop-shadow reactor reactive to changes in the GroupComponent to address the issue described in the note below, these superfluous state invalidations became evident).
More details on this hookstate issue here: avkonst/hookstate#299
The solution involves placing all component instances in their own hookstate proxy, and reactively keeping track of component additions/removals in a stateful Component.existenceMap. With each component instance isolated in this way, changes to component data should only affect the reactors that are actually using that data.
Note:
This PR also cleans up some issues w/ the drop-shadow reactor, e.g., a race condition where it would generate a shadow too small for an avatar before the avatar had a chance to load it's model.