Generate a material properties list.

material_list(
  diffuse = c(0.8, 0.8, 0.8),
  ambient = c(0, 0, 0),
  specular = c(1, 1, 1),
  transmittance = c(0, 0, 0),
  emission = c(0, 0, 0),
  shininess = 50,
  ior = 1,
  dissolve = 1,
  illum = 1,
  texture_location = "",
  normal_texture_location = "",
  bump_texture_location = "",
  specular_texture_location = "",
  ambient_texture_location = "",
  emissive_texture_location = "",
  diffuse_intensity = 1,
  bump_intensity = 1,
  specular_intensity = 1,
  emission_intensity = 1,
  ambient_intensity = 1,
  culling = "back",
  type = "diffuse",
  translucent = TRUE,
  toon_levels = 5,
  toon_outline_width = 0.05,
  toon_outline_color = "black",
  reflection_intensity = 0,
  reflection_sharpness = 1,
  two_sided = FALSE
)

Arguments

diffuse

Default c(0.5,0.5,0.5). The diffuse color.

ambient

Default c(0,0,0). The ambient color.

specular

Default c(1,1,1). The specular color.

transmittance

Default c(0,0,0). The transmittance

emission

Default c(0,0,0). The emissive color.

shininess

Default 50.0. The shininess exponent.

ior

Default 1.0. The index of refraction. If this is not equal to 1.0, the material will be refractive.

dissolve

Default 1.0. The transparency.

illum

Default 1.0. The illumination.

texture_location

Default "". The diffuse texture location.

normal_texture_location

Default "". The normal texture location.

bump_texture_location

Default "". The bump texture location.

specular_texture_location

Default "". The specular texture location.

ambient_texture_location

Default "". The ambient texture location.

emissive_texture_location

Default "". The emissive texture location.

diffuse_intensity

Default 1. The diffuse intensity.

bump_intensity

Default 1. The bump intensity.

specular_intensity

Default 1. The specular intensity.

emission_intensity

Default 1. The emission intensity.

ambient_intensity

Default 1. The ambient intensity.

culling

Default "back". The culling type. Options are back, front, and none.

type

Default "diffuse". The shader type. Options include diffuse,phong,vertex, and color.

translucent

Default FALSE. Whether light should transmit through a semi-transparent material.

toon_levels

Default 5. Number of color breaks in the toon shader.

toon_outline_width

Default 0.05. Expansion term for model to specify toon outline width.

toon_outline_color

Default black. Toon outline color.

reflection_intensity

Default 0.0. Intensity of the reflection of the environment map, if present. This will be ignored if the material is refractive.

reflection_sharpness

Default 1.0. Sharpness of the reflection, where lower values have blurrier reflections. Must be greater than zero and less than one.

two_sided

Default FALSE. Whether diffuse materials should be two sided (normal is taken as the absolute value of the dot product of the light direction and the normal).

Value

List of material properties.

Examples

if(run_documentation()) {
mat_prop = material_list(diffuse="purple", type="phong", shininess = 20,
                        ambient="purple", ambient_intensity=0.3,
                        specular = "red", specular_intensity=2)
                        
p_sphere = sphere_mesh(position=c(555/2,555/2,555/2), 
                      radius=40,material=mat_prop)
                      
rasterize_scene(p_sphere, light_info=directional_light(direction=c(0.1,0.6,-1)))
}
#> Setting `lookat` to: c(277.50, 277.50, 277.50)