Add ice_object.html: a faceted crystal shard frozen in the slab

Pass 1 draws one raymarched gem on sheet 1 instead of plasma; its alpha
carries coverage rather than depth, so pass 2 can light it as a solid
while every other sheet still absorbs by path length.
This commit is contained in:
emil28092005
2026-10-30 21:30:09 +03:00
parent 366ff39662
commit 01123b8bac
4 changed files with 384 additions and 5 deletions
+11 -5
View File
@@ -1,11 +1,17 @@
#!/usr/bin/env python3
"""Embed the two GLSL passes into the standalone ice_plasma.html page."""
"""Embed two GLSL passes into a standalone page.
build_plasma.py [scene.frag] [ice.frag] [out.html]
Defaults to the plasma wall: 6_ice_plasma.frag + 7_ice_over.frag -> ice_plasma.html."""
import json
import sys
from pathlib import Path
here = Path(__file__).resolve().parent
scene = (here / '6_ice_plasma.frag').read_text()
ice = (here / '7_ice_over.frag').read_text()
args = (sys.argv[1:] + ['6_ice_plasma.frag', '7_ice_over.frag', 'ice_plasma.html'])[:3]
scene = (here / args[0]).read_text()
ice = (here / args[1]).read_text()
html = r'''<!doctype html>
<html lang="ru">
<head>
@@ -119,5 +125,5 @@ if (shot) frame(0); else requestAnimationFrame(frame);
</body>
</html>
'''
(here / 'ice_plasma.html').write_text(html.replace('__SCENE__', json.dumps(scene)).replace('__ICE__', json.dumps(ice)))
print('ice_plasma.html written')
(here / args[2]).write_text(html.replace('__SCENE__', json.dumps(scene)).replace('__ICE__', json.dumps(ice)))
print(args[2], 'written')