if (FALSE) { # interactive() || identical(Sys.getenv("IN_PKGDOWN"), "true")
#Generate a glossy sphere
generate_ground(material=diffuse(sigma=90)) |>
add_object(sphere(y=0.2,material=glossy(color="#2b6eff"))) |>
add_object(sphere(y=2.8,material=light())) |>
render_scene(parallel=TRUE,clamp_value=10,samples=16,sample_method="sobol_blue")
#Change the color of the underlying diffuse layer
generate_ground(material=diffuse(sigma=90)) |>
add_object(sphere(y=0.2,x=-2.1,material=glossy(color="#fc3d03"))) |>
add_object(sphere(y=0.2,material=glossy(color="#2b6eff"))) |>
add_object(sphere(y=0.2,x=2.1,material=glossy(color="#2fed4f"))) |>
add_object(sphere(y=8,z=-5,radius=3,material=light(intensity=20))) |>
render_scene(parallel=TRUE,clamp_value=10,samples=16,fov=40,sample_method="sobol_blue")
#Change the amount of gloss
generate_ground(material=diffuse(sigma=90)) |>
add_object(sphere(y=0.2,x=-2.1,material=glossy(gloss=1,color="#fc3d03"))) |>
add_object(sphere(y=0.2,material=glossy(gloss=0.5,color="#2b6eff"))) |>
add_object(sphere(y=0.2,x=2.1,material=glossy(gloss=0,color="#2fed4f"))) |>
add_object(sphere(y=8,z=-5,radius=3,material=light(intensity=20))) |>
render_scene(parallel=TRUE,clamp_value=10,samples=16,fov=40,sample_method="sobol_blue")
#Add gloss to a pattern
generate_ground(material=diffuse(sigma=90)) |>
add_object(sphere(y=0.2,x=-2.1,material=glossy(noise=2,noisecolor="black"))) |>
add_object(sphere(y=0.2,material=glossy(color="#ff365a",checkercolor="#2b6eff"))) |>
add_object(sphere(y=0.2,x=2.1,material=glossy(color="blue",gradient_color="#2fed4f"))) |>
add_object(sphere(y=8,z=-5,radius=3,material=light(intensity=20))) |>
render_scene(parallel=TRUE,clamp_value=10,samples=16,fov=40,sample_method="sobol_blue")
#Add an R and a fill light (this may look familiar)
generate_ground(material=diffuse()) |>
add_object(sphere(y=0.2,material=glossy(color="#2b6eff",reflectance=0.05))) |>
add_object(obj_model(r_obj(simple_r = TRUE),
z=-1,y=-0.05,scale=0.45,angle=c(0,180,0),material=diffuse())) |>
add_object(sphere(y=6,z=-1,radius=4,material=light(intensity=3))) |>
add_object(sphere(z=-15,material=light(intensity=50))) |>
render_scene(parallel=TRUE,clamp_value=10,samples=16,sample_method="sobol_blue")
}
Run the code above in your browser using DataLab