Skip to content
jerinjohnkPublic

About

Glow and bloom techniques for React Native, built with Skia and Reanimated and inspired by game-engine emission. An interactive Expo showcase with 15 sections.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Glow Lab

Glow and bloom techniques for React Native, built with Skia and Reanimated and inspired by game-engine emission.

Most glows in apps are a colored circle with a soft edge. Glow Lab is an Expo app that shows what makes a glow look like a light source instead, with 15 interactive sections you can compare side by side.

The Glow Lab title above a glowing yellow orb The word HELLO glowing in orange, pink and blue A ring, star and bar with bloom beside a dim circle with none

What's inside

# Section What it shows
1 Understanding Light Emission Why light fades from a white center
2 Background Matters The same glow on dark and light backgrounds
3 Foundation Light Using a tinted near-black instead of pure black
4 The White Core Rule An orb with and without a white center
5 The 4-Layer System Core, inner, outer and rays
6 Gradient Stop Points How stop positions shape the falloff
7 Color Palette Selection A palette picker with HSL values
8 Hue Variation Shifting the hue from center to edge
9 Multi-Color Blends Color combinations that blend cleanly
10 Intensity Stacking Adding up to 5 layers to brighten the center
11 Warm Outer Aura A subtle warm edge around a cool glow
12 Animation Strategies Sine and linear easing, and pulse speeds
13 Staggered Animations Offsetting start times
14 HELLO Demo Blurred glow and glass highlights on letterforms
15 Real Bloom A bright pass, blur and additive blend on any Skia shapes

Getting started

You need a Mac with Xcode and an iOS simulator. The app uses native libraries, so it needs a development build and won't run in Expo Go.

git clone https://github.com/jerinjohnk/glow-lab.git
cd glow-lab
npm install
npx expo run:ios

npm install also applies the Skia patch described below.

Tech stack

  • Expo SDK 58 and React Native 0.88
  • React Native Skia 3.8.1, for all gradients, blurs and shaders
  • Reanimated 4.7 and Worklets 0.13, for animation

Project structure

src/
├── GlowShowcase.tsx        The screen and all section copy
├── components/
│   ├── GlowOrb.tsx         The four-layer animated orb
│   ├── SkiaGradients.tsx   Reusable gradient circle and box
│   └── ShowcaseChrome.tsx  Section headers, cards and code blocks
├── demos/                  The interactive demo for each section
├── hooks/
│   ├── useIsInViewport.tsx Tracks whether a view is on screen
│   └── usePulse.ts         Looping sine pulse with Reduce Motion support
└── theme/                  Glow palettes, color helpers and design tokens
patches/                    The react-native-skia fix

To use the orb in your own screen, copy GlowOrb.tsx, SkiaGradients.tsx, usePulse.ts, useIsInViewport.tsx and glowColors.ts.

Performance

Two things made the page stutter while scrolling:

  • Off-screen animation. Every orb kept redrawing while out of view. useIsInViewport now pauses anything that's off screen.
  • A slowdown in react-native-skia 3.8.1. On iOS, each presented frame took longer the longer the app ran. patches/react-native-skia+3.8.1.patch fixes this by compacting a list that otherwise grows with every frame. Check whether a newer release has fixed it before you copy the patch or upgrade Skia.

Is this real emission?

Not quite. Sections 1 to 14 recreate the look of emission with layered gradients and blurs. Section 15 adds bloom, which works on any bright shape, but it doesn't keep brightness above white (HDR) or light nearby objects as a game engine can. For true emission on 3D objects, use a 3D renderer with an emissive material and a bloom pass.

Status

This is a showcase app rather than an installable library. It has only been run on the iOS simulator so far. Android and physical devices are untested.

License

See LICENSE.

About

Glow and bloom techniques for React Native, built with Skia and Reanimated and inspired by game-engine emission. An interactive Expo showcase with 15 sections.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages