안개

Fog

안개가 화면을 채우고 포인터 근처에서 밀려나며 빈틈을 만듭니다.

다른 이름: Foginteractive fog

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

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

React
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Fog } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Fog />
    </Shader>
  )
}
Vue
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script setup lang="ts">
import { Shader, Fog } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Fog/>
  </Shader>
</template>
Svelte
<!-- WebGPU 를 지원하는 브라우저에서만 그립니다. -->
<script>
  import { Shader, Fog } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Fog />
</Shader>
Solid
// WebGPU 를 지원하는 브라우저에서만 그립니다.
import { Shader, Fog } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Fog />
    </Shader>
  )
}
JavaScript
// WebGPU 를 지원하는 브라우저에서만 그립니다.
// <canvas id="canvas" style="width:100%;height:320px"></canvas> 가 페이지에 있어야 한다
import { createShader } from 'shaders/js'

const shader = await createShader(document.getElementById("canvas"), {
  components: [
    {
      type: 'Fog',
    }
  ]
}, { disableTelemetry: true })

속성(props) · Fog

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

이름값기본값범위·선택지설명(원문)
colorAColor A#e0e0e0—Primary fog color
colorBColor B#888888—Secondary fog color — creates variation across the field
seedSeed00 – 999 (step 1)Deterministic starting pattern — different seeds produce different fog configurations
speedSpeed10.1 – 3 (step 0.1)Simulation speed multiplier
turbulenceTurbulence10 – 3 (step 0.01)Ambient motion strength
detailDetail150 – 50 (step 1)Fine-scale swirling structure — higher values produce more intricate wisps and vortices
blendingBlending0.30 – 1 (step 0.01)How much the two colors blend together — 0 behaves like oil & water (colors stay distinct with sharp boundaries), 1 behaves like food coloring (colors fully mix)
mouseInfluenceCursor Influence0.10 – 2 (step 0.01)Strength of cursor influence — move the cursor to push fog
mouseRadiusCursor Radius0.10.02 – 0.5 (step 0.01)Radius of cursor influence area
colorSpaceColor Spacelinearlinear · oklch · oklab · hsl · hsv · lchColor space for color interpolation

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

반투명한 안개가 화면을 채우고 포인터가 지나가면 주변이 밀려나며 흐트러진다. 얕은 안개 낀 유리창을 손으로 닦아 잠깐 틈을 내는 것처럼 보인다.

`speed`는 전체 움직임 속도(기본값 1, 범위 0.1–3), `turbulence`는 흔들림의 세기(기본값 1, 범위 0–3), `detail`은 작은 소용돌이의 양(기본값 15, 범위 0–50)을 바꾼다. `blending`은 두 색이 섞이는 정도(기본값 0.3, 범위 0–1), `mouseInfluence`는 포인터가 안개를 미는 힘(기본값 0.1, 범위 0–2)이다.

혼자 화면을 덮는 생성 레이어라 밑에 입력 이미지가 필요 없다. 큰 여백이 있는 배경에 두면 잘 보이고, 중요한 글자나 대비가 필요한 정보 위에서는 안개가 읽기를 가릴 수 있다.

언제 쓰나

넓은 히어로 배경, 포인터로 드러나는 장면, 섹션 사이의 분위기 연출에 좋다. 대비가 낮은 글자나 핵심 정보를 안개 아래 두는 것은 피한다.

페이지로 열기 ↗