| render_options | R Documentation |
Create render options
render_options(
width = 800L,
height = 600L,
shading = c("smooth", "flat"),
backface_culling = TRUE,
background_color = c(0, 0, 0, 0),
default_color = c(0.7, 0.7, 0.7, 1),
invert_normals = FALSE,
wireframe = FALSE,
wireframe_color = c(0, 0, 0, 1),
projection = c("perspective", "orthographic"),
specular_color = c(0, 0, 0, 0),
shininess = 0,
lights = NULL,
ambient = 0.3,
contrast = 1,
fog_enabled = FALSE,
fog_start = 0,
fog_end = 1,
fog_color = c(0, 0, 0, 0),
threads = 0L,
clip_planes = NULL,
ssao_enabled = FALSE,
ssao_radius = 16,
ssao_intensity = 0.8,
aa_samples = 1L
)
width |
Output image width in pixels. |
height |
Output image height in pixels. |
shading |
Shading mode: |
backface_culling |
Whether to cull back-facing triangles. |
background_color |
Background RGBA color as numeric vector of length 4 (values 0-1). |
default_color |
Default vertex color when no colors are provided. |
invert_normals |
Whether to invert surface normals. |
wireframe |
Whether to render in wireframe mode. |
wireframe_color |
RGBA color for wireframe edges (0-1
scale). Default |
projection |
Projection type: |
specular_color |
Specular highlight color (0-1 scale). When
|
shininess |
Specular exponent controlling highlight sharpness.
Higher values produce a tighter spot. Typical values: 32 (soft
plastic), 64 (shiny), 128 (glass). Default |
lights |
A list of light descriptors, each a list with
|
ambient |
Ambient light contribution (0-1). Default 0.3. |
contrast |
Contrast adjustment applied after shading, before
uint8_t conversion. Default 1.0 (no change). Values > 1.0 produce
darker darks and lighter highlights (S-curve). Formula:
|
fog_enabled |
Enable depth cueing (fog). Default |
fog_start |
Z-depth where fog begins (0 = near plane, 1 = far plane). Default 0. |
fog_end |
Z-depth where fog is fully opaque. Default 1. |
fog_color |
RGBA fog colour (0-1 scale). Defaults to
|
threads |
Number of render threads. 0 = auto-detect (use all cores), 1 = single-threaded (deterministic). Default 0. Requires OpenMP at compile time. |
clip_planes |
A list of clip plane descriptors, each a list
with |
ssao_enabled |
Enable screen-space ambient occlusion.
Default |
ssao_radius |
Screen-space sample radius in pixels. Default 16. |
ssao_intensity |
Occlusion strength (0-1). Default 0.8. |
aa_samples |
Anti-aliasing supersampling factor. Renders
internally at |
A render options list for use with render_mesh() or
render_scene().
# Default options
opts <- render_options()
# High-resolution with anti-aliasing and specular highlights
opts <- render_options(width = 1200, height = 900,
aa_samples = 2L,
specular_color = c(0.4, 0.4, 0.4, 1),
shininess = 64)
# Wireframe with transparent background
opts <- render_options(wireframe = TRUE,
wireframe_color = c(0, 0, 0, 1),
background_color = c(0, 0, 0, 0))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.