Skip to content

Phantom Camera: Reduce unnecessary processing#2271

Merged
manuq merged 1 commit into
mainfrom
wjt/phantom-camera-reduce-unnecessary-processing
Jun 2, 2026
Merged

Phantom Camera: Reduce unnecessary processing#2271
manuq merged 1 commit into
mainfrom
wjt/phantom-camera-reduce-unnecessary-processing

Conversation

@wjt
Copy link
Copy Markdown
Member

@wjt wjt commented Jun 2, 2026

Phantom Camera: Reduce unnecessary processing

Apply the changes I have submitted upstream in
ramokz/phantom-camera#657 to avoid processing
every frame in the editor, even when the open scene does not use
PhantomCamera.

As detailed in that PR and in
ramokz/phantom-camera#649, I haven't figured
out how to avoid the PhantomCameraHost node processing every frame even
when the viewfinder is closed.

And as also detailed there: any inactive PhantomCamera2D still
_process()es every frame, and the PlayerHook has an inactive
PhantomCamera2D, so...

However in most scenes containing the player we have at least one moving
tree or water ripple animation, which causes the scene to render at
60fps anyway. So, oh well!

Apply the changes I have submitted upstream in
ramokz/phantom-camera#657 to avoid processing
every frame in the editor, even when the open scene does not use
PhantomCamera.

As detailed in that PR and in
ramokz/phantom-camera#649, I haven't figured
out how to avoid the PhantomCameraHost node processing every frame even
when the viewfinder is closed.

And as also detailed there: any inactive PhantomCamera2D still
_process()es every frame, and the PlayerHook has an inactive
PhantomCamera2D, so...

However in most scenes containing the player we have at least one moving
tree or water ripple animation, which causes the scene to render at
60fps anyway. So, oh well!
@wjt wjt requested a review from a team as a code owner June 2, 2026 14:42
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Play this branch at https://play.threadbare.game/branches/endlessm/wjt/phantom-camera-reduce-unnecessary-processing/.

(This launches the game from the start, not directly at the change(s) in this pull request.)

@manuq manuq merged commit 6781c11 into main Jun 2, 2026
7 checks passed
@manuq manuq deleted the wjt/phantom-camera-reduce-unnecessary-processing branch June 2, 2026 15:13
@manuq
Copy link
Copy Markdown
Collaborator

manuq commented Jun 2, 2026

And as also detailed there: any inactive PhantomCamera2D still _process()es every frame, and the PlayerHook has an inactive PhantomCamera2D, so...

Could this be because of the "Always" default in inactive update mode?

image

@wjt
Copy link
Copy Markdown
Member Author

wjt commented Jun 2, 2026

Could this be because of the "Always" default in inactive update mode?

Yes. However if you disable that, switching to this camera is janky in-game, because its position is not updated until the moment it is activated. Sorry, I forgot to write that in this PR!

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

Successfully merging this pull request may close these issues.

2 participants