From 3ca0ec7961896f35fad394ef5f19f345356d5074 Mon Sep 17 00:00:00 2001 From: extrawurst Date: Wed, 26 Feb 2025 15:54:26 +0100 Subject: [PATCH] cleanup custom material --- assets/shaders/custom_material.wgsl | 11 ------- assets/shaders/custom_material_import.wgsl | 2 -- src/main.rs | 34 ---------------------- 3 files changed, 47 deletions(-) delete mode 100644 assets/shaders/custom_material.wgsl delete mode 100644 assets/shaders/custom_material_import.wgsl diff --git a/assets/shaders/custom_material.wgsl b/assets/shaders/custom_material.wgsl deleted file mode 100644 index 4ddfc9c..0000000 --- a/assets/shaders/custom_material.wgsl +++ /dev/null @@ -1,11 +0,0 @@ -#import bevy_pbr::forward_io::VertexOutput - -@group(2) @binding(1) var material_color_texture: texture_2d; -@group(2) @binding(2) var material_color_sampler: sampler; - -@fragment -fn fragment( - mesh: VertexOutput, -) -> @location(0) vec4 { - return textureSample(material_color_texture, material_color_sampler, mesh.uv); -} diff --git a/assets/shaders/custom_material_import.wgsl b/assets/shaders/custom_material_import.wgsl deleted file mode 100644 index ac9f2eb..0000000 --- a/assets/shaders/custom_material_import.wgsl +++ /dev/null @@ -1,2 +0,0 @@ -// this is made available to the importing module -const COLOR_MULTIPLIER: vec4 = vec4(1.0, 1.0, 1.0, 0.5); diff --git a/src/main.rs b/src/main.rs index fa4795c..a88b976 100644 --- a/src/main.rs +++ b/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>, -} - -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::::default()); - // app.register_generic_material::(); app.insert_resource(MovementSettings { sensitivity: 0.00005,