Back home 🏡 WGSL Spec Bevy WGSL Functions

ui_texture_slice.wgsl

Bindings

Name Group Binding index Binding type Type
view # 0 0 <uniform> View
globals # 0 1 <uniform> Globals
sprite_texture # 1 0 texture_2d<f32>
sprite_sampler # 1 1 sampler

Structures

UiVertexOutput

#
Annotation Name Type
location(0) uv vec2<f32>
location(1) color vec4<f32>
builtin(position) position vec4<f32>

Functions

vertex

#
@vertex
fn vertex(vertex_position: vec3<f32>, vertex_uv: vec2<f32>, vertex_color: vec4<f32>, texture_slices: vec4<f32>, target_slices: vec4<f32>, repeat: vec4<f32>, atlas_rect: vec4<f32>) -> UiVertexOutput
Parameter Type
vertex_position vec3<f32>
vertex_uv vec2<f32>
vertex_color vec4<f32>
texture_slices vec4<f32>
target_slices vec4<f32>
repeat vec4<f32>
atlas_rect vec4<f32>
Returns: UiVertexOutput

map_axis_with_repeat

#
maps a point along the axis of the render target to slice coordinates
fn map_axis_with_repeat() -> f32
Returns: f32

map_uvs_to_slice

#
fn map_uvs_to_slice(uv: vec2<f32>, target_slices: vec4<f32>, texture_slices: vec4<f32>, repeat: vec4<f32>) -> vec2<f32>
Parameter Type
uv vec2<f32>
target_slices vec4<f32>
texture_slices vec4<f32>
repeat vec4<f32>
Returns: vec2<f32>

fragment

#
@fragment
fn fragment(in: UiVertexOutput) -> @location(0) vec4<f32>
Parameter Type
in UiVertexOutput
Returns: @location(0) vec4<f32>