R语言rayrender包,glossy光滑的材料

R语言rayrender包,glossy光滑的材料

# Thu Jul 01 01:44:17 2021 -

# 字符编码:UTF-8
# R 版本:R x64 4.1 for window 10
# [email protected]
# 个人笔记不负责任,拎了个梨
#.rs.restartR()
require(rayrender)
rm(list = ls());gc()

?   glossy  #   光滑的材料


#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=500)

#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=500,fov=40)

#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=500,fov=40)

#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=500,fov=40)

#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(),z=1,y=-0.05,scale_obj=0.45,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=500)

image.png

image.png

image.png

image.png

你可能感兴趣的:(R语言rayrender包,glossy光滑的材料)