TSL: Share context between RTT#28811
Conversation
|
@Mugen87 It should fix the use of |
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
|
||
| const material = this._material || ( this._material = builder.createNodeMaterial() ); | ||
| material.fragmentNode = blur(); | ||
| material.fragmentNode = blur().context( builder.getSharedContext() ); |
There was a problem hiding this comment.
Do you mind explaining why .context( builder.getSharedContext() ) is now used in GaussianBlurNode (and not just RTTNode)?
There was a problem hiding this comment.
As it is a different render-pass, this shader is compiled in a different NodeBuilder and will probably not share the same context or the same settings defined in the renderer, any Node that uses the RenderToTexture approach can inherit the context defined in its essence if it is transferred with this approach.
There was a problem hiding this comment.
So if this change would be missing in GaussianBlurNode, renderer settings could get out of sync and produce similar color errors like reported in #28781 (comment)?
There was a problem hiding this comment.
So if this change would be missing in GaussianBlurNode, renderer settings could get out of sync and produce similar color errors like reported in #28781 (comment)?
Yes, that's it, but only when a node uses context to obtain parameters like the renderOutput() case, in other situations it should be ok.
Indeed, colors are now correct! 🙌 |
Related issue: #28781 (comment)
Description
Share context between RTT. There are possibly more nodes to add the
.context( builder.getSharedContext() )