Fix Silk background freezing on parameter change - #1011
Merged
Conversation
1 task
Copilot
AI
changed the title
[WIP] Fix background 'Silk' freezing in Background Studio on parameter change
Fix Silk background freezing on parameter change
Jul 26, 2026
DavidHDev
approved these changes
Jul 26, 2026
DavidHDev
marked this pull request as ready for review
July 26, 2026 21:25
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.
The Silk background (R3F) froze whenever a parameter was changed in Background Studio instead of applying the update and continuing the animation.
Cause
uniformswas rebuilt (new object reference) on every prop change because all props were in theuseMemodependency array. Handing a freshuniformsobject to<shaderMaterial>each render makes R3F swap the material's uniforms out from under the runninguseFrameloop, stalling the animation.Changes
uniformsobject once (useMemo(..., [])) so the reference passed to<shaderMaterial>never changes..valuefields in auseEffectwhen props change, so updates apply without remounting the material. Color usessetRGB(r, g, b)(matching the originalnew Color(r, g, b), sinceColor.settakes a single arg).content(JS/CSS),tailwind(JS/TW),ts-default,ts-tailwind.public/r/Silk-{JS,TS}-{CSS,TW}.jsonregistry files.