bevy/crates/bevy_ui/src/render/ui_material.wgsl

24 lines
578 B
WebGPU Shading Language
Raw Normal View History

#import bevy_render::view::View
#import bevy_ui::ui_vertex_output::UiVertexOutput
@group(0) @binding(0)
var<uniform> view: View;
@vertex
fn vertex(
@location(0) vertex_position: vec3<f32>,
@location(1) vertex_uv: vec2<f32>,
@location(2) border_widths: vec4<f32>,
) -> UiVertexOutput {
var out: UiVertexOutput;
out.uv = vertex_uv;
out.position = view.view_proj * vec4<f32>(vertex_position, 1.0);
out.border_widths = border_widths;
return out;
}
@fragment
fn fragment(in: UiVertexOutput) -> @location(0) vec4<f32> {
return vec4<f32>(1.0);
}