postprocessing icon indicating copy to clipboard operation
postprocessing copied to clipboard

Is viewport respected?

Open drone1 opened this issue 2 years ago • 2 comments

Simple question. I don't see anything about the viewport or examples of it used. My application renders multiple scenes within the same buffer using scissor/viewport. Would love to use this but wanted to ask before I spend any time. Thanks for your time.

drone1 avatar Jul 20 '22 10:07 drone1

This is currently not supported, but it can be done with hacks: https://codesandbox.io/s/long-darkness-szcisb?file=/src/App.js I'll look into options to add automatic support for WebGLRenderer.setViewport and WebGLRenderer.setScissor.

vanruesc avatar Jul 23 '22 19:07 vanruesc

That would be wonderful. Thank you!

On Sat 23. Jul 2022 at 21:39, Raoul v. R. @.***> wrote:

This is currently not supported, but it can be done with hacks: https://codesandbox.io/s/long-darkness-szcisb?file=/src/App.js I'll look into options to add automatic support for WebGLRenderer.setViewport and WebGLRenderer.setScissor.

— Reply to this email directly, view it on GitHub https://github.com/pmndrs/postprocessing/issues/386#issuecomment-1193178339, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQIEPFU6REA4ZO4KLNJNTLVVRDALANCNFSM54DDP7JA . You are receiving this because you authored the thread.Message ID: @.***>

drone1 avatar Jul 23 '22 21:07 drone1

Please take a look again. It is multiple cameras rendering the same scene. The specific description and code are in #507 , thank you

xuchaozou avatar Jun 25 '23 01:06 xuchaozou

I'd like to be able to render multiple scenes with multiple cameras, not a single scene. Is it supported? Thank you so much!

On Sun, Jun 25, 2023 at 3:33 AM xuchaozou @.***> wrote:

Please take a look again. It is multiple cameras rendering the same scene. The specific description and code are in #507 https://github.com/pmndrs/postprocessing/issues/507 , thank you

— Reply to this email directly, view it on GitHub https://github.com/pmndrs/postprocessing/issues/386#issuecomment-1605812359, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQIEPGPSNNPE7ITRHUHX4TXM6IM5ANCNFSM54DDP7JA . You are receiving this because you authored the thread.Message ID: @.***>

drone1 avatar Jul 05 '23 17:07 drone1

@drone1 You can use multiple RenderPass instances to render multiple scenes. Make sure to set RenderPass.clearPass.enabled = false if you want to render the scenes to the same frame buffer. Depending on your use case, your composition may require saving intermediate render results in textures via CopyPass. Blending textures together can be done with TextureEffect.

vanruesc avatar Jul 14 '23 12:07 vanruesc

Thanks for the demo, I've got the feeling that this scissors/viewport example in the codesandbox could be useful to have a screen which would be split. Eg first left third side of the screen with a given EffectPass applied, center third with another, and right third with again another. This should be less performance hungry than doing full-screen RenderPass with different EffectPasses and combining them - for example via a ShaderPass, right?

Tried forking here with viewport [0,0,w,h] and scissors set to half-width, trying to adding different RenderPasses after the scissorPassA/B but is applies to the whole screen for now.

jo-chemla avatar Feb 10 '24 21:02 jo-chemla

@jo-chemla Proper support for scissor/viewport settings is planned for v7.

Closing this in favor of #570.

vanruesc avatar Feb 12 '24 00:02 vanruesc

Thanks for getting back, I'll follow the scissor/viewport v7 implementation thread - just thought it could be hacked in the meantime with the current v6 codesandbox, but waiting for proper support in v7 is a great alternative.

And thanks for the awesome work on the postprocessing lib!

jo-chemla avatar Feb 12 '24 13:02 jo-chemla