openwallpaper
Loading...
Searching...
No Matches
wpe-compile

A tool to make OpenWallpaper scenes from Wallpaper Engine pkg scenes using code generation. It supports basic Wallpaper Engine subset used by most scenes (no SceneScript and 3D).

Build

To build and use wpe-compile, you will need to install:

  • Go compiler
  • glslc
  • WASM C compiler, wasi-sdk recommended
  • Git

After you have installed all the dependencies, run the following commands to build wpe-compile:

git clone --depth=1 --recurse-submodules https://github.com/mechakotik/openwallpaper
cd openwallpaper/wpe-compile
go build .

Usage

Assuming you have Steam Wallpaper Engine installed. Get pkg scenes from SteamLibrary/steamapps/workshop/content/431960. You will also need Wallpaper Engine assets directory, it is located in SteamLibrary/steamapps/common/wallpaper_engine/assets.

Usage example:

export WPE_COMPILE_ASSETS=/path/to/assets
export WPE_COMPILE_WASM_CC=/path/to/wasi-sdk/bin/clang
./wpe-compile /path/to/scene.pkg /path/to/result.owf

Available wpe-compile options:

  • --keep-sources – keep intermediate C and GLSL sources, which are not needed for rendering but are useful for debugging
  • --particles=<true|false> – enable/disable particles, enabled by default

Generated owf scenes have the following runtime options that you can set when running with wallpaperd:

  • --scale-mode=<stretch|aspect-fit|aspect-crop> – controls how the scene is fitted in screen when its aspect ratio does not match screen aspect ratio, defaults to aspect-crop

Support status

This is currently an early WIP, and scene behaviour will probably be different from what you get in Wallpaper Engine. Accurate reverse engineering involves a lot of work, so contributions are welcome!

You can check out this list to see what is not yet implemented or can be improved. (*) means that the feature is not implemented completely, or the behavior is not fully accurate to Wallpaper Engine.

  • Layer
    • Image
    • Fullscreen
    • Effects (*)
  • Texture
    • Image
    • Spritesheet
      • Frame blending
    • Video texture
  • Camera
    • Orthographic
    • Perspective
    • Object transform
      • Translate
      • Scale
      • Rotate
        • Rotate Y (*) (logic is different from X/Z for some reason)
    • Parallax (*)
    • Shake
    • Fade
  • Particles
    • Renderer
      • Sprite
      • Sprite Trail
      • Rope
      • Rope Trail
    • Emitters
      • Sphere random
      • Box random
      • Layer image
    • Initializers
      • Lifetime random
      • Size random
      • Color random
      • HSV color random
      • Color list
      • Alpha random
      • Velocity random
      • Inherit control point velocity
      • Turbulent velocity random (*)
      • Rotation random
      • Position offset random
      • Angular velocity random
      • Position around control point
      • Position between control points
      • Remap initial value
      • Inherit value from event
    • Operators
      • Movement
      • Angular movement
      • Alpha fade
      • Size change
      • Color change
      • Alpha change
      • Oscillate position
      • Oscillate alpha
      • Oscillate size
      • Control point force
      • Maintain distance to control point
      • Maintain distance between control points
      • Reduce movement near control point
      • Turbulence
      • Vortex
      • Boids
      • Cap velocity
      • Remap value
      • Inherit value from event
      • Collision operators
      • Operator blending
    • Children
    • Control points
  • Audio response
  • Timeline animations
  • Puppet warp
  • Lighting and reflections
  • Sound
  • User properties
  • 3D (not planned because of immense complexity)
  • SceneScript (not planned because of immense complexity)

Test scenes

Here is a few Wallpaper Engine scenes that were tested to work fully (or almost fully) with wpe-compile, so you can try compiling them before other scenes that may not work:

Credits

This would not have been possible to implement so fast without RePKG, wallpaper-scene-renderer and linux-wallpaperengine which have done some reverse engineering of Wallpaper Engine previously and were used as reference.