RenderingOptions

RenderingOptions

is an option for Style, Cell and related constructs that specifies options related to 3D rendering.

Details

  • The typical usage is RenderingOptions->{opt1->val1,opt2->val2,}.
  • The following suboptions can be specified:
  • "3DRenderingEngine"Automaticplatform for 3D scene rendering
    "3DRenderingMethod"Automaticpreferred rendering methodology
    "DepthPeelingLayers"8number of layers to split the scene into
    "HardwareAntialiasingQuality"1.specifies the level of anitialiasing for scene
    "LegacyAlphaChannelMethod"Falsemethod for generating transparency
    "ShowFrameRateCounter"Falsewhether to show the 3D frame rate in the window title bar
  • "3DRenderingEngine" specifies the rendering engine for 3D graphics. The following values may be given:
  • Automaticautomatically determine the best rendering engine
    "Direct3D"use the system's Direct3D driver, available only on Windows systems
    "Mesa"use the bundled Mesa implementation of OpenGL, available on all systems
    "Metal"use the system's Metal driver, available only on macOS systems
    "OpenGL"use the system's OpenGL driver, available only on non-Windows systems
  • When the specified rendering engine is not available for your system, the best available rendering engine will automatically be used instead.
  • "3DRenderingMethod" is used to determine how to sort polygons and render transparency. The following values may be given:
  • Automaticautomatically determine the best rendering method based upon the graphic's contents and the available rendering hardware and drivers
    "HardwareDepthBuffer"use a hardware depth buffer; the projected depth and draw order determine the outcome; this method is the fastest, but will not render transparency correctly
    "HardwareDepthPeeling"use hardware acceleration to blend the layers of a scene by depth from front to back; this renders transparency correctly but requires multiple render passes
    "HardwareSinglePassDepthSorting"use hardware to sort the rasterized fragments of a scene from front to back for correct transparency rendering; only requires a geometry pass and a single render pass; exclusive to OpenGL with suitable hardware
    "BSPTree"sort polygons in software by splitting them at their intersections and inserting them into a BSP tree; this method is slow, but can be used without modern graphical hardware and is free of Zfighting artifacts
    "BSPTreeOrDepthBuffer"use a BSP tree for graphics containing transparency and the hardwarebased depth buffer for all other graphics
    "2DProjection"use the BSP tree, but apply camera projection and clipping in software
  • When the 3D rendering method is using depth peeling, "DepthPeelingLayers" specifies the number of layers the 3D scene is rendered into before the final image is composed.
  • "HardwareAntialiasingQuality" maps the range [0, 1] to the number of antialiasing samples used to render a scene. Which antialiasing sample rate is chosen for a given value is dependent on the particular rendering hardware and driver.
  • The global setting of "HardwareAntialiasingQuality" corresponds to the Antialiasing Quality slider located in the Appearance Graphics pane of the Preferences dialog.
  • "LegacyAlphaChannelMethod" specifies how transparency is generated when rasterizing an expression. By default, the system renders the graphic into a 3D rendering context to compute the alpha channel. "LegacyAlphaChannelMethod"->True instead creates two images with different background colors and computes the alpha channel by comparing the pixels of each image.
  • "ShowFrameRateCounter"->True will add text to the window's title bar indicating the current frame rate. The number is updated periodically as 3D graphics are re-rendered, either via interactive rotation or through animation.
  • "ShowFrameRateCounter" may be set on notebooks, but is ignored when set on cells or individual Style constructs.

Examples

open allclose all

Basic Examples  (1)

Use Mesa to render the scene:

Applications  (2)

Nearly coplanar polygons may be rendered inconsistently by default rendering methods:

Using a BSP tree, while slower, produces more predictable sorting of polygons:

The default rendering of opacity may clip objects that are behind too many other objects in 3D graphics:

Rendering can be improved by increasing the depth peeling layers:

Alternatively, the graphic can be rendered using a BSP tree, which is slower but has no layer limit:

Wolfram Research (1999), RenderingOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/RenderingOptions.html (updated 2020).

Text

Wolfram Research (1999), RenderingOptions, Wolfram Language function, https://reference.wolfram.com/language/ref/RenderingOptions.html (updated 2020).

CMS

Wolfram Language. 1999. "RenderingOptions." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/RenderingOptions.html.

APA

Wolfram Language. (1999). RenderingOptions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RenderingOptions.html

BibTeX

@misc{reference.wolfram_2024_renderingoptions, author="Wolfram Research", title="{RenderingOptions}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RenderingOptions.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_renderingoptions, organization={Wolfram Research}, title={RenderingOptions}, year={2020}, url={https://reference.wolfram.com/language/ref/RenderingOptions.html}, note=[Accessed: 22-November-2024 ]}