Skip to content

Key patched materials by injection source - #8

Open
kvnloo wants to merge 1 commit into
achrefelouafi:mainfrom
kvnloo:fix/shader-program-cache-key
Open

Key patched materials by injection source#8
kvnloo wants to merge 1 commit into
achrefelouafi:mainfrom
kvnloo:fix/shader-program-cache-key

Conversation

@kvnloo

@kvnloo kvnloo commented Sep 2, 2026

Copy link
Copy Markdown

three.js caches programs on onBeforeCompile.toString(). patchOnBeforeCompile wrappers are identically worded, so later injections reused the first compiled program (wrong uniforms, black frames).

customProgramCacheKey now includes the injection source, composed down the chain.

Pin: node --experimental-default-type=module --test src/utils/shaderPatch.test.js

SHA: e86480de37425245c3b1bf2719e4d60a53996a57

No origin issue. Origin target: achrefelouafi/LinearAbiltyCastingThreeJS (do not open until Linear HITL is Done).

three.js caches programs on onBeforeCompile.toString(). Wrappers from
patchOnBeforeCompile are identically worded, so later patches reused the
first compiled program. customProgramCacheKey now includes fn source.
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.

1 participant