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 for macOS (arm64) with the cvista build only, since Kitware ships no arm64 wheel SDK. Windows wheels wait on a cvista release whose DLL names the extension can link against. 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.1.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.1-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.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (199.0 kB view details)

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

pyvista_render_passes-0.1.1-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.1-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.1-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.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl (198.9 kB view details)

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

pyvista_render_passes-0.1.1-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.1.tar.gz.

File metadata

  • Download URL: pyvista_render_passes-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 17e28ca0ddb406ef7f3d65e1d8b7dc751571916cb1951ef618a2ab352e27d4e3
MD5 f697ef5fdaaffbf958937de166c1f336
BLAKE2b-256 3891c9bb6425629b6af5bb77995a1a847a01fcfb60b43655f8f70084d50fa91a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1.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.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp314-cp314-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 07fa96d66a37ce07fa5f58d0350fd3a797f9f7d4c6cb5c490e521b2227370394
MD5 eadcea27f1b450f1dc15b5fd062c1c35
BLAKE2b-256 785dcb98a6a05cd83f84d07e633e415024f1365d8aac564bbde3c01240ce1ad2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp314-cp314-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 81821fe916e7b81e6bc01c31bd00fdda2df8cf357c89b04b961f4e3d1c39aa13
MD5 1d882ba0f154ea5eb54f6f3c5984be0a
BLAKE2b-256 c71a6eccae95e8786b263d25f75c4d86b29e0566f7ade4573666878aa469e81b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 121a2e761c982d45a3e2dcb6b99f406a66a05855fc9d0a1e214c44513b453b41
MD5 03632ee31eb794ae1a31173a80463be5
BLAKE2b-256 761c670b583048de3db553fe02d97bec3dd9d1125e41db57dc3e66e0e0af0e3f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp313-cp313-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8f3454d85fec5c7c3bc02c406587383654daf89eccbd8edc6a8533597cd18619
MD5 c96cde8055ec00e8f2c8496eec3b0ab4
BLAKE2b-256 400e6bf3dc2ed4341b661fa0fec2e92d92f06c2a7ae79f9688eb72d28a1f932d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9e1e804e36f5bae46bec6797dc2eb6fbcf50f062f0a21b443eef0820ef092421
MD5 c1a2115eca7580785b0d73a051055d7e
BLAKE2b-256 3de82a3f6c0c650501cd211bcf5579c12feddb55fb26a5c2d67f8daf94bfec9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 705ed1d6eccc973632b6c9b8b5b19d1b9a7971246bb77c77677baf23f05e3336
MD5 50cf5c4649c66e94bd03c65a1875c61a
BLAKE2b-256 4a910b086c9759a9566dc346a3a6cf58badcadd445dd8728a27c20fa9c05acce

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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.1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyvista_render_passes-0.1.1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e06a6f110954118532c07938c92cf34cf818e10855bb691fbe54292dd28f5724
MD5 497eb9c60be962c96150f2f138bc37b8
BLAKE2b-256 00e801a7f46590f92b8350598f9eac84e78f2e9adc34185c9ecd57c0a4fab165

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvista_render_passes-0.1.1-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

0.1.2

11 files

This release

0.1.1 This release

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