playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
3 lines (2 loc) • 1.27 kB
TypeScript
declare const _default: "\n// Modify splat center position\nfn modifySplatCenter(center: ptr<function, vec3f>) {\n // Example: *center.y += 1.0; // offset all splats up by 1 unit\n}\n\n// Modify splat rotation and scale (more efficient than modifyCovariance)\n// Parameters:\n// originalCenter - center before any modification\n// modifiedCenter - center after modifyCenter/modifySplatCenter\n// rotation - quaternion (x,y,z,w) format\n// scale - scale vector\nfn modifySplatRotationScale(originalCenter: vec3f, modifiedCenter: vec3f, rotation: ptr<function, vec4f>, scale: ptr<function, vec3f>) {\n // Example to scale all splats by 2x:\n // *scale *= 2.0;\n //\n // Example to clamp size to a range:\n // let size = gsplatGetSizeFromScale(*scale);\n // let newSize = clamp(size, 0.01, 0.5);\n // *scale *= newSize / size;\n //\n // Example to make splats spherical:\n // let size = gsplatGetSizeFromScale(*scale);\n // gsplatMakeSpherical(scale, size * 0.5);\n //\n // To hide a splat:\n // *scale = vec3f(0.0);\n}\n\n// Modify splat color\nfn modifySplatColor(center: vec3f, color: ptr<function, vec4f>) {\n // Example: *color.rgb *= 0.5; // darken all splats\n}\n";
export default _default;