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.

Structures

ColorGrading

#
struct ColorGrading {
balance: mat3x3<f32>,
saturation: vec3<f32>,
contrast: vec3<f32>,
gamma: vec3<f32>,
gain: vec3<f32>,
lift: vec3<f32>,
midtone_range: vec2<f32>,
exposure: f32,
hue: f32,
post_saturation: f32,
}

View

#
struct View {
clip_from_world: mat4x4<f32>,
unjittered_clip_from_world: mat4x4<f32>,
world_from_clip: mat4x4<f32>,
world_from_view: mat4x4<f32>,
view_from_world: mat4x4<f32>,
clip_from_view: mat4x4<f32>,
view_from_clip: mat4x4<f32>,
world_position: vec3<f32>,
exposure: f32,
viewport: vec4<f32>,
main_pass_viewport: vec4<f32>,
frustum: array<vec4<f32>, 6>,
color_grading: ColorGrading,
mip_bias: f32,
frame_count: u32,
}

Functions

position_view_to_world

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a view space position to world space

fn position_view_to_world (
view_pos: vec3<f32>,
world_from_view: mat4x4<f32>
) -> vec3<f32>

position_clip_to_world

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a clip space position to world space

fn position_clip_to_world (
clip_pos: vec4<f32>,
world_from_clip: mat4x4<f32>
) -> vec3<f32>

position_ndc_to_world

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a ndc space position to world space

fn position_ndc_to_world (
ndc_pos: vec3<f32>,
world_from_clip: mat4x4<f32>
) -> vec3<f32>

direction_view_to_world

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a view space direction to world space

fn direction_view_to_world (
view_dir: vec3<f32>,
world_from_view: mat4x4<f32>
) -> vec3<f32>

direction_clip_to_world

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a clip space direction to world space

fn direction_clip_to_world (
clip_dir: vec4<f32>,
world_from_clip: mat4x4<f32>
) -> vec3<f32>

position_world_to_view

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a world space position to view space

fn position_world_to_view (
world_pos: vec3<f32>,
view_from_world: mat4x4<f32>
) -> vec3<f32>

position_clip_to_view

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a clip space position to view space

fn position_clip_to_view (
clip_pos: vec4<f32>,
view_from_clip: mat4x4<f32>
) -> vec3<f32>

position_ndc_to_view

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a ndc space position to view space

fn position_ndc_to_view (
ndc_pos: vec3<f32>,
view_from_clip: mat4x4<f32>
) -> vec3<f32>

direction_world_to_view

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a world space direction to view space

fn direction_world_to_view (
world_dir: vec3<f32>,
view_from_world: mat4x4<f32>
) -> vec3<f32>

direction_clip_to_view

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a clip space direction to view space

fn direction_clip_to_view (
clip_dir: vec4<f32>,
view_from_clip: mat4x4<f32>
) -> vec3<f32>

position_world_to_clip

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a world space position to clip space

fn position_world_to_clip (
world_pos: vec3<f32>,
clip_from_world: mat4x4<f32>
) -> vec4<f32>

position_view_to_clip

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a view space position to clip space

fn position_view_to_clip (
view_pos: vec3<f32>,
clip_from_view: mat4x4<f32>
) -> vec4<f32>

direction_world_to_clip

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a world space direction to clip space

fn direction_world_to_clip (
world_dir: vec3<f32>,
clip_from_world: mat4x4<f32>
) -> vec4<f32>

direction_view_to_clip

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a view space direction to clip space

fn direction_view_to_clip (
view_dir: vec3<f32>,
clip_from_view: mat4x4<f32>
) -> vec4<f32>

position_world_to_ndc

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a world space position to ndc space

fn position_world_to_ndc (
world_pos: vec3<f32>,
clip_from_world: mat4x4<f32>
) -> vec3<f32>

position_view_to_ndc

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert a view space position to ndc space

fn position_view_to_ndc (
view_pos: vec3<f32>,
clip_from_view: mat4x4<f32>
) -> vec3<f32>

perspective_camera_near

#
Used by 1 shader in bevy_sprite_render 0.17.3

Retrieve the perspective camera near clipping plane

fn perspective_camera_near (
clip_from_view: mat4x4<f32>
) -> f32

depth_ndc_to_view_z

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert ndc depth to linear view z. Note: Depth values in front of the camera will be negative as -z is forward

fn depth_ndc_to_view_z (
ndc_depth: f32,
clip_from_view: mat4x4<f32>,
view_from_clip: mat4x4<f32>
) -> f32

view_z_to_depth_ndc

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert linear view z to ndc depth. Note: View z input should be negative for values in front of the camera as -z is forward

fn view_z_to_depth_ndc (
view_z: f32,
clip_from_view: mat4x4<f32>
) -> f32

ndc_to_uv

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert ndc space xy coordinate [-1.0 .. 1.0] to uv [0.0 .. 1.0]

fn ndc_to_uv (
ndc: vec2<f32>
) -> vec2<f32>

uv_to_ndc

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert uv [0.0 .. 1.0] coordinate to ndc space xy [-1.0 .. 1.0]

fn uv_to_ndc (
uv: vec2<f32>
) -> vec2<f32>

frag_coord_to_uv

#
Used by 1 shader in bevy_sprite_render 0.17.3

returns the (0.0, 0.0) .. (1.0, 1.0) position within the viewport for the current render target [0 .. render target viewport size] eg. [(0.0, 0.0) .. (1280.0, 720.0)] to [(0.0, 0.0) .. (1.0, 1.0)]

fn frag_coord_to_uv (
frag_coord: vec2<f32>,
viewport: vec4<f32>
) -> vec2<f32>

frag_coord_to_ndc

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert frag coord to ndc

fn frag_coord_to_ndc (
frag_coord: vec4<f32>,
viewport: vec4<f32>
) -> vec3<f32>

ndc_to_frag_coord

#
Used by 1 shader in bevy_sprite_render 0.17.3

Convert ndc space xy coordinate [-1.0 .. 1.0] to [0 .. render target viewport size]

fn ndc_to_frag_coord (
ndc: vec2<f32>,
viewport: vec4<f32>
) -> vec2<f32>
Contents