Marble

대리석 무늬

A marble-like swirl with veins formed by noise-distorted waves.

Also known as: Marblemarble texturemarble veins

Moves in browsers that support WebGPU

This device could not render the demo — showing a still

React
// Renders only in browsers with WebGPU.
import { Shader, Marble } from 'shaders/react'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: 320 }} disableTelemetry>
      <Marble />
    </Shader>
  )
}
Vue
<!-- Renders only in browsers with WebGPU. -->
<script setup lang="ts">
import { Shader, Marble } from 'shaders/vue'
</script>

<template>
  <Shader style="width: 100%; height: 320px" :disable-telemetry="true">
    <Marble/>
  </Shader>
</template>
Svelte
<!-- Renders only in browsers with WebGPU. -->
<script>
  import { Shader, Marble } from 'shaders/svelte'
</script>

<Shader style="width: 100%; height: 320px" disableTelemetry>
  <Marble />
</Shader>
Solid
// Renders only in browsers with WebGPU.
import { Shader, Marble } from 'shaders/solid'

export default function ShaderEffect() {
  return (
    <Shader style={{ width: '100%', height: '320px' }} disableTelemetry>
      <Marble />
    </Shader>
  )
}
JavaScript
// Renders only in browsers with WebGPU.
// 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: 'Marble',
    }
  ]
}, { disableTelemetry: true })

Props · Marble

Changes apply to the demo above and to the code tabs. Descriptions come from the library registry (MIT).

NameValueDefaultRange / optionsDescription
colorABase#ffffff—Base background color of the marble
colorBTone#3a2d54—Secondary marble tone
colorCDepth#0f0f0f—Deepest marble color
scaleScale20.1 – 10 (step 0.1)Scale and density of the marble vein pattern
turbulenceTurbulence100 – 50 (step 0.5)Amount of noise-driven distortion applied to the veins
speedSpeed0.050 – 0.25 (step 0.005)Animation speed
seedSeed00 – 100 (step 1)Random seed for pattern variation
colorSpaceColor Spacelinearlinear · oklch · oklab · hsl · hsv · lchColor space for color interpolation

Every component also takes blendMode · opacity · visible · maskSource/maskType · boundingBox · id

Its colored bands bend and branch like veins in a slab of marble. The flowing grain adds the impression of stone to a flat surface.

`colorA` sets the base color and `colorB` the secondary tone; the third color supplies the deepest tone. `scale` defaults to 2 and ranges from 0.1 to 10; higher values make the veins denser. `turbulence` defaults to 10 and ranges from 0 to 50; higher values distort the veins more strongly. `speed` defaults to 0.05 and ranges from 0 to 0.25, controlling how quickly the pattern moves.

This generator draws the marble grain directly instead of applying a material filter to input. Pair it with `FractalNoise` for broader color variation, or use it alone as a material background. High `turbulence` makes the veins more intricate, so start low when you want a calm stone surface.

When to use

Use it for marble-like material backgrounds, abstract patterns with visible veins, and slowly moving surfaces. Avoid it when you need a regular grid or a smooth solid fill.

Open as page ↗