Variable ID_SHADER_SOURCEConst
ID_SHADER_SOURCE: "struct IdUniforms {\n viewProjection : mat4x4<f32>,\n model : mat4x4<f32>,\n pickId : vec4<f32>,\n};\n\n@group(0) @binding(0) var<uniform> id : IdUniforms;\n\n@vertex\nfn vertexMain(@location(0) position : vec3<f32>) -> @builtin(position) vec4<f32> {\n let clip = id.viewProjection * id.model * vec4<f32>(position, 1.0);\n // WebGL clip depth [-w, w] onto WebGPU's [0, w]; see wgpu-unlit.ts.\n return vec4<f32>(clip.x, clip.y, (clip.z + clip.w) * 0.5, clip.w);\n}\n\n@fragment\nfn fragmentMain() -> @location(0) vec4<f32> {\n return id.pickId;\n}\n"
The id pass's WGSL — unlit
gl_Position(with this backend's clip-depth remap) and a flatpickIdfragment. One module, compiled lazily.