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.

wireframe.wgsl

Bindings

vertex_data

#

Shader defs requirments:

🟢 WIREFRAME_WIDE

@group(3)
@binding(0)
var<storage, read> vertex_data: array<u32>

index_data

#

Shader defs requirments:

🟢 WIREFRAME_WIDE

@group(3)
@binding(1)
var<storage, read> index_data: array<u32>

vp_params

#

Shader defs requirments:

🟢 WIREFRAME_WIDE

@group(3)
@binding(2)
var<uniform> vp_params: VertexPullParams

Structures

Immediates

#
struct Immediates {
color: vec4<f32> , 🟢 WIREFRAME_WIDE
line_width: f32 , 🟢 WIREFRAME_WIDE
smoothing: f32 , 🟢 WIREFRAME_WIDE
_pad0: f32 , 🟢 WIREFRAME_WIDE, 🟢 SIXTEEN_BYTE_ALIGNMENT
_pad1: f32 , 🟢 WIREFRAME_WIDE, 🟢 SIXTEEN_BYTE_ALIGNMENT
}

VertexPullParams

#
struct VertexPullParams {
index_offset: u32 , 🟢 WIREFRAME_WIDE
vertex_stride: u32 , 🟢 WIREFRAME_WIDE
position_offset: u32 , 🟢 WIREFRAME_WIDE
}

WireframeVertexOutput

#
struct WireframeVertexOutput {
@builtin(position)
position: vec4<f32> , 🟢 WIREFRAME_WIDE
@location(0)
@interpolate(linear)
edge_distance: vec4<f32> , 🟢 WIREFRAME_WIDE
}

Immediates

#
struct Immediates {
color: vec4<f32> , šŸ”“ WIREFRAME_WIDE
}

Functions

point_line_distance

#

Shader defs requirments:

🟢 WIREFRAME_WIDE

unsigned perpendicular distance from point p to the infinite line through a and b.

fn point_line_distance ( ) -> f32

read_local_position

#

Shader defs requirments:

🟢 WIREFRAME_WIDE

finds the local-space vertex position for a given vertex index by reading from the vertex buffer using the provided parameters. the vertex buffer is interpreted as an array of u32s, so the parameters allow us to calculate the correct offset for the position attribute of the vertex at the given index.

fn read_local_position (
first_vertex: u32
vertex_index: u32
) -> vec3<f32>

vertex

#
@vertex
Processes each 3D point in a model before it's drawn

Shader defs requirments:

🟢 WIREFRAME_WIDE

fn vertex (
@builtin(vertex_index)
vertex_index: u32
@builtin(instance_index)
instance_index: u32
) -> WireframeVertexOutput

fragment

#
@fragment
Calculates the final color of each pixel on the screen

Shader defs requirments:

🟢 WIREFRAME_WIDE

fn fragment ( ) ->
@location(0)
vec4<f32>

fragment

#
@fragment
Calculates the final color of each pixel on the screen

Shader defs requirments:

šŸ”“ WIREFRAME_WIDE

fn fragment ( ) ->
@location(0)
vec4<f32>