#!/usr/bin/env python3 """Two-pass ice pipeline: scene -> texture(+depth in alpha) -> refraction -> screen. Writes ice.html. Open ice.html#shot&t=2 for a single still frame.""" import json, os here = os.path.dirname(os.path.abspath(__file__)) import sys a = sys.argv[1:] scene_f, ice_f, out_f = (a + ["4_ice_scene.frag", "5_ice_refract.frag", "ice.html"])[:3] scene = open(os.path.join(here, scene_f)).read() ice = open(os.path.join(here, ice_f)).read() HTML = """ice
""" out = (HTML.replace("__SCENE_B64__", __import__("base64").b64encode(scene.encode()).decode()) .replace("__ICE_B64__", __import__("base64").b64encode(ice.encode()).decode())) open(os.path.join(here, out_f), "w").write(out) print(out_f, "written")