Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instanced Mesh lags a frame behind in auto updateMode #18

Closed
diarmidmackenzie opened this issue Dec 3, 2022 · 1 comment
Closed

Instanced Mesh lags a frame behind in auto updateMode #18

diarmidmackenzie opened this issue Dec 3, 2022 · 1 comment

Comments

@diarmidmackenzie
Copy link
Owner

If you enable "debug" mode in the physics examples, you can see that Instanced Mesh rendering lags a frame behind the physics engine's view of the world.

image

Possible this could be fixed by somehow making sure the instanced-mesh tick() (when we copy entity positions into the insance matrix array) happens afterthe physics tick(), but that might not be enough, and I think we can do better.

I'd like to find a way to move this copy into the render pipeline, after THREE.js has done a full update of all matrices, but before actually doing the rendering. Can probably use techniques similar to [this].(https://github.com/diarmidmackenzie/aframe-multi-camera#add-render-call)

Benefits of this would be 2-fold:

  • no need to update matrices other than the updates THREE.js already does.
  • matrix data would always be up-to-date at the point of copying.

Even in manual update mode, we should queue up the upates, and actually perfrom them at this later stage. That would avoaid the need to do additional matrix updates over & above those already done per-frame by THREE.js, so we could also solve #12 at the same time.

@diarmidmackenzie diarmidmackenzie changed the title Instanced Mesg lags a frame behind in auto updateMode Instanced Mesh lags a frame behind in auto updateMode Dec 3, 2022
@diarmidmackenzie
Copy link
Owner Author

Fixed by #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant