/** * Skinned PBR vertex shader. * Reads bone matrices from a storage buffer (group 3) and applies GPU skinning. * Outputs the same VertexOutput as the regular PBR shader, so the FRAGMENT_SHADER is reused. */ export declare const SKINNED_VERTEX_SHADER = "\nstruct ObjectUniforms {\n mvp: mat4x4,\n model: mat4x4,\n normalMatrix: mat4x4,\n};\n\n@group(0) @binding(0) var object: ObjectUniforms;\n@group(3) @binding(0) var boneMatrices: array>;\n\nstruct VertexInput {\n @location(0) position: vec3,\n @location(1) normal: vec3,\n @location(2) uv: vec2,\n @location(3) joints: vec4,\n @location(4) weights: vec4,\n};\n\nstruct VertexOutput {\n @builtin(position) clipPosition: vec4,\n @location(0) worldPosition: vec3,\n @location(1) worldNormal: vec3,\n @location(2) uv: vec2,\n};\n\n@vertex\nfn main(input: VertexInput) -> VertexOutput {\n // Compute skin matrix from bone weights\n let skin = boneMatrices[input.joints.x] * input.weights.x\n + boneMatrices[input.joints.y] * input.weights.y\n + boneMatrices[input.joints.z] * input.weights.z\n + boneMatrices[input.joints.w] * input.weights.w;\n\n let skinnedPos = skin * vec4(input.position, 1.0);\n let skinnedNormal = (skin * vec4(input.normal, 0.0)).xyz;\n\n let worldPos = object.model * skinnedPos;\n\n var output: VertexOutput;\n output.clipPosition = object.mvp * skinnedPos;\n output.worldPosition = worldPos.xyz;\n output.worldNormal = (object.normalMatrix * vec4(skinnedNormal, 0.0)).xyz;\n output.uv = input.uv;\n return output;\n}\n"; //# sourceMappingURL=skinned-shader.d.ts.map