UNPKG

@playcanvas/splat-transform

Version:

Library and CLI tool for 3D Gaussian splat format conversion and transformation

12 lines (11 loc) 623 B
/** * Pinhole near-plane cull + perspective screen mapping. * * Reads: cx, cy, cz, uniforms.near, uniforms.focalX, uniforms.focalY, * uniforms.imageWidth, uniforms.imageHeight * Defines: invZ, screenX, screenY * * Splats with cz <= near are written invalid and the shader returns. */ declare const projectionPinhole = "\n if (cz <= uniforms.near) { writeInvalid(i); return; }\n\n let invZ = 1.0 / cz;\n let screenX = uniforms.focalX * cx * invZ + f32(uniforms.imageWidth) * 0.5;\n let screenY = uniforms.focalY * cy * invZ + f32(uniforms.imageHeight) * 0.5;\n"; export { projectionPinhole };