물 재질

Water

빛을 굴절하고 흡수하는 물 표면에 바람결 물결과 가장자리 거품을 더합니다.

다른 이름: WaterWater surfaceWater material

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

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

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

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

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

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

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

속성(props) · Water

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

이름값기본값범위·선택지설명(원문)
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 water shape
scaleScale10.1 – 3 (step 0.01)Scale of the water shape (1 = default size)
rotationRotation00 – 360 (step 1)Rotation of the water shape in degrees
waterColorWater Color#00bfeb—The color the water saturates toward with depth
clarityClarity0.40 – 1 (step 0.01)How much of the reflected sky transmits through the body
depthDepth50 – 8 (step 0.01)How quickly the water darkens and saturates toward its color with thickness
shallowsShallows0.50 – 1 (step 0.01)Brightness of the thin shallow water at the edges — high fades the rim to light translucent water, low keeps the edges close to the deep water color
causticsCaustics0.150 – 2 (step 0.01)Intensity of the light caustics bubbling up through the body — bright veins of focused light churning inside the water
causticScaleCaustic Scale61 – 20 (step 0.1)Size of the caustic veins — higher = finer, busier light patterns inside the body
choppinessChoppiness0.80 – 1.5 (step 0.01)Height of the wind-driven waves — the depth of the folds that bend the reflection
waveScaleWave Scale3.50.5 – 8 (step 0.01)Scale of the wave fronts — higher = smaller, busier ripples
swirlSwirl0.60 – 1.5 (step 0.01)Swirl of the flow — domain-warps the wave fronts into curling eddies
speedSpeed0.50 – 4 (step 0.01)Speed of the rolling waves. 0 pauses the surface.
reflectionReflection20 – 2 (step 0.01)Strength of the reflected sky across the surface
envRotationEnv Rotation00 – 360 (step 1)Rotates the reflected sky — spins where the bright sky and sun fall
sharpnessSharpness0.10 – 1 (step 0.01)Tightness of the sun glint and reflected sun
lightAngleLight Angle300 – 360 (step 1)Direction of the sun, in degrees — drives the glint and where the sun reflects
foamFoam0.30 – 1 (step 0.01)White foam breaking on the wave crests and along the shoreline edge
edgeSoftnessEdge Softness0.050 – 1 (step 0.01)Softness of the shape boundary edge
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

투명한 물속으로 빛이 들어가고 표면에서는 하늘이 흔들려 비치는 모습처럼 보입니다. 파도 꼭대기와 가장자리에는 거품이 생깁니다.

`clarity`를 올리면 반사된 하늘빛이 물속으로 더 많이 통과합니다. `depth`는 두께에 따라 물색이 짙어지는 정도를, `choppiness`는 파도의 높이를 조절합니다. `waveScale`을 높이면 물결이 더 작고 촘촘해지고, `foam`은 흰 거품을 늘립니다.

자체 물 표면을 만들므로 고정된 배경이나 도형과 겹쳐 장식적으로 쓸 수 있습니다. 계속 움직이는 물결은 안정적인 UI 표면이나 작은 글자와 어울리지 않으니 텍스트 아래에서는 움직임을 절제하세요.

언제 쓰나

물결 배경, 수면을 담은 로고, 풍경 일러스트의 물 영역에 어울립니다. 고정된 조작면이나 작은 글자를 읽어야 하는 배경에는 피하세요.

페이지로 열기 ↗