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
)
Default c(0.5,0.5,0.5)
. The diffuse color.
Default c(0,0,0)
. The ambient color.
Default c(1,1,1)
. The specular color.
Default c(0,0,0)
. The transmittance
Default c(0,0,0)
. The emissive color.
Default 50.0
. The shininess exponent.
Default 1.0
. The index of refraction. If this is not equal to 1.0
, the material will be refractive.
Default 1.0
. The transparency.
Default 1.0
. The illumination.
Default ""
. The diffuse texture location.
Default ""
. The normal texture location.
Default ""
. The bump texture location.
Default ""
. The specular texture location.
Default ""
. The ambient texture location.
Default ""
. The emissive texture location.
Default 1
. The diffuse intensity.
Default 1
. The bump intensity.
Default 1
. The specular intensity.
Default 1
. The emission intensity.
Default 1
. The ambient intensity.
Default "back"
. The culling type. Options are back
, front
, and none
.
Default "diffuse"
. The shader type. Options include diffuse
,phong
,vertex
, and color
.
Default FALSE
. Whether light should transmit through a semi-transparent material.
Default 5
. Number of color breaks in the toon shader.
Default 0.05
. Expansion term for model to specify toon outline width.
Default black
. Toon outline color.
Default 0.0
. Intensity of the reflection of the environment map, if present. This will be ignored if the material is refractive.
Default 1.0
. Sharpness of the reflection, where lower values have blurrier reflections. Must be greater than zero and less than one.
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).
List of material properties.
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)