Cornell Box Transmission and IOR
Install
npm install -g @lmctl-ai/lmctl
lmvideo 0.1.38 is released. Source examples are pinned to public commit aab2677.
900x560 CPU Cycles still: authored red and green Cornell walls, one rectangular ceiling area light, rotated tall and short blocks, native closed glass sphere (transmission 1, IOR 1.52), mirror sphere, fixed 64 spp/6 bounce/OIDN profile.
Verified acceptance capture, reproducible with the lmvideo 0.1.38 prerelease runtime.
Run this example
lmctl autorun https://raw.githubusercontent.com/lmctl-ai/lmvideo/aab2677a4b6264ae6afae8ad64a1d7c1dcd3a052/examples/showcase/bench-16-cornell-transmission-ior.lms
Source
# B16 / G.9: authored Cornell box with solid Cycles transmission and IOR.
# Every mesh, colour and label is procedural and MIT under LICENSE-examples.
mkdir("build"); program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38";
let scene=scene3d().threads(4).background("#050608").ambient(0.0).tonemap("aces",1.0);
scene.camera(camera3d().look_at(0.0,1.55,7.7,0.0,1.4,-0.1).perspective(40.0,0.1,30.0));
let white=material("#d9d6ce",0.0,0.82);
let red=material("#b83c39",0.0,0.82);
let green=material("#3f9b63",0.0,0.82);
scene.add(mesh_box(5.0,0.1,5.0),white).position(0.0,-0.05,0.0);
scene.add(mesh_box(5.0,3.2,0.1),white).position(0.0,1.55,-2.5);
scene.add(mesh_box(0.1,3.2,5.0),red).position(-2.5,1.55,0.0);
scene.add(mesh_box(0.1,3.2,5.0),green).position(2.5,1.55,0.0);
# The ceiling rectangle is visible geometry; illumination comes from one actual area light.
scene.add(mesh_box(1.8,0.03,1.1),material("#fff4dc",0.0,1.0)).position(0.0,3.05,0.0).rotation(0.0,18.0,0.0);
let tall=scene.add(mesh_box(0.72,1.8,0.72),white).position(-0.72,0.9,-0.2).rotation(0.0,18.0,0.0);
let short=scene.add(mesh_box(1.25,0.72,1.0),white).position(0.82,0.36,0.58).rotation(0.0,-16.0,0.0);
scene.add(mesh_sphere(0.62,32,48),material("#d9e6ef",0.0,0.08).transmission(1.0).ior(1.52)).position(1.65,0.64,-0.8);
scene.add(mesh_sphere(0.48,28,40),material("#a9b8c6",1.0,0.045)).position(-0.88,0.48,0.92);
scene.area_light(0.0,3.0,0.0,0.0,-1.0,0.0,1.8,1.1,"#fff4dc",30.0,20.0);
let one=scene.render_image(900,560,"cycles",64,1,20261027,true);
let gi=scene.render_image(900,560,"cycles",64,6,20261027,true);
let repeat=scene.render_image(900,560,"cycles",64,6,20261027,true);
# Quantitative GI witness: multi-bounce wall influence differs materially from
# the one-bounce reference, and the denoised high-bounce image is deterministic.
image_assert_true(one.psnr(gi)<70.0);
image_assert_true(gi.rgba()==repeat.rgba());
image_assert_true(gi.stddev(0)>0.04&&gi.mean(0)>0.02);
let red_r=gi.pixel(220,440,0)-one.pixel(220,440,0);let red_g=gi.pixel(220,440,1)-one.pixel(220,440,1);
let green_g=gi.pixel(680,440,1)-one.pixel(680,440,1);let green_r=gi.pixel(680,440,0)-one.pixel(680,440,0);
image_assert_true(red_r>red_g+0.01&&green_g>green_r+0.01);
gi.save("build/bench-16-cornell-transmission-ior.png");
out.print("B16 Cornell CPU Cycles | 64 spp | 6 bounces | seed 20261027 | OIDN | GI PSNR one-bounce="+str(one.psnr(gi))+" | redPatch="+str(gi.pixel(220,440,0)-one.pixel(220,440,0))+","+str(gi.pixel(220,440,1)-one.pixel(220,440,1))+" | greenPatch="+str(gi.pixel(680,440,1)-one.pixel(680,440,1))+","+str(gi.pixel(680,440,0)-one.pixel(680,440,0)));
end _lmcode_
r=run_lmcode(program); assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));