Set Material for All Objects

set_scene_material(scene, material)

Arguments

scene

A ray_scene object.

material

A material specification created by diffuse(), metal(), dielectric(), etc.

Value

A modified ray_scene with the new material applied to all objects

Examples

# Create a scene with different materials
scene = generate_cornell() %>%
  add_object(sphere(x=555/2, y=555/2, z=555/2, radius=100))
  
# Set all objects to be metallic
scene = set_scene_material(scene, metal(color="gold"))

# Set all objects to be glass
scene = set_scene_material(scene, dielectric())