Orbs / ORB-27

ORB-27

a weather-radar mosaic, fronts of coloured pixels sweeping the ball

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, orb27 } from "react-native-shader-orbs";
typescript
<ShaderOrb orb={orb27} 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
speedFront speed integrated0.015 to 100.050.6
spinRoll integrated0 to 50.030.04
radiusRadius 0.15 to 30.0150.9
scaleGrid zoom 0.3 to 80.052.4
cellsGrid 8 to 120134
dotDot size 0.1 to 0.50.010.36
swirlSwirl 0 to 80.051.5
vortexVortex size 0.1 to 20.010.45
freqStorm scale 0.2 to 80.051.6
warpBend 0 to 30.020.5
loQuiet threshold 0 to 10.0050.12
hiPeak threshold 0 to 10.0050.82
curveResponse curve 0.5 to 40.051.4
ditherClass dither 0 to 0.60.0050.12
sparseQuiet density 0 to 10.010.16
densityFill 0 to 1.50.011
twinkleTwinkle rate 0 to 300.53
grainPaper grain 0 to 10.010.1
lightKey light 0 to 10.010.18
rimRim 0 to 10.010.35

Colors

Pass these through colors as hex strings.

KeyLabelDefault
paperPaper #efe9dc
c0Quiet #a9a9a6
c1Class 1 #2e5df0
c2Class 2 #38d9ec
c3Class 3 #22c35c
c4Class 4 #e8322a
c5Class 5 #f5d020
c6Peak #e030c0

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-27 in the playground.