Bulge

볼록·오목 왜곡

Content swells outward or pinches inward around a chosen point.

Also known as: BulgePinchBulge/Pinch

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, Bulge, ImageTexture } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/poster.jpg" />
      <Bulge />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script setup lang="ts">
import { Shader, Bulge, ImageTexture } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <ImageTexture
      object-fit="cover"
      url="/samples/poster.jpg"/>
    <Bulge/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<!-- /samples/… are this site’s sample files — point them at your own image or video. -->
<script>
  import { Shader, Bulge, ImageTexture } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <ImageTexture
    objectFit="cover"
    url="/samples/poster.jpg" />
  <Bulge />
</Shader>
Solid
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, Bulge, ImageTexture } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/poster.jpg" />
      <Bulge />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
// expects <canvas id="canvas" style="width:100%;height:320px"></canvas> on the page
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'ImageTexture',
      props: {
        objectFit: 'cover',
        url: '/samples/poster.jpg',
      },
    },
    {
      type: 'Bulge',
    }
  ]
}, { disableTelemetry: true })

Props · Bulge

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1The center point of the bulge effect
strengthStrength1-1 – 1 (step 0.01)The intensity of the bulge effect (positive = bulge out, negative = pinch in)
radiusRadius10 – 5 (step 0.1)The radius of the bulge effect area
falloffFalloff0.50 – 1 (step 0.01)Controls the smoothness of the transition (0 = hard edge, 1 = very smooth)
edgesEdgesstretchstretch · transparent · mirror · wrapHow to handle edges when distortion pushes content out of bounds

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

Like a magnifying lens pressed into a picture, the area around one point swells outward or caves inward.

Set the position with `center`. Positive `strength` pushes content outward and negative `strength` pinches it inward; `radius` changes the affected area, while `falloff` softens its boundary.

Place it above an image or pattern layer. `edges` controls what appears beyond the canvas. Text is distorted along with the image, so separate the background from details that should stay sharp.

When to use

Use it for lens-like emphasis, inflated forms, and short elastic transitions. Avoid it for copy or detailed UI that must remain undistorted.

Open as page ↗