directional_light | R Documentation |
Generate Directional Lights
directional_light(direction = c(0, 1, 0), color = "white", intensity = 1)
direction |
Default |
color |
Default |
intensity |
Default |
A matrix representing the light information.
if(run_documentation()) {
#Add a light to scene (manually specify the light automatically added to the Cornell Box
lights = point_light(position=c(555/2,450,555/2),
falloff_quad = 0.0, constant = 0.0002, falloff = 0.005)
generate_cornell_mesh(light=FALSE) |>
rasterize_scene(light_info = lights)
#Add a directional light
lights_d = add_light(lights, directional_light(direction=c(1,1.5,-1)))
generate_cornell_mesh(light=FALSE) |>
rasterize_scene(light_info = lights_d)
#Change the intensity and color
lights_d = add_light(lights,
directional_light(direction=c(1,1.5,-1),color="orange", intensity=0.5))
generate_cornell_mesh(light=FALSE) |>
rasterize_scene(light_info = lights_d)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.