playcanvas
Version:
PlayCanvas WebGL game engine
3 lines (2 loc) • 686 B
TypeScript
declare const _default: "\nuniform highp sampler2D packedShN;\n\nuniform float shN_mins;\nuniform float shN_maxs;\n\nvoid readSHData(in SplatSource source, out vec3 sh[SH_COEFFS], out float scale) {\n // extract spherical harmonics palette index\n ivec2 t = ivec2(packedSample.xy & 255u);\n int n = t.x + t.y * 256;\n int u = (n % 64) * SH_COEFFS;\n int v = n / 64;\n\n // calculate offset into the centroids texture and read consecutive texels\n for (int i = 0; i < SH_COEFFS; i++) {\n sh[i] = mix(vec3(shN_mins), vec3(shN_maxs), unpack111110(pack8888(texelFetch(packedShN, ivec2(u + i, v), 0))));\n }\n\n scale = 1.0;\n}\n";
export default _default;