File: SVGRenderer.md | Updated: 11/15/2025
This renderer an be used to render geometric data using SVG. The produced vector graphics are particular useful in the following use cases:
SVGRenderer has various advantages. It produces crystal-clear and sharp output which is independent of the actual viewport resolution.SVG elements can be styled via CSS. And they have good accessibility since it's possible to add metadata like title or description (useful for search engines or screen readers).
There are, however, some important limitations:
SVGRenderer is an addon, and must be imported explicitly, see Installation#Addons.
import { SVGRenderer } from 'three/addons/renderers/SVGRenderer.js';
Constructs a new SVG renderer.
Whether to automatically perform a clear before a render call or not.
Default is true.
The DOM where the renderer appends its child-elements.
Provides information about the number of rendered vertices and faces.
The output color space.
Default is SRGBColorSpace.
Number of fractional pixels to enlarge polygons in order to prevent anti-aliasing gaps. Range is [0,1].
Default is 0.5.
Whether to sort elements or not.
Default is true.
Whether to sort 3D objects or not.
Default is true.
Performs a manual clear with the defined clear color.
Returns an object containing the width and height of the renderer.
Returns: The size of the renderer.
Renders the given scene using the given camera.
scene | A scene or any other type of 3D object.
---|---
camera | The camera.
Sets the clear color.
color | The clear color to set.
---|---
Sets the precision of the data used to create a paths.
precision | The precision to set.
---|---
Sets the render quality. Setting to high means This value indicates that the browser tries to improve the SVG quality over rendering speed and geometric precision.
quality | The quality.
---|---
Resizes the renderer to the given width and height.
width | The width of the renderer.
---|---
height | The height of the renderer.