Orbs / ORB-03

ORB-03

a turbulent belt of light girdling the ball, contoured in rainbow

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, orb03 } from "react-native-shader-orbs";
typescript
<ShaderOrb orb={orb03} 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
speedAnim speed integrated0.015 to 100.050.6
wanderBelt tilt drift integrated0 to 50.020.3
feedbackTilt feedback 0 to 400.11.5
camDistCamera distance 1 to 500.35
focalLens 0.15 to 150.051.05
shellRShell radius 0.2 to 200.13
shellWShell weight 0.005 to 10.0050.12
planeBelt tightness 0 to 10.0050.15
turbWarp 0 to 40.020.55
widthBelt width 0.001 to 0.40.0010.004
pulseBelt breathing 0 to 10.010
surgeBelt surge 0 to 10.010
hueContour hue 0 to 600.125
spreadColour spread 0 to 30.021
envRadiusEnvelope radius 0.15 to 200.13.3
envCoreEnvelope core 0.3 to 1.020.010.92
fillBody fill 0 to 400.050.1
stepClampStep clamp 5 to 20000251500
scatterDiffusion 0 to 0.100.001
exposureExposure 20 to 100000501500
contrastContrast 0.15 to 150.051.2
saturationSaturation 0 to 40.021.25
alphaGainAlpha gain 0.05 to 150.12
edgeEdge sharpness 0 to 10.011
edgeFadeHalo falloff 0.1 to 0.9850.0150.98

Colors

Pass these through colors as hex strings.

KeyLabelDefault
tintTint #ffffff

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