torsteingrindvik / bevy-vfx-bag

Apache License 2.0
135 stars 8 forks source link

Support for custom ScalingMode #68

Closed DasLixou closed 1 year ago

DasLixou commented 2 years ago

add support for custom ScalingMode. i currently have a scalingmode set in my Camera3dBundle aka PostProcessingInput but it doesnt apply when i use vfx-bag. probably because it is a camera of a camera?

torsteingrindvik commented 2 years ago

I can take a look at this.

I also have to look at ScalingMode since I haven't used it. Just to make sure, could you describe what you expect to happen and what actually happens?

DasLixou commented 2 years ago

ScalingMode is a thing on the camera that says how it behaves when the target gets resized. the problem seems that the image (target) that it now renderes to doesn't resize to the window size when i get it correctly.

DasLixou commented 2 years ago

Without your plugin (ScalingMode works as expected) grafik

With your plugin (is wrongly scaled) grafik

torsteingrindvik commented 2 years ago

Thank you for the details. I will look into it as soon as I have time.

torsteingrindvik commented 1 year ago

I attempted a workaround for this by extracting the orthographic projection from the user's input camera, and propagating that to the spawned cameras.

This kinda fixed it, but there were some other bugs.

But this all boils down to issues due to spawning cameras for effects. Now with Bevy 0.9 there is a proper way to do post processing.

I am going to port this entire plugin to use that approach, and then there will be no cameras spawned, and I expect the issue to go away.

Therefore I consider this bug blocked on #45 .

DasLixou commented 1 year ago

Oh LOL i also started a Little vfx Library today to see how far I can come and also make it not use cameras lmao 🤣.

DasLixou commented 1 year ago

@torsteingrindvik seems like i found the issue. Your image to what the camera displays its thing on won't rescale. i made a system that makes it in my library (it currently doesn't show it but it gets piped trough correctly :D ) which resizes the images to the end-target. here if u wanna see: https://github.com/LixouStudios/bevy_vfx/commit/cb8f3c60f50638485c73477aac030cce4f2f6093

torsteingrindvik commented 1 year ago

@DasLixou thanks.

I have started on a plugin rework now though so I don't expect this issue to linger for very long.

DasLixou commented 1 year ago

@DasLixou thanks.

I have started on a plugin rework now though so I don't expect this issue to linger for very long.

Are you going to use RenderGraphs? @torsteingrindvik

DasLixou commented 1 year ago

@torsteingrindvik would you make the plugin rework on a public branch? I would like to contribute a little bit :)

torsteingrindvik commented 1 year ago

It will use render graphs, and yes it will be public when I have landed on an approach.

DasLixou commented 1 year ago

It will use render graphs, and yes it will be public when I have landed on an approach.

Cool 😎

torsteingrindvik commented 1 year ago

After the rework this plugin should behave the same as Bevy proper for scalingmode. If this is still relevant to you and you try this out let me know how it goes.

DasLixou commented 1 year ago

😎