-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render issue with continuous resize animation #848
Comments
Closing. Can't reproduce in v4. Hi @JakobHock , Your example StackBlitz uses Tres v2: "dependencies": {
"@tresjs/cientos": "2.1.2",
"@tresjs/core": "2.1.2",
"@vueuse/core": "^11.1.0",
"three": "^0.152.2",
"vue": "^3.3.4"
}, We're now on v4. There's no issue in v4 as far as I can see: https://stackblitz.com/edit/stackblitz-starters-tmzph4?file=src%2Fcomponents%2FTheExperience.vue |
Hello @andretchen0, sorry i think i went off of some stackblitz template and didn't look at the version. My bad. Issue with your example still remains. The canvas still does not resize correctly with the container continuously. Ideally it would have the correct size at every render. |
I'm not sure I follow. At least, what I understand from above doesn't seem to line up with what I'm seeing. Latest Chrome on Mac: Screen.Recording.2024-10-17.at.18.05.42.movThere's an issue with the StackBlitz above – |
Ahh, i'm really sorry about that. As you can see when the view is "tres" the resize animation is jumping only when the container has finished. |
Hi @JakobHock No problem. Mistakes happen. Here's what the latest Stackblitz looks like for me: Screen.Recording.2024-10-18.at.14.42.32.movI'm not trying to be obtuse, but I don't notice the reported bug from the top-line issue here. Is that still what's under discussion?
If the bug is visible in the video above, can you download the video and step through it? Then post 2 sequences of still frames of:
|
Hello @andretchen0, This is what it looks like on my browser. 2024-10-18.15-03-29.mp4I thought it would look the same for everyone. Edit: I would guess the debounced size invalidation is not really an option, as there are 540 hz monitors. 144hz: 144hz.mp460hz: 60hz.mp4 |
Reopening. Thanks for the clarification. |
I'm not sure what a good solution is here. I wasn't part of the original debounce discussion for the most part, but I seem to remember it was introduced due to poor performance on resize. |
One idea would be to use the useFps composable from vueuse. I think ideally the invalidation should happen internally before the next render is called, but as the structure of the composables are a bit separated, this achieves the same thing with a bit more performance overhead Seems to work fine has does not seem to have an impact on performance. Happy to open a PR if this is a good solution from your POV. |
I don't believe that one was made. We've only recently started adding dev playgrounds for issues. If we could make one for this issue, that'd be great. R3FIt looks like R3F accepts a config object for specifying how resizing should be handled. I think it would be great to offer something similar. That lets users fix these sorts of issues on their own, based on their use case, if they need to.
|
Describe the bug
Due to the debounced ref introduced in #512, the canvas only renders once the resize animation has finished.
How it's supposed to work
It can be fixed by moving renderer size update and the camera projection matrix update to before rendering or using useFps composable from vueuse to dynamically calculate debounceTime
Reproduction
Monitor with refresh rate above 100 hz needed
https://stackblitz.com/edit/stackblitz-starters-jtmew9?file=src%2FApp.vue
Steps to reproduce
Have container of TresCanvas resize continuously.
System Info
Used Package Manager
pnpm
Code of Conduct
The text was updated successfully, but these errors were encountered: