Orbs / ORB-16

ORB-16

sunlight through water — a caustic net crawling over the ball, fringing into colour where it moves

WebGPU isn't available in this browser

Installation

bash
npx expo install react-native-shader-orbs react-native-webgpu react-native-reanimated react-native-worklets

Usage

typescript
import { ShaderOrb, orb16 } from "react-native-shader-orbs";
typescript
<ShaderOrb orb={orb16} size={280} state="idle" interactive />

Props

Component props

The props you'll use most. The ShaderOrb reference lists all of them.

PropTypeDefaultDescription
state"idle" | "thinking" | "speaking""idle"The mood. Eases the parameters toward that preset.
sizenumber280Width and height in points.
paramsRecord<string, number>Parameter overrides by key, clamped to each range. See the shader params below.
colorsRecord<string, string>Hex colors by key. See the colors below.
volumes{ input?: number; output?: number }Levels from 0 to 1 that the shader reads as input and output loudness.
interactivebooleanfalseTap pulses the orb; holding makes it swell.
quality"auto" | "low" | "medium" | "high" | number"auto"Render scale. Lower is cheaper and softer.
maxFpsnumber60Frame cap.
pausedbooleanfalseStops drawing and keeps the last frame.
onReady() => voidCalled once the first frame is on screen.
onError(error: Error) => voidCalled if the orb can't start. Without it the error is logged once.

Shader params

Pass these through params. Values are clamped to the range shown. integrated parameters are phase clocks: the shader accumulates them over time, so the value acts as a rate.

KeyLabelRangeStepDefault
flowWater flow integrated0.015 to 100.050.9
spinTurn integrated0 to 50.030.08
swellRateSurge rate integrated0 to 80.050.6
radiusRadius 0.15 to 30.0150.9
scaleNet scale 3 to 300.19
warpRipple depth 0 to 30.020.8
edgeLine sharpness 0.5 to 100.052.2
splitColour fringe 0 to 30.020.6
swellSurge depth 0 to 10.010.15
gainSun power 0.05 to 60.051.6
contrastTone knee 0.15 to 60.051.1
lightFloor light 0 to 30.0150.9
rimRim sheen 0 to 30.0150.6

Colors

Pass these through colors as hex strings.

KeyLabelDefault
deepWater #0b2f6e
sunCaustic light #7ff6ff
sheenSheen #bfe8ff

Moods

This orb ships presets for idle, speaking, thinking. Choosing a state eases the parameters toward that preset; anything you pass in params still wins.

Credits

Based on original work by XorDev, via shadercn. The shader is licensed for non-commercial use with attribution; see Licensing and credits.

Ported to React Native by @msobkyy.

Want to change something? Open ORB-16 in the playground.