render_ours.sh 1.4 KB

1234567891011121314151617181920
  1. #!/bin/bash
  2. # usage: render_ours.sh <outdir> [ids...] (default: every item in the scan.py database)
  3. # headless GPU render at WE's window size (1920x1058), frame 600 @30fps -> <outdir>/<id>.png + .log
  4. # LWE=<dir with linux-wallpaperengine + its lib .so> picks the build (default: this checkout's build/output)
  5. # audio goes to dead sockets: the engine captures from the desktop's audio server even with --silent
  6. W=${LWE_WORKSHOP_DIR:-/workspace/SteamLibrary/steamapps/workshop/content/431960}
  7. A=${LWE_ASSETS_DIR:-/workspace/SteamLibrary/steamapps/common/wallpaper_engine/assets}
  8. LIB=${LWE_LIBRARY_DIR:-$HOME/.local/share/lwe-library}
  9. SRC=$(cd "$(dirname "$0")/../.." && pwd)
  10. LWE=${LWE:-$SRC/build/output}
  11. OUT=$1; shift; mkdir -p "$OUT"
  12. # a copy under another name so we_manager's shutdown pkill doesn't hit it
  13. cp -f $LWE/linux-wallpaperengine $LWE/lwe-regress-bin
  14. ids=("$@"); [ ${#ids[@]} -eq 0 ] && ids=($(python3 -c "import json;print(' '.join(sorted(json.load(open('$LIB/features.json')))))"))
  15. for id in "${ids[@]}"; do
  16. PULSE_SERVER=unix:/nonexistent-pulse PIPEWIRE_REMOTE=/nonexistent-pipewire \
  17. HEADLESS_RENDER_SIZE=1920x1058 HEADLESS_RENDER_DELAY=${DELAY:-600} HEADLESS_RENDER_TIMEOUT=90 LD_LIBRARY_PATH=$LWE \
  18. $SRC/tools/headless_render.sh $LWE/lwe-regress-bin "$OUT/$id.png" --assets-dir $A --fps 30 --silent $W/$id > "$OUT/$id.log" 2>&1 < /dev/null
  19. echo "ours $id rc=$? $( [ -f "$OUT/$id.png" ] && echo ok || echo NO-PNG)"
  20. done