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.

prepass_io.wgsl

Import path

Structures

Vertex

#

Most of these attributes are not used in the default prepass fragment shader, but they are still needed so we can pass them to custom prepass shaders like pbr_prepass.wgsl.

struct Vertex {
@builtin(instance_index)
instance_index: u32 ,
@location(0)
position: vec3<f32> ,
@location(1)
uv: vec2<f32> , 🟢 VERTEX_UVS_A
@location(2)
uv_b: vec2<f32> , 🟢 VERTEX_UVS_B
@location(3)
normal: vec3<f32> , 🟢 NORMAL_PREPASS_OR_DEFERRED_PREPASS, 🟢 VERTEX_NORMALS
@location(4)
tangent: vec4<f32> , 🟢 NORMAL_PREPASS_OR_DEFERRED_PREPASS, 🟢 VERTEX_TANGENTS
@location(5)
joint_indices: vec4<u32> , 🟢 SKINNED
@location(6)
joint_weights: vec4<f32> , 🟢 SKINNED
@location(7)
color: vec4<f32> , 🟢 VERTEX_COLORS
@builtin(vertex_index)
index: u32 , 🟢 MORPH_TARGETS
}

VertexOutput

#
struct VertexOutput {
@builtin(position)
position: vec4<f32> ,
@location(0)
uv: vec2<f32> , 🟢 VERTEX_UVS_A
@location(1)
uv_b: vec2<f32> , 🟢 VERTEX_UVS_B
@location(2)
world_normal: vec3<f32> , 🟢 NORMAL_PREPASS_OR_DEFERRED_PREPASS
@location(3)
world_tangent: vec4<f32> , 🟢 NORMAL_PREPASS_OR_DEFERRED_PREPASS, 🟢 VERTEX_TANGENTS
@location(4)
world_position: vec4<f32> ,
@location(5)
previous_world_position: vec4<f32> , 🟢 MOTION_VECTOR_PREPASS
@location(6)
unclipped_depth: f32 , 🟢 UNCLIPPED_DEPTH_ORTHO_EMULATION
@location(7)
instance_index: u32 ,
@location(8)
color: vec4<f32> , 🟢 VERTEX_COLORS
@location(9)
@interpolate(flat)
visibility_range_dither: i32 , 🟢 VISIBILITY_RANGE_DITHER
}

FragmentOutput

#
struct FragmentOutput {
@location(0)
normal: vec4<f32> , 🟢 NORMAL_PREPASS_OR_DEFERRED_PREPASS, 🟢 VERTEX_NORMALS
@location(1)
motion_vector: vec2<f32> , 🟢 PREPASS_FRAGMENT, 🟢 MOTION_VECTOR_PREPASS
@location(2)
deferred: vec4<u32> , 🟢 PREPASS_FRAGMENT, 🟢 DEFERRED_PREPASS
@location(3)
deferred_lighting_pass_id: u32 , 🟢 PREPASS_FRAGMENT, 🟢 DEFERRED_PREPASS
@builtin(frag_depth)
frag_depth: f32 , 🟢 PREPASS_FRAGMENT, 🟢 UNCLIPPED_DEPTH_ORTHO_EMULATION
}