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.

Functions

sample_final_color

#

Samples the sprite’s final color, including the tint and alpha discard, at a given UV.

fn sample_final_color (
uv: vec2<f32>
, 
instance_index: u32
) -> vec4<f32>

sample_sprite_texture

#

Samples the sprite’s texture without tint and alpha discard at a given UV.

fn sample_sprite_texture (
uv: vec2<f32>
, 
instance_index: u32
) -> vec4<f32>

get_final_color

#

Applies tint and alpha discard to the sprite’s color.

fn get_final_color (
sprite_color: vec4<f32>
, 
instance_index: u32
) -> vec4<f32>

get_final_uv

#

Applies all the necessary transformations to get the final UV that the texture should be sampled from.

fn get_final_uv (
uv: vec2<f32>
, 
instance_index: u32
) -> vec2<f32>

apply_flip

#

Flips the UV based on the sprite’s flip X and Y properties.

fn apply_flip (
uv: vec2<f32>
, 
instance_index: u32
) -> vec2<f32>

apply_tiling

#

Applies tiling to the UV based on the sprite’s tiling properties when image_mode is Tiled.

fn apply_tiling (
uv: vec2<f32>
, 
instance_index: u32
) -> vec2<f32>

apply_uv_transform

#

Applies the sprite’s UV transform, which is used for sampling the correct region from a texture atlas and scaling the sprite when image_mode is Scaled.

fn apply_uv_transform (
uv: vec2<f32>
, 
instance_index: u32
) -> vec2<f32>

apply_slicing

#

Applies UV slicing based on the sprite’s slicing properties when image_mode is Sliced.

fn apply_slicing (
uv: vec2<f32>
, 
instance_index: u32
) -> vec2<f32>

apply_tint

#

Applies the tint from the sprite’s color property.

fn apply_tint (
sprite_color: vec4<f32>
, 
instance_index: u32
) -> vec4<f32>

alpha_discard

#

Discards fragments based on the sprite’s alpha_cutoff and alpha_mode.

fn alpha_discard (
output_color: vec4<f32>
, 
instance_index: u32
) -> vec4<f32>

tile_or_stretch

#

Maps a point p from [a, b] to [c, d], tiling it if stretch_value is not 0.

fn tile_or_stretch (
p: f32
, 
a: f32
, 
b: f32
, 
c: f32
, 
d: f32
, 
stretch_value: f32
) -> f32

tile_interval

#

Takes a point p from an interval [a, b] and maps it to a portion of the tile [c, d]

fn tile_interval (
p: f32
, 
a: f32
, 
b: f32
, 
c: f32
, 
d: f32
, 
stretch_value: f32
) -> f32

stretch_interval

#

Takes a point p from an interval [a, b] and translates it to the interval [c, d]

fn stretch_interval (
p: f32
, 
a: f32
, 
b: f32
, 
c: f32
, 
d: f32
) -> f32
Contents