cleanup custom material
This commit is contained in:
34
src/main.rs
34
src/main.rs
@@ -1,7 +1,6 @@
|
||||
use bevy::core_pipeline::tonemapping::Tonemapping;
|
||||
use bevy::math::*;
|
||||
use bevy::prelude::*;
|
||||
use bevy::render::render_resource::{AsBindGroup, ShaderRef};
|
||||
use bevy_flycam::prelude::*;
|
||||
use bevy_trenchbroom::prelude::*;
|
||||
|
||||
@@ -18,23 +17,6 @@ pub struct MyBaseClass {
|
||||
pub my_value: u32,
|
||||
}
|
||||
|
||||
const SHADER_ASSET_PATH: &str = "shaders/custom_material.wgsl";
|
||||
|
||||
#[derive(Asset, Reflect, Default, AsBindGroup, Debug, Clone)]
|
||||
struct CustomMaterial {
|
||||
#[uniform(0)]
|
||||
color: LinearRgba,
|
||||
#[texture(1)]
|
||||
#[sampler(2)]
|
||||
color_texture: Option<Handle<Image>>,
|
||||
}
|
||||
|
||||
impl Material for CustomMaterial {
|
||||
fn fragment_shader() -> ShaderRef {
|
||||
SHADER_ASSET_PATH.into()
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut app = App::new();
|
||||
|
||||
@@ -44,22 +26,6 @@ fn main() {
|
||||
|
||||
// bevy_flycam setup so we can get a closer look at the scene, mainly for debugging
|
||||
app.add_plugins(PlayerPlugin);
|
||||
// app.add_plugins(
|
||||
// MaterializePlugin::new(TomlMaterialDeserializer).with_simple_loader_settings(Some(
|
||||
// SimpleGenericMaterialLoaderSettings {
|
||||
// material: |image| {
|
||||
// CustomMaterial {
|
||||
// color_texture: Some(image),
|
||||
// ..Default::default()
|
||||
// }
|
||||
// .into()
|
||||
// },
|
||||
// ..Default::default()
|
||||
// },
|
||||
// )),
|
||||
// );
|
||||
// app.add_plugins(MaterialPlugin::<CustomMaterial>::default());
|
||||
// app.register_generic_material::<CustomMaterial>();
|
||||
|
||||
app.insert_resource(MovementSettings {
|
||||
sensitivity: 0.00005,
|
||||
|
||||
Reference in New Issue
Block a user