-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Moving Spotlight with shadows_enabled not shining #7152
Labels
Comments
Rust-Ninja-Sabi
added
C-Bug
An unexpected or incorrect behavior
S-Needs-Triage
This issue needs to be labelled
labels
Jan 10, 2023
rparrett
added
A-Rendering
Drawing game state to the screen
and removed
S-Needs-Triage
This issue needs to be labelled
labels
Jan 10, 2023
I can reproduce this on bevy main. This seems to be related to rotation rather than any movement. If you modify the code above to remove the
Here's a more minimal reproduction: use bevy::prelude::*;
// NOT BROKEN
//const ROTATION_Y: f32 = 0.0001;
// BROKEN
const ROTATION_Y: f32 = 0.001;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_startup_system(setup_camera)
.add_startup_system(setup)
.run();
}
fn setup_camera(mut commands: Commands) {
commands.spawn(Camera3dBundle {
transform: Transform {
translation: Vec3::new(-0.05, 23.68, 14.94),
rotation: Quat::from_euler(EulerRot::XYZ, -1.0, 0.0, 0.0),
..default()
},
..Default::default()
});
}
fn setup(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
commands.spawn(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Plane { size: 12.0 })),
material: materials.add(Color::rgb(0.3, 0.5, 0.3).into()),
..default()
});
commands.spawn(SpotLightBundle {
spot_light: SpotLight {
shadows_enabled: true,
..default()
},
transform: Transform::from_xyz(0.0, 0.5, 0.0)
.with_rotation(Quat::from_rotation_y(ROTATION_Y)),
..default()
});
} |
alradish
pushed a commit
to alradish/bevy
that referenced
this issue
Jan 22, 2023
# Objective fix error with shadow shader's spotlight direction calculation when direction.y ~= 0 fixes bevyengine#7152 ## Solution same as bevyengine#6167: in shadows.wgsl, clamp 1-x^2-z^2 to >= 0 so that we can safely sqrt it
ItsDoot
pushed a commit
to ItsDoot/bevy
that referenced
this issue
Feb 1, 2023
# Objective fix error with shadow shader's spotlight direction calculation when direction.y ~= 0 fixes bevyengine#7152 ## Solution same as bevyengine#6167: in shadows.wgsl, clamp 1-x^2-z^2 to >= 0 so that we can safely sqrt it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bevy version
0.9.1
What you did
I need a moving Spotlight.
What went wrong
If shadows_enabled == false, it works. I see the light moving.
else, no light
Example:
The text was updated successfully, but these errors were encountered: