#Setting up Fragment Shader for Custom Material

2 messages · Page 1 of 1 (latest)

ocean pumice
#
struct VertexOutput {
    @builtin(position) clip_position: vec4<f32>,
    @location(0) world_position: vec4<f32>,
    @location(1) world_normal: vec3<f32>,
    @location(2) uv: vec2<f32>,
};

struct CustomMaterial {
    color: vec4<f32>,
}

@group(1) @binding(0) var<uniform> material: CustomMaterial;
@group(1) @binding(1) var color_texture: texture_2d<f32>;
@group(1) @binding(2) var color_sampler: sampler;

@fragment
fn fragment(input: VertexOutput) -> @location(0) vec4<f32> {
    var output_color = vec4<f32>(1.0, 1.0, 1.0, 1.0);
    return output_color;
}

My s1.wgsl file

#
Resource requested by bevy_tower_defense::material_testing1::setup does not exist: bevy_asset::assets::Assets<bevy_tower_defense::material_testing1::CustomMaterial>
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_tower_defense::material_testing1::setup`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!