1import bevy_sprite_render::mesh2d::vertex_output::VertexOutput;3/// Pipeline-overridable constant: number of discrete color steps.4/// This value is substituted at pipeline compilation time by Bevy's pipeline cache5/// when the material's `specialize` method pushes it into `descriptor.constants`.6override LEVELS: f32 = 4.0;8@fragment9fn fragment(in: VertexOutput) -> @location(0) vec4<f32> {10 // Quantize UV.x to LEVELS discrete steps, then derive color from it.11 // This ensures exactly LEVELS distinct colors appear across the gradient.12 let t = floor(in.uv.x * LEVELS) / LEVELS;13 return vec4(t, t * 0.4, 1.0 - t, 1.0);14}