# B05: analytic UV relief under a moving/grazing key; compare flat and height-normal paths. mkdir("build");program=_lmcode_ cli="lmvideo" install="github:lmctl-ai/lmvideo@v0.1.38"; let height=image_pattern(256,256,"0.5+0.16*sin(x*26)*cos(y*23)+0.08*cos(x*51+y*17)","0.5+0.16*sin(x*26)*cos(y*23)+0.08*cos(x*51+y*17)","0.5+0.16*sin(x*26)*cos(y*23)+0.08*cos(x*51+y*17)","1");let quad=mesh_cylinder(1.45,0.12,96);let scene=scene3d().threads(4).background("#eaf0f6").ambient(0.025);scene.camera(camera3d().look_at(0.0,0.0,4.8,0.0,0.0,0.0).perspective(38.0,0.1,20.0));let mat=material("#bd7a3f",0.25,0.48);let node=scene.add(quad,mat).rotation(90.0,0.0,0.0);scene.point_light(3.0,0.35,1.0,"#fff4d6",35.0,20.0);let flat=scene.render_image(900,560,2);node.material(mat.copy().height(height,0.24,true));let relief=scene.render_image(900,560,2);image_assert_true(flat.rgba()!=relief.rgba()&&relief.width()==900&&relief.height()==560&&relief.stddev(0)>0.04);relief.save("build/bench-05-tangent-relief-medallion.png"); let moved=scene3d().threads(4).background("#eaf0f6").ambient(0.025);moved.camera(camera3d().look_at(0.0,0.0,4.8,0.0,0.0,0.0).perspective(38.0,0.1,20.0));moved.add(quad,mat.copy().height(height,0.24,true)).rotation(90.0,0.0,0.0);moved.point_light(-3.0,0.35,1.0,"#fff4d6",35.0,20.0);image_assert_true(moved.render_image(900,560,2).rgba()!=relief.rgba());out.print("Moving the grazing point light changes relief while flat/perturbed normals differ."); end _lmcode_ r=run_lmcode(program);assert(r.ok,(r.ok ? "" : r.message));println(json_stringify(r.result));