Orbs / ORB-24

ORB-24

a Minecraft Earth — a perfect voxel sphere whose seasons cycle it through lush, cherry-grove, ice, mesa and desert worlds

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, orb24 } from "react-native-shader-orbs";
typescript
<ShaderOrb orb={orb24} 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
spinSpin integrated0 to 50.030.22
tiltTilt 0 to 40.020.45
driftTerrain drift integrated0 to 100.050.12
seasonSeason rate integrated0 to 100.050.3
shuffleEmber rate integrated0 to 200.10.8
radiusRadius 0.15 to 30.0151.15
blocksBlocks 16 to 96164
roughMountains 0 to 0.80.010.45
scaleTerrain scale 0.5 to 80.052.4
seaSea level 0 to 10.010.5
treesTrees 0 to 10.010.75
caveCaves 0 to 10.010.4
oreOre density 0 to 0.60.010.12
glowOre glow 0 to 50.030.9
coreMolten core 0 to 10.010.5
textureTexture grain 0 to 10.010.6
lightKey light 0 to 30.0151
gainGain 0.05 to 50.051
contrastContrast 0.15 to 100.051

Colors

Pass these through colors as hex strings.

KeyLabelDefault
grassGrass #6abe30
dirtMud #6f4a2f
stoneStone #8a8a90
sandSand #dbcf9c
waterWater #2f66d0
leafLeaves #3e8f27
oreOre #4de3ff
lavaLava #ff7b26

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