playcanvas
Version:
Open-source WebGL/WebGPU 3D engine for the web
3 lines (2 loc) • 808 B
TypeScript
declare const _default: "\n\n// work values\nvar<private> tAw: u32;\nvar<private> tBcached: vec4f;\n\nfn unpackRotation(packed: vec3f) -> vec4f {\n return vec4f(packed.xyz, sqrt(max(0.0, 1.0 - dot(packed, packed))));\n}\n\n// read the model-space center of the gaussian\nfn getCenter() -> vec3f {\n // read transform data using generated load functions (use global splat.uv)\n let tA: vec4<u32> = loadTransformA();\n tAw = tA.w;\n tBcached = loadTransformB();\n return bitcast<vec3f>(tA.xyz);\n}\n\nfn getColor() -> vec4f {\n return loadSplatColor();\n}\n\nfn getRotation() -> vec4f {\n return unpackRotation(vec3f(unpack2x16float(tAw), tBcached.w)).wxyz;\n}\n\nfn getScale() -> vec3f {\n return tBcached.xyz;\n}\n\n#include \"gsplatUncompressedSHVS\"\n";
export default _default;