UNPKG

@luma.gl/effects

Version:

Rendering and post-processing effects library for luma.gl

20 lines (17 loc) 445 B
// TODO: FIXME /* eslint-disable */ const fs = `\ vec4 warp_sampleColor(sampler2D texture, vec2 texSize, vec2 coord) { vec4 color = texture2D(texture, coord / texSize); vec2 clampedCoord = clamp(coord, vec2(0.0), texSize); if (coord != clampedCoord) { /* fade to transparent if we are outside the image */ color.a *= max(0.0, 1.0 - length(coord - clampedCoord)); } return color; } `; export default { name: 'warp', fs };