-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Set Pass.renderToScreen automatically in EffectComposer #16033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| isLastEnabledPass: function ( passIndex ) { | ||
|
|
||
| for ( i = passIndex + 1; i < this.passes.length; ++i ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should initialise i.
for ( var i = passIndex + 1; i < this.passes.length; i ++ ) {There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, that was a silly mistake. Amended the commit now with "var".
92e1b47 to
adc65f6
Compare
The last enabled EffectComposer pass is the only one that can really render to the screen, so we can set the renderToScreen flag in the passes automatically. The only case where EffectComposers don't render to the screen at all in the current examples is webgl_materials_skin, that sets up multiple EffectComposers and then combines their results. For that special case we now have a renderToScreen flag in EffectComposer. This simplifies setting up EffectComposer and will make further enhancements a bit easier.
adc65f6 to
911e4b2
Compare
|
Thanks! |
| this.clear = false; | ||
|
|
||
| // if set to true, the result of the pass is rendered to screen | ||
| // if set to true, the result of the pass is rendered to screen. This is set automatically by EffectComposer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should Pass.renderToScreen be private, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least one example uses Pass without using EffectComposer and needs to set this. Maybe it would be better to make this private but then we'd have to at least refactor that example first.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That example is webgl_postprocessing_unreal_bloom.html.
The last enabled EffectComposer pass is the only one that can really render to the screen, so we can set the renderToScreen flag in the passes automatically. The only case where EffectComposers don't render to the screen at all in the current examples is webgl_materials_skin, that sets up multiple EffectComposers and then combines their results. For that special case we now have a renderToScreen flag in EffectComposer.
This simplifies setting up EffectComposer and will make further enhancements a bit easier.