The input drapes over a lit 3D wave surface with visible depth and perspective.
Also known as: Surface3D3D wave surface
Moves in browsers that support WebGPU
This device could not render the demo — showing a still
Code reflects the control values
React
// Renders only in browsers with WebGPU.
// /samples/… are this site’s sample files — point them at your own image or video.
import { Shader, ImageTexture, Surface3D } from 'shaders/react'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: 320 }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Surface3D />
</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, ImageTexture, Surface3D } from 'shaders/vue'
</script>
<template>
<Shader style="width: 100%; height: 320px" :disable-telemetry="true">
<ImageTexture
object-fit="cover"
url="/samples/photo.jpg"/>
<Surface3D/>
</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, ImageTexture, Surface3D } from 'shaders/svelte'
</script>
<Shader style="width: 100%; height: 320px" disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Surface3D />
</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, ImageTexture, Surface3D } from 'shaders/solid'
export default function ShaderEffect() {
return (
<Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
<ImageTexture
objectFit="cover"
url="/samples/photo.jpg" />
<Surface3D />
</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/photo.jpg',
},
},
{
type: 'Surface3D',
}
]
}, { disableTelemetry: true })
Props · Surface3D
Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).
Name
Value
Default
Range / options
Description
amplitudeAmplitude
0.3
0 – 1 (step 0.01)
Wave height
waveTypeWave Type
fractal
fractal · sine · ridge
Wave pattern type
frequencyFrequency
1.5
0.1 – 5 (step 0.1)
Wave frequency
octavesOctaves
2
1 – 5 (step 1)
Detail octaves
seedSeed
0
0 – 100 (step 1)
Random seed offset
speedSpeed
0.5
0 – 3 (step 0.1)
Animation speed
tiltTilt
35
0 – 85 (step 1)
Camera tilt in degrees
rollRoll
0
-45 – 45 (step 1)
Camera roll in degrees
heightHeight
0
-1 – 2 (step 0.01)
Camera height
zoomZoom
1
0.3 – 3 (step 0.01)
Camera zoom
nearCutoffNear Cutoff
0
0 – 1 (step 0.01)
Near fade distance
farCutoffFar Cutoff
1
0 – 1 (step 0.01)
Far fade distance
edgePinningEdge Pinning
0
0 – 1 (step 0.01)
Smoothly flatten the surface at its edges (orthogonal to edge mode)
edgesEdges
mirror
stretch · transparent · mirror · wrap
How to handle content beyond the surface bounds
lightingLighting
30
0 – 100 (step 1)
Intensity of lighting and shading
glossinessGlossiness
0
0 – 100 (step 1)
Surface glossiness
highlightsHighlights
15
0 – 100 (step 1)
Specular highlight intensity
lightXLight X
0.4
-1 – 1 (step 0.01)
Light direction X
lightYLight Y
-0.6
-1 – 1 (step 0.01)
Light direction Y
lightZLight Z
0.7
-1 – 1 (step 0.01)
Light direction Z
lightColorLight Color
#ffffff
—
Light color
cursorIntensityCursor Ripples
1
0 – 2 (step 0.01)
Strength of cursor ripples
cursorSpeedRipple Speed
0.5
0 – 1 (step 0.01)
Speed of cursor ripple propagation
Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id
Like fabric or a flag held in the wind, a flat image drapes over a wavy surface and moves with visible depth.
Increase `amplitude` for taller waves and choose the pattern with `waveType`. `frequency` changes how closely the waves repeat, `tilt` changes the camera angle, and `lighting` controls surface shading.
Place it above an image or pattern layer. `Form3D` emphasizes a shape such as a ribbon or sphere; this effect emphasizes a wave surface. Tune `edges`, `nearCutoff`, and `farCutoff` around the frame, and avoid long copy that becomes wavy across the surface.
When to use
Use it for fabric or flag-like motion, waving banners, and dimensional backgrounds. Avoid it for small copy or tables that need a flat, precise layout.