Orbs / ORB-30
ORB-30
a meadow folding into itself toward a blue vanishing point
Installation
npx expo install react-native-shader-orbs react-native-webgpu react-native-reanimated react-native-workletsUsage
import { ShaderOrb, orb30 } from "react-native-shader-orbs";<ShaderOrb orb={orb30} size={280} state="idle" interactive />Props
Component props
The props you'll use most. The ShaderOrb reference lists all of them.
| Prop | Type | Default | Description |
|---|---|---|---|
state | "idle" | "thinking" | "speaking" | "idle" | The mood. Eases the parameters toward that preset. |
size | number | 280 | Width and height in points. |
params | Record<string, number> | Parameter overrides by key, clamped to each range. See the shader params below. | |
colors | Record<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. | |
interactive | boolean | false | Tap pulses the orb; holding makes it swell. |
quality | "auto" | "low" | "medium" | "high" | number | "auto" | Render scale. Lower is cheaper and softer. |
maxFps | number | 60 | Frame cap. |
paused | boolean | false | Stops drawing and keeps the last frame. |
onReady | () => void | Called once the first frame is on screen. | |
onError | (error: Error) => void | Called 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.
| Key | Label | Range | Step | Default |
|---|---|---|---|---|
fall | Fall speed integrated | 0 to 4 | 0.01 | 0.12 |
tilt | Frame tilt | -1.6 to 1.6 | 0.01 | 0 |
drift | Weather drift integrated | 0 to 4 | 0.02 | 0.2 |
radius | Radius | 0.15 to 3 | 0.015 | 0.9 |
scale | Tunnel scale | 0.3 to 20 | 0.1 | 4.5 |
bulge | Dome bulge | 0 to 4 | 0.02 | 0.25 |
ratio | Frame ratio | 1.1 to 6 | 0.02 | 1.8 |
horizon | Horizon | -0.9 to 0.9 | 0.01 | 0.14 |
cloudScale | Cloud scale | 0.1 to 8 | 0.05 | 1.6 |
cloudCover | Cloud cover | 0.02 to 0.98 | 0.01 | 0.46 |
streakFreq | Wall detail | 0.2 to 20 | 0.1 | 5 |
streakRad | Smear | 0.02 to 4 | 0.02 | 0.5 |
water | Water | 0 to 1 | 0.01 | 0.7 |
flowerScale | Flower scale | 2 to 120 | 1 | 44 |
flowerDensity | Flower density | 0 to 1 | 0.01 | 0.55 |
flowerSize | Flower size | 0.05 to 0.6 | 0.01 | 0.26 |
frameShade | Frame shading | 0.2 to 1.4 | 0.01 | 0.62 |
haze | Aerial haze | 0 to 1 | 0.01 | 0.85 |
hazeRange | Haze reach | 0.005 to 1.5 | 0.005 | 0.09 |
gain | Brightness | 0.05 to 4 | 0.02 | 1.05 |
contrast | Contrast | 0.15 to 10 | 0.05 | 1.05 |
saturation | Saturation | 0 to 4 | 0.02 | 1.1 |
light | Key light | 0 to 3 | 0.015 | 0.35 |
rim | Rim sheen | 0 to 3 | 0.015 | 0.55 |
Colors
Pass these through colors as hex strings.
| Key | Label | Default |
|---|---|---|
sky | Sky | #4a92e0 |
cloud | Cloud | #f7fbff |
canopy | Canopy | #12401f |
meadow | Meadow | #5aa63a |
water | Water | #156f6a |
bloom | Bloom | #ff6a3a |
sheen | Sheen | #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.