Repository navigation
Conversation
…rials Key nodes by type and settings instead of id so materials that only differ in uniform values reuse a single node build. Each render object maps the shared build's uniforms to its own material's uniform nodes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Node.traverse() revisits shared subgraphs once per path, which never finishes on large MaterialX graphs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
🖼️ E2E screenshot tests❌ 1 example(s) failed (full artifacts).
|
|
This reminds me of the good old debate on whether I feel like #34684 is the right approach (just needs a better name). |
I completely disagree and I don't think enough is understood about the problem to say this... I will be less available for the next few weeks but please give me some time to write up what the issues are. #34684 does not fix my problems around dynamically extended materials (as in adding "layers" like fade effects or other visualizations to user-provided node materials), which 3DTilesRendererJS and other projects make heavy use of. In WebGLRenderer extending materials with "onBeforeCompile" to add new effects was a common pattern - which worked with multiple nested functions - and it was fast. There's no fast to dynamically extend a material in TSL and there's no reason there shouldn't be. |



Related issue: #33821, #34684
Description
This is a primarily AI-driven prototype put together based on some of the write-ups from #34684. It aims to share node builds between detected structurally identical materials to avoid a full node build for a material where the program is already present. The local e2e runs fail on both dev and this branch identically, so we'll see if it passes everything here.
Here are some timings from this branch vs the other using Case 1 from #33821. The proxy material skips the graph walk for the cache key and uniform gather, which can account for some of the timing differences. So there's still some benefit to other workarounds so far, but this kind of change should help with all node material build times:
I don't expect this to be merged as-is, since I'm not familiar enough with all of the internals, but hopefully serve as a demonstration of something that could be done.