Add an Infinite Light

add_infinite_light(scene, light, name = NULL, replace = FALSE)

Arguments

scene

Scene to modify.

light

Light created with infinite_light(), sky_light(), sky_light_image(), sun_light(), or moon_light().

name

Default NULL. Optional name overriding the light's name.

replace

Default FALSE. Replace an existing light with the same name.

Value

A modified scene.

Examples

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)