-
Notifications
You must be signed in to change notification settings - Fork 38
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
Upgraded to bevy 0.14 #61
Changes from 1 commit
5d3abd1
ffe445a
70d8245
dc13ff1
ccdcfef
672fb0e
69a8e2e
a29ff6e
0cd950a
7ecc6ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ pub fn system_extract_pipeline_assets( | |
res_light_settings: Extract<Res<BevyMagicLight2DSettings>>, | ||
res_target_sizes: Extract<Res<ComputedTargetSizes>>, | ||
|
||
query_lights: Extract<Query<(&GlobalTransform, &OmniLightSource2D, &InheritedVisibility, &ViewVisibility)>>, | ||
query_lights: Extract<Query<(&GlobalTransform, &OmniLightSource2D, &InheritedVisibility)>>, | ||
query_occluders: Extract<Query<(&LightOccluder2D, &GlobalTransform, &Transform, &InheritedVisibility, &ViewVisibility)>>, | ||
query_camera: Extract<Query<(&Camera, &GlobalTransform), With<FloorCamera>>>, | ||
query_masks: Extract<Query<(&GlobalTransform, &SkylightMask2D)>>, | ||
|
@@ -108,8 +108,8 @@ pub fn system_extract_pipeline_assets( | |
let mut rng = thread_rng(); | ||
light_sources.count = 0; | ||
light_sources.data.clear(); | ||
for (transform, light_source, hviz, vviz) in query_lights.iter() { | ||
if hviz.get() && vviz.get() { | ||
for (transform, light_source, hviz) in query_lights.iter() { | ||
if hviz.get() { | ||
light_sources.count += 1; | ||
light_sources.data.push(GpuOmniLightSource::new( | ||
OmniLightSource2D { | ||
|
@@ -160,7 +160,7 @@ pub fn system_extract_pipeline_assets( | |
{ | ||
if let Ok((camera, camera_global_transform)) = query_camera.get_single() { | ||
let camera_params = gpu_pipeline_assets.camera_params.get_mut(); | ||
let projection = camera.projection_matrix(); | ||
let projection = camera.clip_from_view(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same method, different name |
||
let inverse_projection = projection.inverse(); | ||
let view = camera_global_transform.compute_matrix(); | ||
let inverse_view = view.inverse(); | ||
|
@@ -209,9 +209,10 @@ pub fn system_extract_pipeline_assets( | |
let light_pass_params = gpu_pipeline_assets.light_pass_params.get_mut(); | ||
light_pass_params.skylight_color = Vec3::splat(0.0); | ||
for new_gi_state in query_skylight_light.iter() { | ||
light_pass_params.skylight_color.x += new_gi_state.color.r() * new_gi_state.intensity; | ||
light_pass_params.skylight_color.y += new_gi_state.color.g() * new_gi_state.intensity; | ||
light_pass_params.skylight_color.z += new_gi_state.color.b() * new_gi_state.intensity; | ||
let srgba = new_gi_state.color.to_srgba(); | ||
light_pass_params.skylight_color.x += srgba.red * new_gi_state.intensity; | ||
light_pass_params.skylight_color.y += srgba.green * new_gi_state.intensity; | ||
light_pass_params.skylight_color.z += srgba.blue * new_gi_state.intensity; | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
pub const CAMERA_LAYER_FLOOR: &[u8] = &[1]; | ||
pub const CAMERA_LAYER_WALLS: &[u8] = &[2]; | ||
pub const CAMERA_LAYER_OBJECTS: &[u8] = &[3]; | ||
use bevy::render::view::Layer; | ||
|
||
pub const LAYER_FLOOR_ID: Layer = 1; | ||
pub const LAYER_WALLS_ID: Layer = 2; | ||
pub const LAYER_OBJECTS_ID: Layer = 3; | ||
|
||
pub const CAMERA_LAYER_FLOOR: &[Layer] = &[LAYER_FLOOR_ID]; | ||
pub const CAMERA_LAYER_WALLS: &[Layer] = &[LAYER_WALLS_ID]; | ||
pub const CAMERA_LAYER_OBJECTS: &[Layer] = &[LAYER_OBJECTS_ID]; | ||
|
||
pub const ALL_LAYERS: &[Layer] = &[ | ||
LAYER_FLOOR_ID, | ||
LAYER_WALLS_ID, | ||
LAYER_OBJECTS_ID, | ||
]; | ||
|
||
pub const LAYER_POST_PROCESSING_ID: Layer = 42; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The number of layers is unlimited now. I chose '42' just as some arbitrary large number |
||
pub const CAMERA_LAYER_POST_PROCESSING: &[Layer] = &[LAYER_POST_PROCESSING_ID]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rgb_u8 is deprecated in bevy 0.14 now