Camera: Add code to update View and Projection Matrices in update function #13552
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A user on the forums had recently found an issue when performing input while using an on-demand rendering loop. The issue was that the
onViewMatrixChangedObservable
wasn't firing as a part of pointer input. This behavior was present in previous versions. It was determined that the Lazy Picking changes may have caused this change because the aforementioned observable only fires duringgetViewMatrix()
calls. Before the Lazy Picking implementation, this function was called as a part of the creation and assignment of the picking ray for a PickingInfo object. Since this ray is only created when picking happens, a pointer event that doesn't require picking info won't ever get to the point wheregetViewMatrix
is called. Technically, these get functions should be called as a part of the camera's update function so the fix is to do just that.Tests have been added to verify that
onViewMatrixObservable
andonProjectionMatrixObservable
are firing properly.Forum Link: https://forum.babylonjs.com/t/on-demand-rendering-solution-broken-since-5-29/36379/1
Issue Link: #13551