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

Needed features to use superconductor as drop in for bevy_pbr #10

Open
dekuraan opened this issue Jul 29, 2022 · 2 comments
Open

Needed features to use superconductor as drop in for bevy_pbr #10

dekuraan opened this issue Jul 29, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@dekuraan
Copy link

dekuraan commented Jul 29, 2022

Essential:

Very Useful:

  • Use bevy_render's RenderGraph so we can easily add render plugins (see bevy_pbr impl)

Nice to have:

  • compatibility with bevy_render/bevy_pbr's primitives
  • compatibility with bevy_asset's assets
@dekuraan dekuraan added the enhancement New feature or request label Jul 29, 2022
@dekuraan
Copy link
Author

I believe your asset system is the way it is for a reason, so if the current asset system is better than bevy_asset I think there is no need to use bevy_asset

@expenses
Copy link
Contributor

expenses commented Aug 1, 2022

So tbh I'm not 100% convinced on the value of being a drop-in replacement, as I think that bevy_render has made some compromises that we'd benefit from avoiding. That said, it'd be great to get rid of as many unnecessary differences in the APIs as possible.

  • Use bevy Transforms

Bevy transforms allow for non-uniform (where each axis can have a different scale) scaling: https://docs.rs/bevy/latest/bevy/prelude/struct.Transform.html#structfield.scale.

Superconductor instances (we could just rename these transforms) do not:

pub struct Instance {
pub position: Vec3,
pub scale: f32,
pub rotation: glam::Quat,
}

The justification here is that non-uniform scaling creates all sorts of problems for proper shading of models, and isn't frequently used to be worth supporting. I'm happy to change my mind on this if a case where we want to do a lot of non-uniform scaling though.

We can have a system that copies bevy Transforms to superconductor instances, with the uniform scale just being scale.x.max(scale.y).max(scale.z), but I'd advise against it.

It looks like this link has been messed up with bevy 0.8. I'm sure we could integrate bevy's camera system into the code though.

  • Use bevy_render's RenderGraph so we can easily add render plugins (see bevy_pbr impl)

Looks possible, haven't looked into it yet. I think the most important question is whether we need to do anything fancy to let both superconductor and any render plugins use the wgpu device.

  • compatibility with bevy_render/bevy_pbr's primitives

Which primitives would these be? https://docs.rs/bevy/latest/bevy/render/primitives/index.html?

  • compatibility with bevy_asset's assets

The reason why I didn't do this before is that A) I already had an asset system I could use from https://github.com/expenses/mateversum and B) the asset server in bevy::asset looked a little over complicated for our needs. I also think it's beneficial for us to be able to control the assets and how they're loaded. Happy to look into this more.

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

No branches or pull requests

2 participants