3D Render + 3D Hald CLUT & Post-Processing

Contents Previous Next

Install

npm install -g @lmctl-ai/lmctl

lmvideo 0.1.38 is released. Source examples are pinned to public commit aab2677.

Download lmvideo 0.1.38

900x560 still; 2x2 comparison of colour, Hald CLUT/tilt-shift/vignette grade, depth, and normal AOVs with Sobel edge witness.

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-13-aov-post-processing.lms

Source

# B13 / G.8: colour, depth, normal and post-processing witnesses in a 2x2 sheet.
mkdir("build"); program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38";
let scene=scene3d().threads(4).background("#ecf2f7").ambient(0.2).threads(4); scene.camera(camera3d().look_at(3.0,2.0,5.0,0.0,0.0,0.0).perspective(45.0,0.1,12.0)); scene.add(mesh_torus(1.2,0.3,24,40),"#de7656"); scene.add(mesh_sphere(0.45,16,24),"#359b9a"); scene.directional_light(2.0,3.0,4.0,"#ffffff",0.9);
let colour=scene.render_image(420,260,2); let depth=scene.render_depth_image(420,260); let normal=scene.render_normal_image(420,260); image_assert_true(depth.max(0)>0.1&&normal.max(2)>0.5);
let hald=image_hald(4).hsl(10.0,1.12,1.0); let focus=depth.copy().levels(0.25,1.0,0.65);let defocused=colour.copy().blur(4.0,4.0).mask(focus);let graded=colour.copy().blend(defocused,"over",1.0,0,0).clut(hald).tilt_shift(3.0,0.35,0.70).vignette(155.0,0.85);image_assert_true(graded.mean(0)>0.15&&graded.stddev(0)>0.05); let sobel=colour.copy().edges(1.0).grayscale();
let outlined=normal.copy().blend(sobel,"screen",0.7,0,0); colour.text(12.0,24.0,"1. CPU raster",17.0,0.05,0.12,0.20,1.0);graded.text(12.0,24.0,"2. Depth blur + Hald + tilt + vignette",14.0,0.05,0.12,0.20,1.0);depth.text(12.0,24.0,"3. Linear view depth",17.0,0.05,0.12,0.20,1.0);outlined.text(12.0,24.0,"4. Normals + Sobel",17.0,1.0,1.0,1.0,1.0);let sheet=layout_sheet().add(colour).add(graded).add(depth).add(outlined); sheet.render(2,12,0.88,0.92,0.96,1.0).resize(900,560).save("build/bench-13-aov-post-processing.png"); image_assert_true(sobel.stddev(0)>0.01&&outlined.stddev(0)>0.01);
end _lmcode_
 r=run_lmcode(program); assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));

Raw LMScript source

Four panels comparing a three-dimensional scene and image-processing passes.
Compare the original view with the filtered panels.