Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Constants

PI

#
const PI: f32 = 3.14159265358979323846

SAMPLES

#
const SAMPLES: i32 = #SHADOW_SAMPLES

Bindings

view

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

Structures

BoxShadowVertexOutput

#
struct BoxShadowVertexOutput {
@builtin(position)
position: vec4<f32>,
@location(0)
point: vec2<f32>,
@location(1)
color: vec4<f32>,
@location(2)
@interpolate(flat)
size: vec2<f32>,
@location(3)
@interpolate(flat)
radius: vec4<f32>,
@location(4)
@interpolate(flat)
blur: f32,
}

Functions

gaussian

#
fn gaussian (
x: f32,
sigma: f32
) -> f32

erf

#

Approximates the Gauss error function: https://en.wikipedia.org/wiki/Error_function

fn erf (
p: vec2<f32>
) -> vec2<f32>

selectCorner

#

returns the closest corner radius based on the signs of the components of p

fn selectCorner (
p: vec2<f32>,
c: vec4<f32>
) -> f32

horizontalRoundedBoxShadow

#
fn horizontalRoundedBoxShadow (
x: f32,
y: f32,
blur: f32,
corner: f32,
half_size: vec2<f32>
) -> f32

roundedBoxShadow

#
fn roundedBoxShadow (
lower: vec2<f32>,
upper: vec2<f32>,
point: vec2<f32>,
blur: f32,
corners: vec4<f32>
) -> f32

vertex

#
@vertex
Processes each 3D point in a model before it's drawn
fn vertex (
@location(0)
vertex_position: vec3<f32>,
@location(1)
uv: vec2<f32>,
@location(2)
vertex_color: vec4<f32>,
@location(3)
size: vec2<f32>,
@location(4)
radius: vec4<f32>,
@location(5)
blur: f32,
@location(6)
bounds: vec2<f32>
) -> BoxShadowVertexOutput

fragment

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