UNPKG

playcanvas

Version:

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

40 lines (32 loc) 809 B
var uncompressed_default = ( /* wgsl */ ` // work values var<private> tAw: u32; var<private> tBcached: vec4f; fn unpackRotation(data: vec3f) -> vec4f { return vec4f(data.xyz, sqrt(max(0.0, 1.0 - dot(data, data)))); } // read the model-space center of the gaussian fn getCenter() -> vec3f { // read transform data using generated load functions (use global splat.uv) 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 { uncompressed_default as default };