UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

26 lines (24 loc) 548 B
var gsplatUncompressedVS = ` uint tAw; vec4 tBcached; vec4 unpackRotation(vec3 packed) { return vec4(packed.xyz, sqrt(max(0.0, 1.0 - dot(packed, packed)))); } vec3 getCenter() { uvec4 tA = loadTransformA(); tAw = tA.w; tBcached = loadTransformB(); return uintBitsToFloat(tA.xyz); } vec4 getColor() { return loadSplatColor(); } vec4 getRotation() { return unpackRotation(vec3(unpackHalf2x16(tAw), tBcached.w)).wxyz; } vec3 getScale() { return tBcached.xyz; } #include "gsplatUncompressedSHVS" `; export { gsplatUncompressedVS as default };