Skip to content
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

dynamic resizing #12

Open
simbleau opened this issue Nov 24, 2023 · 2 comments
Open

dynamic resizing #12

simbleau opened this issue Nov 24, 2023 · 2 comments

Comments

@simbleau
Copy link
Contributor

simbleau commented Nov 24, 2023

One of the core features of vector graphics is to be resizable. I don't see an example that allows dynamic resizing. In all of the examples the size is explicitly hardcoded.

e.g. -

    animation_image.resize(Extent3d {
        width: 1024,
        height: 1024,
        ..default()
    });

It would make sense to have an example that resizes all of the images when there's a bevy resize event.

image
@simbleau simbleau changed the title dynamic resizing example dynamic resizing Nov 24, 2023
@simbleau
Copy link
Contributor Author

Got a potential PR for an example which dynamically resizes on window resize events, even in 3D contexts. I'm not super satisfied with the implementation, though. I'll maybe pick this up again soon.

Progress screenshots:

image

image

@dragostis
Copy link
Contributor

This is something I thought about but ended up decided against it because it hides a trade-off behind the scenes. A solution could be iterating through all the geometry, finding the maximum (minimum) screen-space delta UV, and using that to reallocate the texture in the background. A bounding-box approach could be cheaper if you first get per-object max (min) delta UV.

In any case, for the time being, I won't be able to invest time into a feature like this, but I'm happy to merge a PR as long as we're not hiding too much magic beneath the carpet. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants