Remove redundant CameraComponent.frameUpdate#8977
Merged
Merged
Conversation
`CameraComponent.frameUpdate(rt)` eagerly recomputed the camera's aspect ratio for ASPECT_AUTO. That became redundant once #8633 made `Camera.aspectRatio` auto-refresh for ASPECT_AUTO on every read: the projection matrix (`_evaluateProjectionMatrix` reads `this.aspectRatio`) already picks up the current aspect on access, so culling and rendering get an up-to-date frustum without the eager call. Its `rt` argument was also moot - the getter recomputes from the camera's own render target on the next read, overwriting anything frameUpdate set, and the sole caller passed `camera.renderTarget` anyway. Remove the method (it was @ignore) and its only caller in `Renderer.updateLightVisibility`, which now just updates the frustum. `CameraComponent.calculateAspectRatio` (public) is kept. No public API or behavior change.
Build size reportThis PR changes the size of the minified bundles.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
CameraComponent.frameUpdate(rt)eagerly recomputed the camera's aspect ratio forASPECT_AUTO. That became redundant once #8633 madeCamera.aspectRatioauto-refresh forASPECT_AUTOon every read:Renderer.updateCameraFrustumreadscamera.projectionMatrix, and_evaluateProjectionMatrixreadsthis.aspectRatio— which recomputes from current inputs forASPECT_AUTO. So culling and rendering already get an up-to-date frustum without the eager call.rtargument was moot: the getter recomputes from the camera's own render target on the next read (overwriting whateverframeUpdateset), and the sole caller passedcamera.renderTargetanyway.Changes:
CameraComponent.frameUpdate(it was@ignore) and its only caller inRenderer.updateLightVisibility(which now just updates the camera frustum).ASPECT_AUTOimport in the camera component.CameraComponent.calculateAspectRatio(public).No public API or behavior change.