playcanvas
Version:
PlayCanvas WebGL game engine
3 lines (2 loc) • 1.34 kB
TypeScript
declare const _default: "\n uniform highp sampler2D means_l;\n uniform highp sampler2D means_u;\n uniform highp sampler2D quats;\n uniform highp sampler2D scales;\n uniform highp sampler2D sh_labels;\n\n uniform highp uint numSplats;\n\n uint packU32(vec4 v) {\n return uint(v.x * 255.0) << 24u |\n uint(v.y * 255.0) << 16u |\n uint(v.z * 255.0) << 8u |\n uint(v.w * 255.0);\n }\n\n uvec4 packU32(vec4 a, vec4 b, vec4 c, vec4 d) {\n return uvec4(packU32(a), packU32(b), packU32(c), packU32(d));\n }\n\n void main(void) {\n int w = int(textureSize(means_l, 0).x);\n ivec2 uv = ivec2(gl_FragCoord.xy);\n if (uint(uv.x + uv.y * w) >= numSplats) {\n discard;\n }\n\n vec3 meansLSample = texelFetch(means_l, uv, 0).xyz;\n vec3 meansUSample = texelFetch(means_u, uv, 0).xyz;\n vec4 quatsSample = texelFetch(quats, uv, 0);\n vec3 scalesSample = texelFetch(scales, uv, 0).xyz;\n vec2 shLabelsSample = texelFetch(sh_labels, uv, 0).xy;\n\n pcFragColor0 = packU32(\n vec4(meansLSample, shLabelsSample.x),\n vec4(meansUSample, shLabelsSample.y),\n vec4(quatsSample),\n vec4(scalesSample, 0.0)\n );\n }\n";
export default _default;