audioshader/assets/shaders/default.wgsl

14 lines
420 B
WebGPU Shading Language
Raw Normal View History

2025-08-31 10:48:46 +00:00
#import bevy_sprite::mesh2d_vertex_output::VertexOutput
2025-08-31 09:39:39 +00:00
2025-08-31 10:48:46 +00:00
@group(2) @binding(0) var<uniform> u_time: f32;
@group(2) @binding(1) var<uniform> u_resolution: vec2<f32>;
2025-08-31 09:39:39 +00:00
@fragment
2025-08-31 10:48:46 +00:00
fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
2025-08-31 09:39:39 +00:00
let bottom = vec3<f32>(1.0, 0.8, 0.2); // warm
let top = vec3<f32>(0.2, 0.6, 1.0); // cool
2025-08-31 11:39:22 +00:00
let color = mix(bottom, top, mesh.uv.y);
2025-08-31 09:39:39 +00:00
return vec4<f32>(color, 1.0);
}