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

Make shadows thrown by DebugGrids configurable #4

Closed
TheBiochemic opened this issue Jan 9, 2024 · 3 comments
Closed

Make shadows thrown by DebugGrids configurable #4

TheBiochemic opened this issue Jan 9, 2024 · 3 comments
Assignees

Comments

@TheBiochemic
Copy link

Hello there, thanks again for solving the issue with the RenderLayers a while ago!

I found another interesting quirk,
i was trying to essentially get rid of the shadows, that the grid is casting on stuff, so i figured that adding NotShadowCaster is sufficient. The code looked essentially like this

commands.spawn((
    Grid {
        spacing: 1.0_f32,
        count: 20,
        color: Color::SILVER.with_a(0.75),
        alpha_mode: AlphaMode::Add,
    },
    GridAxis {
        x: Some(Color::RED),
        y: Some(Color::GREEN),
        z: Some(Color::BLUE)
    },
    SubGrid {
        count: 23,
        color: Color::Rgba{red: 0.2, green: 0.2, blue: 0.2, alpha: 0.2},
    },
    TransformBundle::default(),
    VisibilityBundle::default(),
    render_layer,
    NotShadowCaster,
));

However, the shadows still show up (even from other layers in 1.12, but that is a known bug, that will be fixed in the next release with bevyengine/bevy#10742).

I built a grid, that corresponds to one pixel size of my textures used, and because the lightsource is at a 45 degree angle, it creates this interesting, but undesired pattern, as seen on the screenshot
image

Is there a workaround for disabling shadows on the debug grid, or do you have a suggestion on how to approach this?
Thanks in advance :)

@romenjelly
Copy link
Owner

Oh wow, sorry for being two weeks late.
This likely seems to be the same issue as with RenderLayers, where NotShadowCaster needs to be manually propagated to the spawned children.

I'll try to come up with a general fix in a short while, as adding more Option<T> to the query is steadily becoming unmanageable.
Again, sorry for the wait, and thank you for finding this bug!

@romenjelly romenjelly self-assigned this Jan 25, 2024
@TheBiochemic
Copy link
Author

I'll try to come up with a general fix in a short while, as adding more Option<T> to the query is steadily becoming unmanageable.

Don't worry about it, for now i have temporarily disabled the fine grid :)
But it would be cool to have it available again.
And yeah i guess the issue is related to the RenderLayers Problem.

I would also say it's probably a good idea to have something in Place, that does propagate Components dynamically in some way. It also would have the advantage of being more future proof, since you don't need to deal with potential new Components, that might be added in bevy down the line, maybe build some kind of filter, that iterates through all components of an entity and filters out the ones, that don't need to be put into the children, just a random idea ^^

@romenjelly
Copy link
Owner

Bug has been fixed as of version 0.4.1 7abf315.
Thanks again for bringing it up!

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