Skip to content
This repository was archived by the owner on Feb 21, 2022. It is now read-only.
This repository was archived by the owner on Feb 21, 2022. It is now read-only.

Performance when using TrackballControls #14

@alfonsomunozpomer

Description

@alfonsomunozpomer

Hi,

First of all congratulations on pulling off such a great project!

I was having a look at https://github.com/toxicFork/react-three-renderer-example/blob/master/src/examples/WebGLCameraExample/index.js and in my tests, the line controls.addEventListener(change, () => { introduces a noticeable performance hit. My guess is that setState makes the scene be rendered twice: once by this.controls.update(); inside _onAnimate and then again by the render method.

What’s to lose if we comment out the controls.addEventListener(change, () => { method, besides the camera position in the state (which from what I can tell is only used when the view is initially rendered)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions