bevy/crates/bevy_ui_render/src/ui_vertex_output.wgsl
ickshonpe b01de70bdd
bevy_ui_render crate (#18703)
# Objective

Move Bevy UI's rendering into a dedicated crate.

Motivations:
* Allow the UI renderer to be used with other UI frameworks than
`bevy_ui`.
* Allow for using alternative renderers like Vello with `bevy_ui`.
* It's difficult for rendering contributors to make changes and
improvements to the UI renderer as it requires in-depth knowledge of the
UI implementation.

## Solution

Move the `render` and `ui_material` modules from `bevy_ui` into a new
crate `bevy_ui_render`.

## Testing

Important examples to check are `testbed_ui`, `testbed_full_ui`,
`ui_material`, `viewport_node` and `gradients`.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2025-07-03 23:36:35 +00:00

14 lines
610 B
WebGPU Shading Language

#define_import_path bevy_ui::ui_vertex_output
// The Vertex output of the default vertex shader for the Ui Material pipeline.
struct UiVertexOutput {
@location(0) uv: vec2<f32>,
// The size of the borders in UV space. Order is Left, Right, Top, Bottom.
@location(1) border_widths: vec4<f32>,
// The size of the borders in pixels. Order is top left, top right, bottom right, bottom left.
@location(2) border_radius: vec4<f32>,
// The size of the node in pixels. Order is width, height.
@location(3) @interpolate(flat) size: vec2<f32>,
@builtin(position) position: vec4<f32>,
};