Orbs / ORB-30

ORB-30

a meadow folding into itself toward a blue vanishing point

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, orb30 } from "react-native-shader-orbs";
typescript
<ShaderOrb orb={orb30} 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
fallFall speed integrated0 to 40.010.12
tiltFrame tilt -1.6 to 1.60.010
driftWeather drift integrated0 to 40.020.2
radiusRadius 0.15 to 30.0150.9
scaleTunnel scale 0.3 to 200.14.5
bulgeDome bulge 0 to 40.020.25
ratioFrame ratio 1.1 to 60.021.8
horizonHorizon -0.9 to 0.90.010.14
cloudScaleCloud scale 0.1 to 80.051.6
cloudCoverCloud cover 0.02 to 0.980.010.46
streakFreqWall detail 0.2 to 200.15
streakRadSmear 0.02 to 40.020.5
waterWater 0 to 10.010.7
flowerScaleFlower scale 2 to 120144
flowerDensityFlower density 0 to 10.010.55
flowerSizeFlower size 0.05 to 0.60.010.26
frameShadeFrame shading 0.2 to 1.40.010.62
hazeAerial haze 0 to 10.010.85
hazeRangeHaze reach 0.005 to 1.50.0050.09
gainBrightness 0.05 to 40.021.05
contrastContrast 0.15 to 100.051.05
saturationSaturation 0 to 40.021.1
lightKey light 0 to 30.0150.35
rimRim sheen 0 to 30.0150.55

Colors

Pass these through colors as hex strings.

KeyLabelDefault
skySky #4a92e0
cloudCloud #f7fbff
canopyCanopy #12401f
meadowMeadow #5aa63a
waterWater #156f6a
bloomBloom #ff6a3a
sheenSheen #cfe6ff

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