연기 채우기

Smoke Fill

도형 안에서 연기가 소용돌이치며 경계를 따라 번지고 사라집니다.

다른 이름: SmokeFillSmoke fillFluid smoke

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

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

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

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

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

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

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <SmokeFill />
    </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: 'SmokeFill',
    }
  ]
}, { disableTelemetry: true })

속성(props) · SmokeFill

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

이름값기본값범위·선택지설명(원문)
colorAStart Color#8cf3ff—Color of fresh smoke
colorBEnd Color#04a0d6—Color smoke transitions to as it ages
originOrigin코드에서 지정center—Reference edge the center position is measured from (center default). Lets you pin the shape relative to a corner or the canvas centre.
centerCenter
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Center position of the shape
scaleScale10.1 – 3 (step 0.01)Scale of the shape (1 = default size)
rotationRotation00 – 360 (step 1)Rotation of the shape in degrees
emitFromEmit From
x0.5y0.5
{"x":0.5,"y":0.5}x, y: 0 – 1Emission source point within the shape
directionDirection00 – 360 (step 1)Emission direction (0 = up, 90 = right, 180 = down, 270 = left)
speedSpeed100.1 – 30 (step 0.1)Emission velocity strength
spreadSpread600 – 180 (step 1)Emission cone angle in degrees
emitRadiusEmit Size0.030.01 – 0.3 (step 0.01)Size of the emission area
intensityIntensity10.1 – 1 (step 0.01)Smoke emission density
dissipationDissipation0.30.1 – 5 (step 0.1)How fast smoke fades over time
detailDetail250 – 50 (step 1)Fine-scale swirling detail
gravityGravity0.5-2 – 2 (step 0.1)Downward gravitational pull on smoke — 0 = weightless, negative values = smoke rises
colorDecayColor Decay0.40 – 3 (step 0.1)How quickly smoke shifts from Color A to Color B
mouseInfluenceCursor Influence0.10 – 2 (step 0.01)Strength of cursor influence
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
shapeShape코드에서 지정{"type":"sphere3D","radius":0.35}—Serialized shape configuration (JSON)
shapeSdfUrlshapeSdfUrl코드에서 지정—URL to a pre-generated SDF .bin file
shapeTypeshapeType코드에서 지정—Active SDF shape type

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

유리병 안에 연기를 가둔 듯, 연기가 지정한 곳에서 피어올라 도형의 경계를 따라 소용돌이칩니다.

`emitFrom`은 연기가 시작되는 위치, `direction`은 뿜어 나가는 방향을 정합니다. `speed`를 높이면 더 빠르게 퍼지고, `spread`를 넓히면 분사 각도가 커집니다. `dissipation`은 연기가 사라지는 속도를, `detail`은 작은 소용돌이 결을 조절합니다.

자체 연기를 만들며 대비가 있는 배경에 큰 도형으로 두면 흐름이 보입니다. 연기가 텍스트 윤곽을 덮을 수 있으므로 문장이나 작은 아이콘 내부를 채우는 용도로는 피하세요.

언제 쓰나

연기 배경, 도형 속 안개 장식, 짧은 장면 전환에 어울립니다. 작은 텍스트나 정밀한 아이콘의 내부를 채워야 하는 곳에는 피하세요.

페이지로 열기 ↗