Skip to content

jordanade/Nebula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nebula

A GPU-accelerated nebula fly-through screensaver for Android TV. Vibe coded with Claude Sonnet 4.6.

What it looks like

A deep-space nebula fly-through rendered entirely in GLSL on the GPU. Wispy violet/indigo filaments drift through a starfield as you continuously zoom inward — new detail perpetually emerging from the center. Runs smoothly on a NVIDIA Shield.

Designed for OLED displays — the majority of pixels remain black at any given moment, with filaments and hot spots occupying a minority of the frame. All elements are in continuous motion.

nebula-2-preview.mp4

Technical approach

  • Single full-screen quad — all rendering happens in one fragment shader, zero CPU geometry work per frame
  • Zero-contour filamentsexp(-|sfbm(p)| * k) produces a narrow brightness spike wherever smooth FBM crosses zero; five independent noise fields at different scales and offsets create an overlapping network of thin threads against true black, with per-filament color variation (violet, indigo-blue, magenta-rose) based on which field dominates at each pixel
  • Scale-space fractal zoom — rotation applied after scaling ensures pB(t=1) = pA(t=0) exactly at every octave boundary; new detail continuously elaborates on visible structure with no position jumps, resets, or crossfade artifacts
  • Three-phase star system — staggered radial zoom layers with symmetric smoothstep fade-in/out; any single layer's reset is covered by the other two
  • GLES 2.0 — compatible with any Android TV device; highp precision throughout prevents coordinate overflow artifacts at deep zoom levels
  • Shared noise computation — all five FBM values computed once per pixel and reused for both filament brightness and color, halving noise evaluation cost vs naïve implementation
  • Burn-in safe — dual-axis coordinate rotation plus continuous inward zoom guarantees no pixel holds a static value; filaments, hot spots, and stars are all in perpetual motion

Install

Download Nebula.apk from Releases and sideload via ADB:

adb install Nebula.apk

Set as default screensaver:

adb shell settings put secure screensaver_components com.nebula/.NebulaDream
adb shell settings put secure screensaver_default_component com.nebula/.NebulaDream
adb shell settings put secure screensaver_enabled 1

Set screensaver start time (milliseconds):

# 5 minutes
adb shell settings put system screen_off_timeout 300000

Set screen power off time (milliseconds):

# 20 minutes
adb shell settings put secure sleep_timeout 1200000

Trigger immediately for testing:

adb shell am start -n com.android.systemui/.Somnambulator

Build from source

No Android Studio required. Needs javac, dx, aapt, zipalign, apksigner from the Android SDK build tools and android-23 platform jar.

ANDROID_JAR=/path/to/android-23/android.jar
DX=/path/to/build-tools/dx
AAPT=/path/to/build-tools/aapt
ZIPALIGN=/path/to/build-tools/zipalign
APKSIGNER=/path/to/build-tools/apksigner

mkdir -p obj bin

javac -source 8 -target 8 -bootclasspath $ANDROID_JAR \
    -d obj src/com/nebula/NebulaDream.java

$DX --dex --output=bin/classes.dex obj/

$AAPT package -f -F bin/nebula.unaligned.apk \
    -M AndroidManifest.xml -I $ANDROID_JAR
cd bin && zip -j nebula.unaligned.apk classes.dex && cd ..

$ZIPALIGN -f 4 bin/nebula.unaligned.apk bin/nebula.aligned.apk

$APKSIGNER sign --ks your.keystore \
    --out bin/Nebula.apk bin/nebula.aligned.apk

Compatibility

  • Android TV 5.0+ (API 21+), OpenGL ES 2.0
  • Tested on NVIDIA Shield 2017 (Tegra X1, Android 11)
  • HDR10 displays: colours are tuned for OLED — deep blacks with saturated violet highlights

License

MIT

About

Space nebula fly-through screensaver for Android TV

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages