Skip to content

CameraControls break on-demand rendering (by invalidating every frame) #471

Open
@lnvglr

Description

Describe the bug

I am setting the render-mode on my TresCanvas to on-demand. I am using the CameraControls for controlling orbiting. I expect the @render emitter to fire only briefly when mounting the scene. But instead, it fires on every frame.

<TresCanvas
  preset="realistic"
  render-mode="on-demand"
  @render="console.log('rendering ...')"
>
  <TresPerspectiveCamera />
  <CameraControls v-bind="controlsState" make-default />

  <!-- rest of the scene -->
</TresCanvas>

Commenting out the rest of the scene does not change the behavior, when commenting out <CameraControls />, on-demand returns to working as expected.

FYI: It does not happen with <OrbitControls /> component.

Reproduction

https://stackblitz.com/edit/tresjs-minimal-reproduction-gj1p2u?file=src%2FApp.vue

Steps to reproduce

  1. Open console and verify that the @render emitter is firing the console.log
  2. Comment out <CameraControls v-bind="controlsState" make-default /> and check the console to verify that logging stops after a few render loops

System Info

No response

Used Package Manager

npm

Code of Conduct

Activity

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

Metadata

Assignees

Labels

bugSomething isn't workingp3-minor-bugAn edge case that only affects very specific usage (priority)

Type

No type

Projects

  • Status

    No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions