@babylonjs/viewer
Version:
The Babylon Viewer aims to simplify a specific but common Babylon.js use case: loading, viewing, and interacting with a 3D model.
3 lines (2 loc) • 1.89 kB
JavaScript
const e="\nfn readMatrixFromRawSampler(smp: texture_2d<f32>, index: f32) -> mat4x4<f32> {\nlet offset = i32(index) * 4;\nlet m0 = textureLoad(smp, vec2<i32>(offset + 0, 0), 0);\nlet m1 = textureLoad(smp, vec2<i32>(offset + 1, 0), 0);\nlet m2 = textureLoad(smp, vec2<i32>(offset + 2, 0), 0);\nlet m3 = textureLoad(smp, vec2<i32>(offset + 3, 0), 0);\nreturn mat4x4f(m0, m1, m2, m3);\n}\n";function t(e,t="mesh.world"){let n="var influence: mat4x4<f32> = readMatrixFromRawSampler(boneSampler, f32(joints[0])) * weights[0];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints[1])) * weights[1];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints[2])) * weights[2];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints[3])) * weights[3];";return e&&(n+="\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints1[0])) * weights1[0];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints1[1])) * weights1[1];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints1[2])) * weights1[2];\ninfluence = influence + readMatrixFromRawSampler(boneSampler, f32(joints1[3])) * weights1[3];"),`${n}\nfinalWorld = ${t} * influence;`}function n(n){return{_id:"skeleton",_vertexAttributes:[{_name:"joints",_type:"vec4<u32>",_gpuFormat:"uint32x4",_arrayStride:16},{_name:"weights",_type:"vec4<f32>",_gpuFormat:"float32x4",_arrayStride:16},...n?[{_name:"joints1",_type:"vec4<u32>",_gpuFormat:"uint32x4",_arrayStride:16},{_name:"weights1",_type:"vec4<f32>",_gpuFormat:"float32x4",_arrayStride:16}]:[]],_vertexBindings:[{_name:"boneSampler",_type:{_kind:"texture",_textureType:"texture_2d<f32>",_sampleType:"unfilterable-float"},_visibility:1}],_vertexHelperFunctions:e,_vertexSlots:{VW:t(n)}}}export{e as S,n as c,t as m};
//# sourceMappingURL=skeleton-fragment-PDCP12cv.esm.min.js.map