Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

ui.wgsl

Constants

TEXTURED

#
const TEXTURED: u32 = 1u

RIGHT_VERTEX

#
const RIGHT_VERTEX: u32 = 2u

BOTTOM_VERTEX

#
const BOTTOM_VERTEX: u32 = 4u

BORDER

#
const BORDER: u32 = 8u

Bindings

view

#
@group(0)
@binding(0)
var<uniform> view: View

sprite_texture

#
@group(1)
@binding(0)
var sprite_texture: texture_2d<f32>

sprite_sampler

#
@group(1)
@binding(1)
var sprite_sampler: sampler

Structures

VertexOutput

#
struct VertexOutput {
@location(0)
uv: vec2<f32> ,
@location(1)
color: vec4<f32> ,
@location(2)
@interpolate(flat)
size: vec2<f32> ,
@location(3)
@interpolate(flat)
flags: u32 ,
@location(4)
@interpolate(flat)
radius: vec4<f32> ,
@location(5)
@interpolate(flat)
border: vec4<f32> ,
@location(6)
point: vec2<f32> ,
@builtin(position)
position: vec4<f32> ,
}

Functions

enabled

#
fn enabled (
flags: u32
mask: u32
) -> bool

vertex

#
@vertex
Processes each 3D point in a model before it's drawn
fn vertex (
@location(0)
vertex_position: vec3<f32>
@location(1)
vertex_uv: vec2<f32>
@location(2)
vertex_color: vec4<f32>
@location(3)
flags: u32
@location(4)
radius: vec4<f32>
@location(5)
border: vec4<f32>
@location(6)
size: vec2<f32>
@location(7)
point: vec2<f32>
) -> VertexOutput

sd_rounded_box

#

Arguments: - point -> The function will return the distance from this point to the closest point on the boundary. - size -> The maximum width and height of the box. - corner_radii -> The radius of each rounded corner. Ordered counter clockwise starting top left: x: top left, y: top right, z: bottom right, w: bottom left.

fn sd_rounded_box (
corner_radii: vec4<f32>
) -> f32

sd_inset_rounded_box

#
fn sd_inset_rounded_box ( ) -> f32

antialias

#

get alpha for antialiasing for sdf

fn antialias (
distance: f32
) -> f32

draw

#
fn draw (
texture_color: vec4<f32>
) -> vec4<f32>

draw_background

#
fn draw_background (
texture_color: vec4<f32>
) -> vec4<f32>

fragment

#
@fragment
Calculates the final color of each pixel on the screen
fn fragment ( ) ->
@location(0)
vec4<f32>