Glossy Material

glossy(
color = "white",
gloss = 1,
reflectance = 0.05,
microfacet = "tbr",
checkercolor = NA,
checkerperiod = 3,
noise = 0,
noisephase = 0,
noiseintensity = 10,
noisecolor = "#000000",
image_texture = NA,
image_repeat = 1,
alpha_texture = NA,
bump_texture = NA,
roughness_texture = NA,
bump_intensity = 1,
roughness_range = c(1e-04, 0.2),
roughness_flip = FALSE,
importance_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.

gloss

Default 0.8. Gloss of the surface, between 1 (completely glossy) and 0 (rough glossy). Can be either a single number, or two numbers indicating an anisotropic distribution of normals (as in microfacet()).

reflectance

Default 0.03. The reflectivity of the surface. 1 is a full mirror, 0 is diffuse with a glossy highlight.

microfacet

Default tbr. Type of microfacet distribution. Alternative option beckmann.

checkercolor

Default NA. If not NA, determines the secondary color of the checkered surface. Can be either a hexadecimal code, or a numeric rgb vector listing three intensities between 0 and 1.

checkerperiod

Default 3. The period of the checker pattern. Increasing this value makes the checker pattern bigger, and decreasing it makes it smaller

noise

Default 0. If not 0, covers the surface in a turbulent marble pattern. This value will determine the amount of turbulence in the texture.

noisephase

Default 0. The phase of the noise. The noise will repeat at 360.

noiseintensity

Default 10. Intensity of the noise.

noisecolor

Default #000000. The secondary color of the noise pattern. Can be either a hexadecimal code, or a numeric rgb vector listing three intensities between 0 and 1.

Default NA. If not NA, creates a secondary color for a linear gradient between the this color and color specified in color. Direction is determined by gradient_transpose.

Default FALSE. If TRUE, this will use the v coordinate texture instead of the u coordinate texture to map the gradient.

Default NA. If not NA, this changes the behavior from mapping texture coordinates to mapping to world space coordinates. This should be a length-3 vector specifying the x,y, and z points where the gradient begins with value color.

Default NA. If not NA, this changes the behavior from mapping texture coordinates to mapping to world space coordinates. This should be a length-3 vector specifying the x,y, and z points where the gradient begins with value gradient_color.

Default hsv. Colorspace to calculate the gradient. Alternative rgb.

image_texture

Default NA. A 3-layer RGB array or filename to be used as the texture on the surface of the object.

image_repeat

Default 1. Number of times to repeat the image across the surface. u and v repeat amount can be set independently if user passes in a length-2 vector.

alpha_texture

Default NA. A matrix or filename (specifying a greyscale image) to be used to specify the transparency.

bump_texture

Default NA. A matrix, array, or filename (specifying a greyscale image) to be used to specify a bump map for the surface.

roughness_texture

Default NA. A matrix, array, or filename (specifying a greyscale image) to be used to specify a roughness map for the surface.

bump_intensity

Default 1. Intensity of the bump map. High values may lead to unphysical results.

roughness_range

Default  c(0.0001, 0.2). This is a length-2 vector that specifies the range of roughness values that the roughness_texture can take.

roughness_flip

Default FALSE. Setting this to TRUE flips the roughness values specified in the roughness_texture so high values are now low values and vice versa.

importance_sample

Default FALSE. If TRUE, the object will be sampled explicitly during the rendering process. If the object is particularly important in contributing to the light paths in the image (e.g. light sources, refracting glass ball with caustics, metal objects concentrating light), this will help with the convergence of the image.

Value

Single row of a tibble describing the glossy material.

Examples

# \donttest{
#Generate a glossy sphere
generate_ground(material=diffuse(sigma=90)) %>%
render_scene(parallel=TRUE,clamp_value=10,samples=256,sample_method="sobol_blue")

#Change the color of the underlying diffuse layer
generate_ground(material=diffuse(sigma=90)) %>%
render_scene(parallel=TRUE,clamp_value=10,samples=256,fov=40,sample_method="sobol_blue")

#Change the amount of gloss
generate_ground(material=diffuse(sigma=90)) %>%
render_scene(parallel=TRUE,clamp_value=10,samples=256,fov=40,sample_method="sobol_blue")

generate_ground(material=diffuse(sigma=90)) %>%