Add an Infinite Light
add_infinite_light(scene, light, name = NULL, replace = FALSE)Scene to modify.
Light created with infinite_light(), sky_light(), sky_light_image(),
sun_light(), or moon_light().
Default NULL. Optional name overriding the light's name.
Default FALSE. Replace an existing light with the same name.
A modified scene.
scene = generate_ground(depth = -1, material = diffuse("grey40")) |>
add_object(sphere(material = diffuse("coral"))) |>
add_infinite_light(sky_light_image(
elevation = 30, azimuth = 120, resolution = 512, name = "daylight"
))
render_scene(scene, lookfrom = c(0, 1, -6), lookat = c(0, 0, 0),
aperture = 0, fov = 35, samples = 32, iso = 5)