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

Areas that should be dark are brightly lit instead #45

Open
aylamz opened this issue Feb 7, 2024 · 3 comments
Open

Areas that should be dark are brightly lit instead #45

aylamz opened this issue Feb 7, 2024 · 3 comments

Comments

@aylamz
Copy link

aylamz commented Feb 7, 2024

What you did

Dug a small tunnel

What went wrong

The tunnel should be dark but is brightly lit instead

Additional information

nodark

@aylamz aylamz added bug Something isn't working Needs-Triage labels Feb 7, 2024
@Adamkob12
Copy link
Owner

That's pretty much intentional 🙃

You're welcome to add a sun, and decrease the brightness of the ambient lighting tho.

I'll accept a PR!

@aylamz
Copy link
Author

aylamz commented Feb 17, 2024

So I looked into this a bit and I'm a little confused.

It seems there already is a DirectionalLightBundle with Sun component. And a day-night cycle? Except it doesn't work?

// ...
    if timer.0.finished() {
        let t: f32 = 1.0;
        atmosphere.sun_position = Vec3::new(0., t.sin(), t.cos());

        if let Some((mut light_trans, mut directional)) = query.single_mut().into() {
            light_trans.rotation = Quat::from_rotation_x(-t);
            directional.illuminance = t.sin().max(0.0).powf(2.0) * 2000.0;
        }
    }
// ...

atmosphere.sun_position, light_trans.rotation, directional.illuminance are all set based on t, but t never actually changes, so day-night system doesn't work.

Also tried removing AmbientLight and directional light, but it's still not completely dark, there's still some ambient light coming from somewhere...

@Adamkob12
Copy link
Owner

Oh yeah there used to be a sun a day-night cycle but I disabled it. I forgot about it.
The additional light probably comes from the 3rd party AtmospherePlugin from bevy_atmosphere.

@Adamkob12 Adamkob12 added Environment and removed bug Something isn't working Needs-Triage labels Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants