UNPKG

playcanvas

Version:

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

10 lines (8 loc) 455 B
// Template for gsplat stream declaration - uniform and load function // Placeholders: {name}, {sampler}, {returnType}, {funcName} var glslStreamDecl = /* glsl */ ` uniform highp {sampler} {name}; {returnType} load{funcName}() { return texelFetch({name}, splat.uv, 0); } {returnType} load{funcName}WithIndex(uint index) { return texelFetch({name}, ivec2(index % splatTextureSize, index / splatTextureSize), 0); } `; export { glslStreamDecl as default };