UNPKG

playcanvas

Version:

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

26 lines (24 loc) 624 B
var gsplatUncompressedVS = ` var<private> tAw: u32; var<private> tBcached: vec4f; fn unpackRotation(packed: vec3f) -> vec4f { return vec4f(packed.xyz, sqrt(max(0.0, 1.0 - dot(packed, packed)))); } fn getCenter() -> vec3f { let tA: vec4<u32> = loadTransformA(); tAw = tA.w; tBcached = loadTransformB(); return bitcast<vec3f>(tA.xyz); } fn getColor() -> vec4f { return loadSplatColor(); } fn getRotation() -> vec4f { return unpackRotation(vec3f(unpack2x16float(tAw), tBcached.w)).wxyz; } fn getScale() -> vec3f { return tBcached.xyz; } #include "gsplatUncompressedSHVS" `; export { gsplatUncompressedVS as default };