Skip to content

Is viewport respected? #386

Closed
Closed

Description

@drone1

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.

Activity

  1. vanruesc commented on Jul 23, 2022

    @vanruesc
    Member

    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.

  2. drone1 commented on Jul 23, 2022

    @drone1
    Author
  3. xuchaozou commented on Jun 25, 2023

    @xuchaozou

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

  4. drone1 commented on Jul 5, 2023

    @drone1
    Author
  5. vanruesc commented on Jul 14, 2023

    @vanruesc
    Member

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

  6. jo-chemla commented on Feb 10, 2024

    @jo-chemla

    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.

  7. vanruesc commented on Feb 12, 2024

    @vanruesc
    Member

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

    Closing this in favor of #570.

  8. jo-chemla commented on Feb 12, 2024

    @jo-chemla

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions