Skip to content

Conversation

@Oletus
Copy link
Contributor

@Oletus Oletus commented Mar 21, 2019

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.

@mrdoob mrdoob added this to the r103 milestone Mar 22, 2019

isLastEnabledPass: function ( passIndex ) {

for ( i = passIndex + 1; i < this.passes.length; ++i ) {
Copy link
Owner

@mrdoob mrdoob Mar 22, 2019

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 ++ ) {

Copy link
Contributor Author

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".

@Oletus Oletus force-pushed the postprocessing-render-to-screen branch from 92e1b47 to adc65f6 Compare March 22, 2019 07:48
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.
@Oletus Oletus force-pushed the postprocessing-render-to-screen branch from adc65f6 to 911e4b2 Compare March 22, 2019 07:53
@mrdoob mrdoob merged commit f364288 into mrdoob:dev Mar 22, 2019
@mrdoob
Copy link
Owner

mrdoob commented Mar 22, 2019

Thanks!

@Oletus Oletus deleted the postprocessing-render-to-screen branch March 22, 2019 08:59
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.
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

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.

3 participants