NEWS.md
render_highquality(joined_stream_mesh = TRUE) builds joined stream meshes faster by clipping to nearby terrain cells and triangulating fragments in batches. #369
plot_gg(flat_legend = TRUE) keeps the legend visible and flat while the data panel retains its relief. #364
generate_point_overlay() accepts a fill color for point symbols 21–25. color controls their outlines, and the fill defaults to transparent. #362
plot_3d() and render_water() keep polygon water from showing through the sides of a solid terrain base where the water meets the map edge.plot_3d() skips isolated DEM samples and one-sample-wide lines surrounded by missing elevations. Only complete grid squares contribute terrain, base walls, and water. A DEM with no complete squares produces an empty scene.plot_3d(soil = TRUE) maps the soil texture correctly along base walls on heightmaps with missing elevations. #365
save_3dprint() includes the bottom of the terrain base when exporting a masked heightmap to STL. #357
save_obj() exports triangle faces from rgl surfaces that store vertices without a face index. #363
convert_path_to_animation_coords() uses 60 frames, and the render_beveled_polygons() examples use 16 samples with denoising to shorten render times. #367
save_png() help shows how to write a 16-bit TIFF directly from an in-memory hillshade with rayimage::ray_write_image(). #360
render_highquality(joined_stream_mesh = TRUE) snaps stream endpoints faster on large networks by skipping paths beyond the snapping distance. #368
sphere_shade() uses less memory when making missing elevations transparent by transposing only the logical mask. #361
detect_water() avoids a redundant pass over the surface normals when identifying flat terrain. #358
master tarball is available from the source-master release. #353
montereybay_spatial |> sphere_shade() |> plot_3d() carries the elevation, extent, and coordinate reference system (CRS) through shading into the scene. Heightmaps can be matrices, terra or raster package objects, or raster filenames. Rayshader infers zscale from cell spacing, including the spacing in meters at the center of a longitude/latitude raster. Use vertical_exaggeration to scale relief independently. Matrix-based workflows and explicit spatial arguments are still supported. The default geographic aspect correction accounts for unequal east-west and north-south cell spacing.plot_3d(), a call such as render_path(roads) can use the scene’s cached terrain, extent, CRS, and vertical scale to transform the roads and place them on the surface. Spatial layers support filtering to the scene extent with filter_to_extent. get_scene_metadata() exposes the coordinate information for the active scene.spatialize_image(). It returns a georeferenced terra::SpatRaster with RGB bands and optional alpha and original elevation bands. generate_raster_overlay() aligns a raster overlay to a map, and resize_spatial() changes raster resolution while preserving extent and CRS.montereybay_spatial, volcano_spatial, and volcano_trails provide elevations and trail geometry for spatial examples. The original montereybay elevation matrix remains available.plot_gg() records how ggplot2 maps data into each panel. Points, paths, buildings, and extruded polygons can now share coordinates and heights with the original plot, including maps drawn with coord_sf(). Use flat_substrate = TRUE for a flat base beneath the 3D geometry.render_polygons() maps a height column through the plot’s height scale. A subset uses the same limits, transformation, binning, and inversion as the full data, including on flat plots with hidden legends. color = "height" also respects nonlinear scales. Supply scale_data for manual scaling or top and bottom for heights in scene units.render_zaxis() adds a vertical axis to terrain and ggplot scenes. Set breaks, labels, and a title in the units of the data being shown. Faceted ggplots retain panel-specific coordinate information for layers and cameras.render_water() and plot_3d() now default to water_render_method = "polygon" for exact polygon footprints. Each part extends from the lowest terrain beneath it to a level surface, preserving islands, small inlets, and exposed walls. Choose "optimized" to fit a lake’s elevation by matching flooded terrain area to its mapped footprint, "raster" for a cell-based shoreline, or "legacy" for the earlier box/grid renderer. Code using the development version’s area-fitting "polygon" method should select "optimized".render_streams() draws streams along the terrain with widths that can vary by feature. Set their units with width_units. render_highquality(joined_stream_mesh = TRUE) can join the stream geometry. For reflected sunlight on rippled water, use water_material = "microfacet" in render_highquality(). The default material is "glassy".add_water() accepts spatial masks such as montereybay_spatial < 0. It checks alignment, preserves the cached elevations, and leaves cells with missing mask values alone. shift_terrain() raises or lowers terrain beneath spatial features by a constant or a per-feature amount, for example to make room for a lake bed.render_roads() builds pavement and lane markings at real-world widths and spacing. It reads OpenStreetMap lane, bridge, and layer attributes and models vertical road profiles from layer ordering, grades, and clearance constraints. Connected ramps meet at junctions even where several roads occupy different levels.terrain_grading = TRUE cuts the terrain beneath roads so that surface junctions can stay near ground level. Later layers use the same graded terrain as the visible scene. render_trails() follows the surface with a fixed width or a width column and a choice of width units.render_people() places posed human figures at geographic locations or along paths. Both model variants stand 1.8 meters tall, and other poses retain their relative proportions. Use simple_rgl = TRUE to preview a crowd as points. High-quality renders share full geometry among people with the same pose, model variant, and material.render_points() and render_path() accept spatial points and lines. render_label() accepts points and multipoints and can label polygons at their centroids, with text from a data column and a choice of font. render_polygons() and render_beveled_polygons() use cached terrain and bounds. render_buildings() places footprints using CRS-aware filtering, height columns, roof angles, and roof materials. render_obj() can place models from spatial point data and repeat a single location at several altitudes. render_tree() accepts a tree-height column and offers a lightweight point preview with preview_simple = TRUE.haze_shade() creates a transparent haze overlay from an exponential atmospheric model. radiance_shade() renders a top-down lighting pass from a DEM, cached shading data, or the active scene. Haze retains the raster’s inferred zscale, extent, and CRS for subsequent calls to plot_3d(). generate_altitude_overlay(relative = TRUE) sets transitions as fractions of the elevation range.plot_3d(earth_curvature = TRUE) bends the terrain relative to the center of its bounding box using a spherical Earth. Vertical exaggeration scales terrain relief independently of curvature. Spatial layers reuse the curvature setting for water, terrain-relative objects, and explicit altitudes. Inspect it with get_scene_metadata()$earth_curvature. It is off by default.plot_3d(normals = FALSE) skips smooth terrain vertex normals and uses face normals in high-quality renders and OBJ exports. Other objects keep their own normals. shadow_texture_size controls the maximum resolution of the blurred base shadow.render_camera() or render_highquality(). High-quality renders also accept explicit orthographic dimensions and per-object-type materials through rgl_materials.render_highquality() a datetime to light a georeferenced scene for its location and time. Depending on the sky model, the sky can include stars, planets, and the Moon’s phase and brightness. For a faceted map, select a panel directly or through a spatial camera target or location. The sky uses that panel’s map bounds and display CRS.text_render = "screen" draws camera-facing labels and annotation lines without casting shadows on the scene. Labels keep their screen size while their anchors follow the map. They appear in the interactive preview. deferred_render = TRUE gives you time to set up the camera before sampling.render_movie_hq() renders camera animations from keyframes. Returned scenes carry their camera, sky, environment, and integrator settings into the movie. With animation overlay support in rayrender, screen-space labels, leader lines, and z-axis ticks are projected and checked for occlusion on each frame.render_highquality(return_scene = TRUE) returns the resolved camera and render defaults. Collect texture assets explicitly with rayrender::write_usd() when exporting. Native sky lighting uses rayrender’s default integrator unless one is supplied.light = TRUE uses infinite disk lights. light_size is the full angular diameter in degrees (default 5), independent of scene size and camera position. Older rayrender versions without disk lights use spherical lights.window_size, base_shape, solid_depth, shadow_color, water_color, water_alpha, water_line_color, water_input, text_size, sun_angle, sun_altitude, normal_vectors, and progress_bar. Legacy spellings passed through ... warn with the replacement name. Passing both spellings raises an error. Established names such as heightmap, hillshade, zscale, filename, linewidth, and camera_lookat keep their spelling. In sphere_shade(), use vertical_exaggeration in place of the deprecated color_intensity.render_zaxis() uses data, location, breaks, labels, title, and styling arguments without the development version’s zaxis_ prefix.%>% or exports run_documentation(). Use R’s native |> for simple pipelines or import %>% from magrittr."rgb(20, 100, 255)", with channels from 0 to 255 and optional whitespace. Named, hexadecimal, and numeric colors retain their behavior.sphere_shade() bounds texture lookups on steep terrain. calculate_normal() returns unit-length edge normals oriented upward at all four corners.geom_spatraster() height layers retain source precision, eliminating 8-bit elevation steps and gaps beneath buildings. Mixed and faceted height layers still use the image-based path. plot_gg() reuses the built height plot so that raster statistics, panel metadata, and the drawn image agree.render_multipolygonz(), render_raymesh(), and render_obj() align absolute-elevation meshes horizontally with points and roads at different values of zscale and vertical exaggeration.fov values and choose a valid up vector for straight-down cameras. Screen-space text matches rgl’s vertical alignment, including top z-axis titles and offsets beyond the text bounds.verbose = TRUE reports conversion and rayrender construction timings.libgeos intersections only for triangles crossing the shoreline. Threads share one terrain snapshot and reuse terrain coverage and missing-data boundaries. options(cores = ...) controls concurrency and parallel = FALSE selects one thread. Diagnostics follow input order. Native terrain sampling preserves water levels, waterlines, and exact terrain intersections.water_surface_tolerance controls clearance for nearly coincident tops. Mixed geometry collections retain polygon parts and their original elevations.add_water() applies matrix and raster masks without horizontally mirroring them.tunnel = "building_passage" stay at ground level unless explicitly marked underground.zscale, with a small precision margin against z-fighting. Graded terrain no longer hides rgl road-line previews.verbose = TRUE reports preparation and solver stages before meshing.render_multipolygonz() and save_multipolygonz_to_obj() preserve concave faces and holes on horizontal, sloping, and vertical surfaces. Ordinary faces are triangulated in native batches. Crossed or overlapping boundaries are repaired in the face plane, and a summary warning identifies faces skipped after triangulation fails or yields zero area. Set options(rayshader.multipolygonz_repair = FALSE) to drop ambiguous intersections. verbose = TRUE reports preparation and upload stages. render_polygons() uses rayvertex::extruded_polygon_mesh() for extrusion.render_tree() defaults to load_normals = FALSE to avoid shading artifacts on low-poly crowns. Set it to TRUE to use the model’s normals. Negative sizes are discarded after converting absolute elevations, keeping each tree’s color, dimensions, and rotation together.render_camera() functionplot_3d() to specify location of viewportna.rm=FALSE bug and add_overlay issue fixedplot_3d to draw NA entries in the elevation matrix as holes in the 3D model. This can be used to slice the model into any shape.plot_3d to include the new base_shape argument, which has several built-in shapes c("circle","hex") to overlay onto a matrix. This removes points in the elevation matrix outside the masked region.line_antialias option to plot_3d to allow the user to turn on antialiasing for the lines in the plot.shadow_exist and remove_water options from save_3dprint to improve robustness. User now has to remove those 3D elements themselves when creating .stl file.add_overlay when the input is a matrixplot_3d with examples.save_png in READMErender_label() function to add text labels to 3D plots.progress_bar arguments to be either FALSE or interactive() by defaultplot_3d
plot_3d
render_depth(), a post-processing effect to add depth of field to 3D maps.render_water(), which either adds or replaces a water layer on the existing 3D map.add_overlay(), which adds a transparent or semi-transparent overlay to the current hillshade.montereybay to mark it as internal data (for better user messages)save_3dprint() to include the option to remove the shadow and water layers.plot_map() no longer crashes R when “rotate” is a matrix rather than a single numeric value.plot_3d() now displays warning if hillshade argument contains any values below 0 or more than 1.plot_3d, a function to take hillshades/textures and visualize them with an elevation matrix in 3D. Includes water visualization and the ability to view the map as a solid object.ray_shade and ambient_shade - Added option to pass arguments to makeCluster function for parallel executionsphere_shade function to apply spherical texture maps to elevation matrices.create_texture function to allow user to programmatically create texture maps by specifying colors.ambient_shade function to calculate ambient occlusion shadow maps.add_shadow function to add shadow to existing shadow matrices/texture arrays.calculate_normal function to pre-calculate normal vectors of elevation matrix for faster spherical shading.detect_water function to automatically detect bodies of water (of a specified size) on an elevation matrix.write_png function to save hillshaded maps to file.plot_map function to parse and plot resulting hillshaded maps.