Vibary.ai
← All WebGL effects

Silk Sheen

Brightness taken from thread direction rather than position, so the highlight moves because the cloth turned.

ambientpremiumcalmelegant1 draw call · full-screen shader · light · 1 context · automatic · looping
queued1 draw call · 1 context
Variant

The scene in this preview is the file shown here. The surrounding demo shell only provides context and is not part of the copied code.

301 lines · react + three
"use client";

import * as React from "react";
import * as THREE from "three";

/**
 * Silk Sheen — the highlight is perpendicular to the thread.
 *

About this effect

A backdrop for the one surface a product wants to feel expensive — a pricing panel, a paywall, an upgrade sheet. What makes silk read as silk is that it is directional: light scatters in a band across the fibre and barely at all along it, so the cloth is bright wherever its threads lie across your line of sight. Fold it and the highlight moves because the direction moved, not because someone shaded it. So the field this shader carries is a direction, not a brightness. The direction is the gradient of a slow scalar function turned ninety degrees — a curl, which has no sources and no sinks, and that is the reason the weave flows rather than throbs: a field that could pool would pulse in place. Brightness after that is a single line of arithmetic, how squarely the thread lies to the light, and every band and soft fold in the picture is that one line answering the direction field. Nothing paints a stripe.

Pricing panelPaywall backdropUpgrade sheetLanding page hero

Related effects