UNPKG

playcanvas

Version:

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

8 lines (6 loc) 348 B
var wgslStreamDecl = ` var {name}: {textureType}; fn load{funcName}() -> {returnType} { return textureLoad({name}, splat.uv, 0); } fn load{funcName}WithIndex(index: u32) -> {returnType} { return textureLoad({name}, vec2i(i32(index % uniform.splatTextureSize), i32(index / uniform.splatTextureSize)), 0); } `; export { wgslStreamDecl as default };