2020-04-25 00:46:54 +00:00
|
|
|
pub mod entity;
|
|
|
|
pub mod light;
|
|
|
|
pub mod material;
|
|
|
|
pub mod nodes;
|
|
|
|
pub mod passes;
|
|
|
|
pub mod pipelines;
|
|
|
|
|
|
|
|
mod forward_pbr_render_graph;
|
|
|
|
pub use forward_pbr_render_graph::*;
|
|
|
|
|
2020-04-25 01:55:15 +00:00
|
|
|
use bevy_app::{stage, AppBuilder, AppPlugin};
|
2020-04-25 00:46:54 +00:00
|
|
|
use bevy_asset::AssetStorage;
|
|
|
|
use bevy_render::{render_graph::RenderGraph, shader};
|
2020-05-01 08:37:20 +00:00
|
|
|
use legion::prelude::IntoSystem;
|
2020-05-01 08:50:07 +00:00
|
|
|
use material::StandardMaterial;
|
2020-04-25 00:46:54 +00:00
|
|
|
|
|
|
|
#[derive(Default)]
|
|
|
|
pub struct PbrPlugin;
|
|
|
|
|
|
|
|
// NOTE: this isn't PBR yet. consider this name "aspirational" :)
|
|
|
|
impl AppPlugin for PbrPlugin {
|
|
|
|
fn build(&self, app: &mut AppBuilder) {
|
|
|
|
app.add_resource(AssetStorage::<StandardMaterial>::new())
|
|
|
|
.add_system_to_stage(
|
|
|
|
stage::POST_UPDATE,
|
2020-05-01 08:37:20 +00:00
|
|
|
shader::asset_handle_shader_def_system::<StandardMaterial>.system(),
|
2020-04-25 00:46:54 +00:00
|
|
|
);
|
|
|
|
let resources = app.resources();
|
|
|
|
let mut render_graph = resources.get_mut::<RenderGraph>().unwrap();
|
|
|
|
render_graph.add_pbr_graph(resources);
|
|
|
|
}
|
|
|
|
}
|