react-three-renderer
react-three-renderer copied to clipboard
Save CPU by rendering intelligently?
In my use case, the scene is frequently not going anywhere: sometimes it's just sitting there in the background and won't change until someone interacts with it. If I let react-three-renderer auto-render, though, that will mean that a mostly-static image burns the CPU. Why did you choose not to have r3r act like react-dom, notice that my component tree hasn't changed, and do nothing? (Or have I misunderstood react-dom? At any rate, react-dom doesn't eat all of my CPU when nothing is changing.)
Would it be a reasonable approach for my app to wrap React3 in a component that keeps track of whether I'm animating anything at the moment and turns auto render on and off?
Currently we have https://github.com/toxicFork/react-three-renderer/wiki/Entry-Point#forcemanualrender to do exactly that, it's something you need to opt into because in other rendering engines it's done like this as well.
We can extend it so that if any property of any component changes it can be triggered, but still need to make sure that it will not have performance impacts for the other cases.