UNPKG

playcanvas

Version:

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

22 lines (21 loc) 654 B
var uv0_default = ` #ifdef NINESLICED fn getUv0() -> vec2f { var uv = vertex_position.xz; let positiveUnitOffset = clamp(vertex_position.xz, vec2f(0.0, 0.0), vec2f(1.0, 1.0)); let negativeUnitOffset = clamp(-vertex_position.xz, vec2f(0.0, 0.0), vec2f(1.0, 1.0)); uv = uv + ((-positiveUnitOffset * uniform.innerOffset.xy) + (negativeUnitOffset * uniform.innerOffset.zw)) * vertex_texCoord0.xy; uv = uv * -0.5 + vec2f(0.5, 0.5); uv = uv * uniform.atlasRect.zw + uniform.atlasRect.xy; dMaskGlobal = vertex_texCoord0.xy; return uv; } #else fn getUv0() -> vec2f { return vertex_texCoord0; } #endif `; export { uv0_default as default };