UNPKG

playcanvas

Version:

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

3 lines (2 loc) 1.44 kB
declare const _default: "\n\n// Texture size and splat count uniforms\nuniform uint splatTextureSize;\nuniform uint dstTextureSize;\nuniform uint srcNumSplats;\nuniform uint dstNumSplats;\n\n// Shared splat identification (index, uv) and setSplat() helper\n#include \"gsplatSplatVS\"\n\n// Input stream declarations (generated by GSplatFormat.getInputDeclarations)\n#include \"gsplatProcessInputVS\"\n\n// Output write functions (generated by GSplatFormat.getOutputDeclarations)\n#include \"gsplatProcessOutputVS\"\n\n// Format-specific read code (included when \"default\" stream is used)\n#include \"gsplatProcessReadVS\"\n\n// User's process code - defines process() function and any declarations\n#include \"gsplatProcessChunk\"\n\nvoid main(void) {\n // Fragment coordinates give us the destination splat index\n ivec2 fragCoords = ivec2(gl_FragCoord.xy);\n \n // Linear index of the destination splat\n uint splatIndex = uint(fragCoords.y * int(dstTextureSize) + fragCoords.x);\n \n // Skip padding pixels (texture may be larger than actual splat count)\n if (splatIndex >= dstNumSplats) discard;\n \n // Initialize global splat for sampling\n // Note: splat.uv assumes 1:1 mapping using splatTextureSize. When sizes differ,\n // call setSplat() with a different index in user code.\n setSplat(splatIndex);\n \n // Call user's process function\n process();\n}\n"; export default _default;