File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,32 @@ class PassNode extends TempNode {
635635
636636 }
637637
638+ /**
639+ * Precompiles the pass.
640+ *
641+ * Note that this method must be called after the pass configuartion is complete.
642+ * So calls like `setMRT()` and `getTextureNode()` must proceed the precompilation.
643+ *
644+ * @async
645+ * @param {Renderer } renderer - The renderer.
646+ * @return {Promise } A Promise that resolves when the compile has been finished.
647+ * @see {@link Renderer#compileAsync }
648+ */
649+ async compileAsync ( renderer ) {
650+
651+ const currentRenderTarget = renderer . getRenderTarget ( ) ;
652+ const currentMRT = renderer . getMRT ( ) ;
653+
654+ renderer . setRenderTarget ( this . renderTarget ) ;
655+ renderer . setMRT ( this . _mrt ) ;
656+
657+ await renderer . compileAsync ( this . scene , this . camera ) ;
658+
659+ renderer . setRenderTarget ( currentRenderTarget ) ;
660+ renderer . setMRT ( currentMRT ) ;
661+
662+ }
663+
638664 setup ( { renderer } ) {
639665
640666 this . renderTarget . samples = this . options . samples === undefined ? renderer . samples : this . options . samples ;
You can’t perform that action at this time.
0 commit comments