Skip to content

Fix flickering turrets in techroom#7527

Merged
wookieejedi merged 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-techroom-animation
Jun 15, 2026
Merged

Fix flickering turrets in techroom#7527
wookieejedi merged 1 commit into
scp-fs2open:masterfrom
wookieejedi:fix-techroom-animation

Conversation

@wookieejedi

Copy link
Copy Markdown
Member

Turrets with initial animations flip animation angles every frame in the techroom. The commit returns TriStateBool from model_get_cached_ui_render_instance specifically so callers can run setup only when a new instance is created, but only render_tech_model (the Lua path) actually checks it.

Since the instance is cached and persists across frames, every frame re-runs clearShipData + initial-animation start on an already-animated instance, re-applying the initial animations relative to the current (already-animated) pose. This is what seems to produces the per-frame flip/jitter.

This PR caches it to prevent this, and fixes #7526. Tests confirm it works as expected.

Happy to edit or use a different method if folks would prefer!

Turrets with initial animations flip animation angles every frame in the techroom.  The commit returns TriStateBool from model_get_cached_ui_render_instance specifically so callers can run setup only when a new instance is created, but only `render_tech_model` (the Lua path) actually checks it.

Since the instance is cached and persists across frames, every frame re-runs clearShipData + initial-animation start on an already-animated instance, re-applying the initial animations relative to the current (already-animated) pose. This is what seems to produces the per-frame flip/jitter.

This PR caches it to prevent this, and fixes scp-fs2open#7526. Tests confirm it works as expected.
@wookieejedi wookieejedi added this to the Release 26.0 milestone Jun 14, 2026
@wookieejedi wookieejedi added the fix A fix for bugs, not-a-bugs, and/or regressions. label Jun 14, 2026

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and covers all call sites

@wookieejedi wookieejedi merged commit 43387ca into scp-fs2open:master Jun 15, 2026
20 checks passed
@wookieejedi wookieejedi deleted the fix-techroom-animation branch June 15, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression with techroom submodels and animation angles

2 participants