체커 와이프

Checker Wipe

체커보드의 사각형이 차례로 사라지며 입력 화면을 지웁니다.

다른 이름: CheckerWipecheckerboard wipe

WebGPU 를 지원하는 브라우저에서 움직입니다

이 기기에서는 데모를 그리지 못해 정지 화면을 보여 줍니다

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
import { Shader, CheckerWipe, ImageTexture } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/still.jpg" />
      <CheckerWipe
        progress={{
          type: "auto-animate",
          mode: "ping-pong",
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        }}>
        <ImageTexture
          objectFit="cover"
          url="/samples/photo.jpg" />
      </CheckerWipe>
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<!-- /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요. -->
<script setup lang="ts">
import { Shader, CheckerWipe, ImageTexture } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <ImageTexture
      object-fit="cover"
      url="/samples/still.jpg"/>
    <CheckerWipe
      :progress="{
        type: 'auto-animate',
        mode: 'ping-pong',
        outputMin: 0,
        outputMax: 1,
        speed: 0.5
      }">
      <ImageTexture
        object-fit="cover"
        url="/samples/photo.jpg"/>
    </CheckerWipe>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<!-- /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요. -->
<script>
  import { Shader, CheckerWipe, ImageTexture } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <ImageTexture
    objectFit="cover"
    url="/samples/still.jpg" />
  <CheckerWipe
    progress={{
      type: "auto-animate",
      mode: "ping-pong",
      outputMin: 0,
      outputMax: 1,
      speed: 0.5
    }}>
    <ImageTexture
      objectFit="cover"
      url="/samples/photo.jpg" />
  </CheckerWipe>
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
import { Shader, CheckerWipe, ImageTexture } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <ImageTexture
        objectFit="cover"
        url="/samples/still.jpg" />
      <CheckerWipe
        progress={{
          type: "auto-animate",
          mode: "ping-pong",
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        }}>
        <ImageTexture
          objectFit="cover"
          url="/samples/photo.jpg" />
      </CheckerWipe>
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// /samples/… 는 이 사이트의 샘플 파일입니다. 내 프로젝트의 이미지·영상 경로로 바꾸세요.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'ImageTexture',
      props: {
        objectFit: 'cover',
        url: '/samples/still.jpg',
      },
    },
    {
      type: 'CheckerWipe',
      props: {
        progress: {
          type: 'auto-animate',
          mode: 'ping-pong',
          outputMin: 0,
          outputMax: 1,
          speed: 0.5
        },
      },
      children: [
        {
          type: 'ImageTexture',
          props: {
            objectFit: 'cover',
            url: '/samples/photo.jpg',
          },
        },
      ],
    }
  ]
}, { disableTelemetry: true })

속성(props) · CheckerWipe

값을 바꾸면 위 데모와 코드 탭에 바로 반영됩니다. 설명은 라이브러리 레지스트리의 영어 원문(MIT)입니다.

이름값기본값범위·선택지설명(원문)
progressProgress데모에서 자동으로 오가는 값 — 움직이면 그 값에 고정됩니다0.50 – 1 (step 0.01)How far the wipe has progressed (0 = fully visible, 1 = fully wiped away)
blockSizeBlock Size0.10.02 – 0.5 (step 0.01)Size of each square as a fraction of the frame width
softnessSoftness0.150 – 1 (step 0.01)How softly each square fades out (0 = hard-edged squares)
invertInvertfalse—Reverse the order the squares wipe in

모든 컴포넌트 공통: blendMode · opacity · visible · maskSource/maskType · boundingBox · id

체커보드 칸들이 순서대로 페이드되어 장면이 격자 조각으로 나뉘어 사라집니다. 규칙적인 바둑판 리듬이 눈에 띕니다.

`progress`는 기본 0.5, 범위 0–1로 진행 정도를 정합니다. `blockSize`는 기본 0.1, 범위 0.02–0.5로 사각 칸 크기를 바꾸고, `softness`는 기본 0.15, 범위 0–1로 칸의 페이드 경계를 조절합니다. `invert`는 기본 false로 칸이 사라지는 순서를 뒤집습니다.

효과 아래에 이미지나 영상을 놓으세요. 다음 화면을 아래 레이어에 두고 progress를 움직이면 장면 전환으로 쓸 수 있습니다. blockSize가 크면 결과가 투박해지고, softness가 낮으면 경계가 또렷해져 텍스트가 조각난 듯 보입니다.

언제 쓰나

격자 리듬이 어울리는 장면 교체, 그래픽 타이틀, 픽셀 느낌의 전환에 좋습니다. 글자와 표가 온전히 읽혀야 하는 화면에는 피하세요.

페이지로 열기 ↗