PCF Soft-Shadow Architectural Pedestal

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

Exact 900x560 architectural pedestal with box, cylinder, torus and ground plane, one 2048x2048 directional shadow map, 3x3 PCF/bias, and a blue spotlight fill.

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-02-pcf-soft-shadow-pedestal.lms

Source

# B02: procedural pedestal with one 2048 directional map and 3x3 PCF.
mkdir("build");program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38";
let scene=scene3d().threads(4).background("#eaf0f6").ambient(0.04);scene.camera(camera3d().look_at(5.0,3.2,7.0,0.0,0.8,0.0).perspective(40.0,0.1,100.0));
scene.add(mesh_plane(8.0,7.0),material("#d9e0e7",0.0,0.9));scene.add(mesh_box(1.4,0.5,1.4),material("#44798d",0.0,0.7)).position(0.0,0.25,0.0);scene.add(mesh_cylinder(0.5,1.0,32),material("#de9b5d",0.3,0.4)).position(0.0,1.0,0.0);scene.add(mesh_torus(0.7,0.18,20,32),material("#9daab8",0.85,0.25)).position(1.3,0.9,-0.3).rotation(65.0,0.0,0.0);
scene.directional_light(-3.0,5.0,1.0,"#ffffff",3.0).spot_light(4.0,3.0,5.0,-4.0,-2.0,-5.0,"#9ac9ff",35.0,15.0,30.0);scene.shadows(2048,0.00015,0.001,1);
let image=scene.render_image(900,560,2);image_assert_true(image.width()==900&&image.height()==560&&image.stddev(0)>0.05);image.save("build/bench-02-pcf-soft-shadow-pedestal.png");
end _lmcode_
r=run_lmcode(program);assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));

Raw LMScript source

A box, cylinder and torus on a pedestal with soft ground shadows.
Look at the shadow edges and the blue fill light.