rayrender (version 0.4.0)

dielectric: Dielectric (glass) Material

Description

Dielectric (glass) Material

Usage

dielectric(color = "white", refraction = 1.5,
  implicit_sample = FALSE)

Arguments

color

Default `white`. The color of the surface. Can be either a hexadecimal code, R color string, or a numeric rgb vector listing three intensities between `0` and `1`.

refraction

Default `1.5`. The index of refraction.

implicit_sample

Default `TRUE`. If `FALSE`, the object will not be sampled as part of the scattering probability density function.

Value

Single row of a tibble describing the sphere in the scene.

Examples

Run this code
# NOT RUN {
#Generate a checkered ground
scene = generate_ground(depth=-0.5,
                        material=lambertian(color="white", checkercolor="grey30",checkerperiod=2))
# }
# NOT RUN {
render_scene(scene,parallel=TRUE)
# }
# NOT RUN {
#Add a glass sphere
# }
# NOT RUN {
scene %>%
  add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
  render_scene(parallel=TRUE,samples=400)
# }
# NOT RUN {
#Add a rotated colored glass cube
# }
# NOT RUN {
scene %>%
  add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
  add_object(cube(x=0.5,xwidth=0.5,material=dielectric(color="darkgreen"),angle=c(0,-45,0))) %>%
  render_scene(parallel=TRUE,samples=40)
# }
# NOT RUN {
#Add an area light behind and at an angle and turn off the ambient lighting
# }
# NOT RUN {
scene %>%
  add_object(sphere(x=-0.5,radius=0.5,material=dielectric())) %>%
  add_object(cube(x=0.5,xwidth=0.5,material=dielectric(color="darkgreen"),angle=c(0,-45,0))) %>%
  add_object(yz_rect(z=-3,y=1,x=0,zwidth=3,ywidth=1.5,
                     material=lambertian(lightintensity=15),
                     angle=c(0,-90,45), order_rotation = c(3,2,1))) %>%
  render_scene(parallel=TRUE,aperture=0, ambient_light=FALSE,samples=1000)
# }

Run the code above in your browser using DataCamp Workspace