Git Product home page Git Product logo

windy's Introduction

Windy Live Wallpaper

ci

Android live wallpaper visualizing local wind patterns.

The shaders are based on the official Pixel windy live wallpaper, but this has:

  • Completely rewritten Java code.
  • More color schemes.
  • Updated wind data (the official data was last updated in 2019).
  • Better location handling.
  • Lower memory and CPU usage.
  • Updated libGDX.
  • Other fixes.

Note

On some devices (e.g., the Pixel 8), the shaders are buggy, causing the lines to appear jagged or straight left/right/up/down. I'm still working on figuring out the root cause when I have time.

Download

Screenshots

Wind field images

The wind field images used by the live wallpaper are generated from NOAA GFS 0.25° ANL data (updated every 6 hours) using the wind vector values (UGRD, VGRD) at 850 mb elevation (this is arbitrary).

The wind vector (in m/s) is extracted from the GRIB2 forecast data and mapped into a RGB 8bpp image (equirectangular projection, y: latitude 90° to -90°, longitude -180° to 180°) with one pixel per grid cell (1440x721). The red/green values are the u/v components (east/north) of the unit vector mapped from -1-1 to 0-255, and the blue value is the magnitude of the unit vector clamped and mapped from 0-30 (this value is arbitrary) to 0-255. The image is encoded as a JPEG.

The elevation and wind vector magnitude range I chose seems to produce similar images as the old official one from 2019 (available at www.gstatic.com/pixel/livewallpaper/windy/gfs_wind_1000.jpg), and the red/green/blue level curves are similar.

To create the texture passed to the particle system and background shaders, the image is scaled down to 1/4 of the size (i.e., 360x180) using bilinear filtering, then blurred using a gaussian kernel of radius 2. This matches what was done by the original live wallpaper. This filtering is done to smooth out the streamlines and remove local outlier values, resulting in less detailed and rounder wallpaper wind trails. Since the wallpaper still looks good, and is interesting in its own way before this filtering, I'm probably going to add variants with an unfiltered wind field later.

See windy.api.pgaskin.net/wind_field.jpg for the latest wind field image generated by this code, and windy.api.pgaskin.net/wind_cache.png?filter=1 for the latest filtered texture.

windy's People

Contributors

pgaskin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.