Automotive Clearcoat, Metallic Flake & Anisotropy

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 original speed-form hood/fender with visible procedural metallic flake, dual-lobe clearcoat and a separate brushed anisotropic rotor under two CPU area emitters.

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-20-car-paint-anisotropy.lms

Source

# B20 / G.9-G.10 candidate: original speed-form hood, dual-lobe paint and brushed rotor.
mkdir("build"); program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38";
let sky="";for(j in range(0,16)){for(i in range(0,32)){let u=float(i)/31.0;let v=float(j)/15.0;let a=16.0*pow(2.718281828459045,-70.0*(u-0.22)*(u-0.22)-30.0*(v-0.32)*(v-0.32));let b=12.0*pow(2.718281828459045,-70.0*(u-0.72)*(u-0.72)-30.0*(v-0.45)*(v-0.45));if(sky!=""){sky=sky+",";}sky=sky+str(0.5+a+b)+","+str(0.6+a+b)+","+str(0.7+a+b);}}
let studio=environment_linear(32,16,sky);
let scene=scene3d().threads(4).background("#101723").ambient(0.0).environment(studio,0.5,0.0,false).tonemap("aces",0.2);
scene.camera(camera3d().look_at(4.8,2.8,7.5,0.0,0.45,0.0).perspective(38.0,0.1,100.0));
let flake=texture_noise("perlin",2020,34).mix(texture_noise("worley",2021,90),0.35).bake(256,256,"srgb").filter("trilinear");
let car_finish=material("#245fa8",0.82,0.32).albedo(flake).clearcoat(1.0,0.03);
let heights=image_pattern(65,33,"0.15+0.7*(1-(2*x-1)*(2*x-1))*(1-(2*y-1)*(2*y-1))","0.15+0.7*(1-(2*x-1)*(2*x-1))*(1-(2*y-1)*(2*y-1))","0.15+0.7*(1-(2*x-1)*(2*x-1))*(1-(2*y-1)*(2*y-1))","1");
let hood=mesh_heightfield(heights,4.8,2.2,0.7);
scene.add(hood,car_finish).position(-0.5,0.0,0.0);
let grooves=image_pattern(256,256,"0.5+0.08*sin(x*628.318530718)","0.5+0.08*sin(x*628.318530718)","0.5+0.08*sin(x*628.318530718)","1");
let rotor=mesh_cylinder(0.85,0.16,96); let brushed=material("#a9b4c1",0.9,0.30).anisotropy(0.8,0.0).height(grooves,0.25,true);
scene.add(rotor,brushed).position(2.6,0.9,0.0).rotation(90.0,0.0,0.0);
scene.area_light(-2.0,5.5,3.5,0.25,-1.0,-0.35,4.0,1.4,"#fff4dd",24.0,30.0);
scene.area_light(3.0,3.0,2.0,-0.55,-0.45,-0.7,2.0,2.0,"#b7d6ff",14.0,30.0);
scene.area_light(2.6,1.6,4.5,0.0,-0.12,-1.0,1.4,0.6,"#ffffff",18.0,30.0);
let image=scene.render_image(900,560,"cycles",64,8,20261031,true);image_assert_true(image.width()==900&&image.height()==560);image.save("build/bench-20-car-paint-anisotropy.png");
out.print("B20 CPU Cycles 64 spp/OIDN: original speed-form dual-lobe paint + brushed anisotropic rotor");
end _lmcode_
r=run_lmcode(program);assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));

Raw LMScript source

A metallic car-body form beside a brushed rotor.
Compare the clearcoat reflections, metallic flakes and brushed highlights.