Skip to main content

PyVista and CoDimensional

pyvista-render-passes

SSAA, SSAO, EDL, depth peeling and shadows for PyVista, composed in the one order that works.

PyPI CI MIT license

Marble bust with depth peeling, SSAO, shadows and SSAA

Volume-safe supersampling (SSAA), screen-space ambient occlusion (SSAO), eye-dome lighting (EDL), depth peeling, shadow maps, depth of field and Gaussian blur, driven from plotter.render_passes.

Built and maintained by CoDimensional PBC.

The passes are VTK render passes written in C++ and wrapped for Python. Each wheel carries two builds, one against the stock vtk wheel and one against cvista, and loads the one matching the distribution PyVista is running on.

Install

pip install "pyvista-render-passes[cvista]"  # recommended
pip install "pyvista-render-passes[vtk]"     # stock VTK

Each wheel carries a build for both distributions and loads the one that is installed, preferring cvista when both are; the extra pins the version the build was compiled against. PyVista itself still requires stock vtk, so [cvista] installs both unless the resolver is told otherwise; with uv:

[project]
dependencies = ["pyvista-render-passes[cvista]"]

[tool.uv]
exclude-dependencies = ["vtk"]

or, one-off, uv pip install --excludes <(echo vtk) "pyvista-render-passes[cvista]". See the PyVista install docs for the details and the caveats. Wheels are published for CPython 3.12 to 3.14 on Linux (x86_64, aarch64) and Windows (AMD64), and for macOS (arm64). The macOS wheel carries the cvista build only, since Kitware ships no arm64 wheel SDK; the Windows wheel carries the stock build only, since the cvista wheel's DLL names are mangled and cannot be linked against, so install [vtk] there. The stock build targets VTK 9.7. PYVISTA_VTK_BACKEND=vtk or =cvista forces the choice, as it does for PyVista; pyvista_render_passes.BACKEND reports it.

Quickstart

import pyvista as pv
import pyvista_render_passes  # registers plotter.render_passes

pl = pv.Plotter()
pl.add_mesh(pv.Sphere(radius=8, center=(8, 0, 0)), opacity=0.5)
pl.add_volume(pv.Wavelet(), opacity='sigmoid')
pl.render_passes.enable_depth_peeling().enable_ssao().enable_anti_aliasing()
pl.show()

Every enable_* / disable_* call only records a setting; the chain is rebuilt before the next render. Call apply() to rebuild immediately, or describe() to see what is enabled:

>>> pl.render_passes.describe()
'DepthPeeling(peels=8) → SSAO(r=1.04, derived) → AntiAliasing'

The SSAO radius is derived from the scene bounds unless one is passed to enable_ssao(radius=...).

get_state() / set_state() round-trip the settings as a plain dict, and preset_interactive(), preset_still() and preset_photo_real() set common combinations.

PyVista's example datasets, rendered by scripts/render_gallery.py into docs/images/<example>/off.png and on.png. The angel statue is by Ivan Nikolov (CC BY 4.0); the Washington bust is a Smithsonian CC0 scan.

OffOn
EDL on a lidar point cloud: enable_edl()
SSAO on a CAD enclosure: enable_ssao()
Shadow maps on a statue: enable_shadows()
SSAA on a finite element mesh: enable_anti_aliasing()
Depth peeling on a translucent floor plan: enable_depth_peeling()
EDL annotation bypass keeps the cube axes and orientation axes out of EDL (text and scalar bars always are), on by default; off is disable_annotation_bypass()
CT volume under an opaque slice with SSAA: off is PyVista's enable_anti_aliasing('ssaa'), which draws the volume through the slice; on is enable_anti_aliasing()
preset_photo_real(): peeling, SSAO, shadows, SSAA

Depth of field and Gaussian blur are VTK's passes unchanged and are not shown; depth of field is driver-sensitive.

Subplots

plotter.render_passes is the active subplot's settings, so each subplot gets its own chain:

pl = pv.Plotter(shape=(1, 3))
grid = pv.ImageData(dimensions=(5, 5, 5)).explode(0.2)

pl.subplot(0, 0)
pl.add_mesh(grid)
pl.add_text('plain')

pl.subplot(0, 1)
pl.add_mesh(grid)
pl.add_text('EDL')
pl.render_passes.enable_edl()

pl.subplot(0, 2)
pl.add_mesh(grid)
pl.add_text('SSAO + SSAA')
pl.render_passes.enable_ssao().enable_anti_aliasing()

pl.link_views()
pl.show()

Three linked subplots: plain, EDL, SSAO with SSAA

Eye-dome lighting, blur and depth of field composite over the whole window from inside one subplot in VTK (#18849), which blanks or whitens the others; the chain confines them to their own tile. pl.render_passes.components lists the subplots configured so far.

Passes without the component

The passes are usable directly on any vtkRenderer:

from pyvista_render_passes import enable_ssaa, enable_ssao, make_split_pass

enable_ssaa(pl, factor=2.0)  # SSAA on every renderer of a plotter

pvRenderPassChain builds the whole graph from a set of flags; pvSSAAVolumePass supersamples while keeping GPU volumes correct; pvPropKeyFilterPass renders a delegate over a tagged subset of the props (used to keep axes and other annotations out of EDL). See docs/design.md for the reasoning behind the chain.

Your own passes in the chain

A package with a pass of its own registers a provider on the plotter and the component composes it into the chain at one of three seams: 'translucent' replaces the translucent stage (and takes over depth peeling), 'base' wraps the scene base below SSAO, 'post' wraps the shaded frame below SSAA.

from pyvista_render_passes import register_pass_provider


@register_pass_provider(pl)
class ToneMapping:
    stage = 'post'

    def build_pass(self, renderer, chain, delegate):
        return vtkToneMappingPass()


@register_pass_provider(pl, stage='base')
def splat_points(renderer, chain, delegate):
    return make_point_splat_pass(delegate)


register_pass_provider(pl, ToneMapping())  # or an instance, directly

build_pass runs on every rebuild; the component releases what it returns. 'base' providers receive the pass they must wrap as delegate and nest in registration order. unregister_pass_provider(pl, ...) takes the same object the registration did.

Why a chain

VTK's render passes compose by delegation: each pass renders its delegate and post-processes the result. The order they are nested in decides whether they work at all, and a few pairs do not compose. plotter.render_passes owns that order so callers only set flags. Innermost first:

Stage Setting Where it sits and why
Lights, opaque, translucent, volumetric always The scene base. Laid out flat rather than through vtkRenderStepsPass, whose own camera pass clears the buffers and would erase anything rendered ahead of it.
Shadow maps enable_shadows() Replace the opaque stage, so opaque geometry is drawn once, with shadows. Needs a scene light away from the camera; the default headlight casts none.
Dual depth peeling enable_depth_peeling() Replaces the translucent stage, but only when another pass is on. Alone, the renderer's built-in peeling is used and no pass is installed at all.
SSAO enable_ssao() Directly above the opaque base. SSAO reads the positions and normals of the props its delegate renders; put above a pass that composites through a full-screen quad (EDL, blur) it sees nothing and does nothing. Translucent props and volumes render after it, over the shaded opaque scene: inside its delegate, dual depth peeling paints translucent geometry with its normals.
EDL enable_edl() Above SSAO. With annotation bypass (the default), tagged props (axes, cube axes, legend scales) render in a second stage after EDL, so their lines are not read as depth discontinuities and painted dark; 2D text and scalar bars sit in the overlay stage and never pass through EDL.
Depth of field, Gaussian blur enable_dof(), enable_blur() Colour post-processing over the shaded frame.
SSAA enable_anti_aliasing() Outermost scene pass: supersamples everything below and resolves colour and depth to the window. Point and line widths are scaled to stay visually constant. Also installed at 1x under EDL, blur and depth of field, which otherwise wipe the other subplots (VTK #18849).
Overlay always Last, at the window: text, scalar bars, legends and point labels are drawn after every pass has resolved, at window resolution. Point labels test against the window depth, which inside a pass's framebuffer is a frame stale and makes them flicker (pyvista #4831).

Rules the component enforces or warns about:

Combination Result
SSAO + depth of field Refused: enable_ssao() and enable_dof() raise ValueError while the other is on.
MSAA + any custom pass Warning; MSAA has no effect once the scene renders into a pass's framebuffer. Use SSAA.
MSAA + depth peeling Warning; multisampling corrupts the depth buffer peeling relies on.
Shadows + EDL Warning; the annotation stage has no shadow-map pass, so annotations are not shadowed.
FXAA Turned off on every apply; SSAA replaces it.
SSAO + translucency Translucent props and volumes are not occlusion-shaded; they composite over the SSAO-shaded opaque scene.
SSAO radius A world-space length, so it is derived from the visible bounds unless passed to enable_ssao(radius=...); get_state() reports a derived one as None.

Pixel correctness

The test suite runs on software GL (llvmpipe) in CI against both distributions and checks the state machine, the chain graph, the lifecycle, the prop filter and rendered pixels. The pixel tests assert measured properties (coverage, thickness, occlusion, depth) rather than comparing against image baselines, so none are shipped.

Development

just sync         # fetch the VTK wheel SDK, build both variants, install with the dev extras
just test vtk     # pytest against stock VTK
just test cvista  # pytest against cvista
just lint         # pre-commit

A C++17 compiler and CMake are required. cvista-sdk supplies the headers and CMake config for the cvista build; scripts/fetch_vtk_sdk.py downloads Kitware's wheel SDK for the stock build into build/vtk-sdk/. Without that SDK the package still builds, carrying the cvista variant only.

The passes themselves are backend-neutral C++; pyvista_render_passes.backend_module('vtkRenderingOpenGL2') returns the active distribution's module for code that needs VTK classes without choosing one.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvista_render_passes-0.1.2.tar.gz (3.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyvista_render_passes-0.1.2-cp314-cp314-win_amd64.whl (94.1 kB view details)

Uploaded CPython 3.14Windows x86-64

pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (203.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (199.1 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

pyvista_render_passes-0.1.2-cp313-cp313-win_amd64.whl (92.5 kB view details)

Uploaded CPython 3.13Windows x86-64

pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (203.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (199.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

pyvista_render_passes-0.1.2-cp312-cp312-win_amd64.whl (92.5 kB view details)

Uploaded CPython 3.12Windows x86-64

pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (203.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (199.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ ARM64manylinux: glibc 2.28+ ARM64

pyvista_render_passes-0.1.2-cp312-abi3-macosx_11_0_arm64.whl (90.8 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file pyvista_render_passes-0.1.2.tar.gz.

File metadata

  • Download URL: pyvista_render_passes-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pyvista_render_passes-0.1.2.tar.gz
Algorithm Hash digest
SHA256 70024c18d8b4889970aa2e38fbe6c2cee2c9146674dea332b2c4f90a7f6d64bc
MD5 98ead4e06858de5d7aee0ca4295a9378
BLAKE2b-256 a254ddaef3e60d3730a4be2feb2ff087f08e4eab2251eecae14dc7ac1be3d221

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2.tar.gz:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 a82d5e30c71813dd167654071d0ec1f2ebebf13a97be4a6a0bd6bd3d878710ba
MD5 5f7fd49cb7e20dd18dd0a1060d90519d
BLAKE2b-256 74cc1bbce4730a44b8d7ffb2ddeea5b5837995d7e034fa66e3464983d1b03e78

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp314-cp314-win_amd64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a43dd8910fcf9db7f3bf7723b245342a7c4ed57a921fc33200ca36982538e0ad
MD5 66980002cf23c6536d6f96c74ee378cf
BLAKE2b-256 8239e7cf2ae5c4fcbf045371d6474cd8226def2882f3f37595788b2efce3344c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b1a5aa6a63d3e9d47f9180ab703a76e6b954c3be9d6cd8a6a83e1618748fb2fa
MD5 9cc5c1b07f0ab2164a3379f1613b2908
BLAKE2b-256 0c857928f03ab005834a977fdcadaa1694439089c20cf3fa1e06a4d2d129e520

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1dcbcbe6ab6bf271342ceb6c392452f6eb7ff42847247e7df25efb5647c34262
MD5 b2b7a9912e8f4bfdd6c9124df1b1a86a
BLAKE2b-256 b6ce5e799891f4854d73fcc1b551ce27c5ffe2f771c3a1a5103f9943504cfd5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp313-cp313-win_amd64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91a8219b606f41198f1134486be423477a0431e3f6993a9ebebcb7f8de2040b4
MD5 45b66630fc3e4db7eb37dc42645cc5b1
BLAKE2b-256 f383a90d0e2d127983b7322eaef43a6d28c4845926b1110bd632a4ed28ed6b4b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fc70a0be5af971dd23bdd32aa8c6e887f7402d5ab6b50ce4797eeb6a4b05a125
MD5 16113b0ed041b70f22d75cb5445b0dc5
BLAKE2b-256 aee09ef3903b6ff006603255434c68d0c54e8de9531675069900bc43626398f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f2e68ef03f2909f26d832f822484642bb5d36e6e8a19f369fe979437182a6549
MD5 f2f70b876768a78e8f94116358e8e883
BLAKE2b-256 7dea29a2cce9b006a654e0adf4255b4a4c3415b8f1a3e96aab2a8dfdbd17ed93

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp312-cp312-win_amd64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1357bad072d8e9acd31b08813a43bfec6bdf7777dde73bb65d0c156467ff0c56
MD5 93351009f82bf3b73e2f8df8f2dcd3f4
BLAKE2b-256 892a34cbd53ab83574b7fd7773a33dd9d0f0f15253657431e660847ac840bc65

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 29042fb7461cc4c370218a10f792e98e609ab874068f19a19b352e088eb31e73
MD5 f0046d5b836b6572c67c999055690952
BLAKE2b-256 661ddc13f37ea13efe8615c1a0a990de2cafeae60b8cc86d514f429f5a1a61fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvista_render_passes-0.1.2-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.2-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0828880226009efe82c2d6f3306cf9ace259c22e69ff8beb0535d07fce60b35
MD5 1761e3fad843da6d74a66be807d5abab
BLAKE2b-256 5253c534e83a54382b2d79e7d47ce47d300b8ca1ea7134fbe0ace414e8e0e2a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.2-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on codimensional/pyvista-render-passes

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.0

11 files

This release

0.1.2 This release

11 files

0.1.1

8 files

0.1.0

8 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page