Examples that use Pygfx

Introductory Examples

Use gfx.show

Use gfx.show

Hello World

Hello World

Render a Triangle

Render a Triangle

Rendering Points

Rendering Points

Boundary Boxes

Boundary Boxes

Lights

Lights

Offscreen Rendering

Offscreen Rendering

Clipping Planes

Clipping Planes

Hello text

Hello text

Orbit Camera

Orbit Camera

Feature Demos

Show STL File via gfx.show

Show STL File via gfx.show

Möbius strip Geometry

Möbius strip Geometry

Subdivision

Subdivision

Use gfx.show to show a Scene

Use gfx.show to show a Scene

Geometry Image

Geometry Image

Show Image

Show Image

Line Drawing Performance

Line Drawing Performance

Geometry Cubes

Geometry Cubes

Rotating Polyhedra

Rotating Polyhedra

Isosurface Volume Rendering

Isosurface Volume Rendering

Minip Volume Rendering

Minip Volume Rendering

Torus knot

Torus knot

Mesh dynamic

Mesh dynamic

Flat Shading

Flat Shading

Line Segments

Line Segments

Point Picking

Point Picking

Volume Slice 1

Volume Slice 1

Transform Control without Matrix Updating

Transform Control without Matrix Updating

Gizmo to transform world objects

Gizmo to transform world objects

Simulating grass with point sprites

Simulating grass with point sprites

Geometry Plane

Geometry Plane

Toon Rendering 1

Toon Rendering 1

Text contrast

Text contrast

Bounding Box Coordinates

Bounding Box Coordinates

Wireframe 1

Wireframe 1

Thick Lines

Thick Lines

Klein Bottle Geometry

Klein Bottle Geometry

Volume Slice 2

Volume Slice 2

Stats helper (Manual)

Stats helper (Manual)

Measure distances in 2D

Measure distances in 2D

Wireframe 2

Wireframe 2

Image with Points Overlaid

Image with Points Overlaid

Use a Skybox

Use a Skybox

Volume Rendering 2

Volume Rendering 2

Volume Slice 3

Volume Slice 3

Physical Color

Physical Color

Panzoom Camera

Panzoom Camera

Fly controller

Fly controller

Instancing

Instancing

Synced Video Rendering

Synced Video Rendering

Color Picking

Color Picking

Directional Shadow 1

Directional Shadow 1

Mesh Slice Material

Mesh Slice Material

Colormap Channels

Colormap Channels

Image with another image overlaid

Image with another image overlaid

Volume Rendering 1

Volume Rendering 1

Displaying an image in a scene

Displaying an image in a scene

Paint to a texture

Paint to a texture

Multiple Fonts

Multiple Fonts

Paint to a texture directly

Paint to a texture directly

Scene Overlay

Scene Overlay

Look At

Look At

Text snake

Text snake

Sphere Geometry

Sphere Geometry

Subplots 1

Subplots 1

Use a Skybox

Use a Skybox

Measure distances in 3D

Measure distances in 3D

Nested Scenes

Nested Scenes

Camera linking 2

Camera linking 2

Skinning Animation

Skinning Animation

Look At (Instanced Mesh)

Look At (Instanced Mesh)

Mesh and Volume Slicing 2

Mesh and Volume Slicing 2

PBR Rendering 1

PBR Rendering 1

Lightmap

Lightmap

Types of Cylinders

Types of Cylinders

Transparency 1

Transparency 1

Camera linking 1

Camera linking 1

Volume and Mesh Slicing 1

Volume and Mesh Slicing 1

Mesh Picking

Mesh Picking

Ambient occlusion

Ambient occlusion

Dynamic Environment Map

Dynamic Environment Map

Morph Targets

Morph Targets

Image Click Events

Image Click Events

Detached Bind Mode

Detached Bind Mode

Directional Shadow 2

Directional Shadow 2

Subplots 2

Subplots 2

Minimal Custom Object

Minimal Custom Object

Transparency 2

Transparency 2

Colormap Image

Colormap Image

Facecap animation with morph targets

Facecap animation with morph targets

Subplots Video

Subplots Video

Labelled Image Grid

Labelled Image Grid

Line plot

Line plot

PBR Rendering 2

PBR Rendering 2

Text waterfall

Text waterfall

Environment Map Effects

Environment Map Effects

Line Drawing

Line Drawing

Mesh with quads

Mesh with quads

Toon Rendering 2

Toon Rendering 2

Skinned Mesh

Skinned Mesh

Map Screen to World

Map Screen to World

Earth

Earth

Depth Material

Depth Material

Colormap Mesh

Colormap Mesh

Animations with glTF

Animations with glTF

Multi-Object Selection

Multi-Object Selection

Simple Custom Object

Simple Custom Object

Spotlights

Spotlights

Spotlight Shadow

Spotlight Shadow

Text align

Text align

Wireframe Material

Wireframe Material

Point Markers with Multiple Colors

Point Markers with Multiple Colors

Custom Object

Custom Object

Audio Visualizer

Audio Visualizer

Validation Examples

Axes Helper 1

Axes Helper 1

Validate transparency with and without bg

Validate transparency with and without bg

Box Geometry

Box Geometry

Axis Helper 2

Axis Helper 2

Text outline always behind text itself

Text outline always behind text itself

Image Material

Image Material

Additive Blending

Additive Blending

Simple Colormap

Simple Colormap

Image on Plane Geometry 1

Image on Plane Geometry 1

Normals on front and back

Normals on front and back

Points with different sizes

Points with different sizes

Depth Overlay 2

Depth Overlay 2

Lines with different thicknesses

Lines with different thicknesses

Depth Overlay 1

Depth Overlay 1

Reference Color

Reference Color

Transparency

Transparency

Text anchor

Text anchor

Validate transparency for the ordered2 blend mode

Validate transparency for the ordered2 blend mode

Validate send_data

Validate send_data

Dashing

Dashing

Light and Shadow

Light and Shadow

Validate Skybox

Validate Skybox

Depth Clipping

Depth Clipping

Validate ruler

Validate ruler

Volume and Volume Slice Rendering

Volume and Volume Slice Rendering

Text justification

Text justification

NDC Coordinates

NDC Coordinates

Text size

Text size

Lines in 2D

Lines in 2D

Validate the grid

Validate the grid

Points drawn with different size_space

Points drawn with different size_space

Mesh Colormaps

Mesh Colormaps

Lines drawn with different thickness_space

Lines drawn with different thickness_space

Culling

Culling

Points with different markers

Points with different markers

Mesh slice

Mesh slice

Other Examples

Note

The examples in this section are not rendered. Typically because they use a backend that is not available on the CI runner.

Showing CPU usage in the title bar

Showing CPU usage in the title bar

Simple Cube with WX

Simple Cube with WX

Simple Cube with Qt

Simple Cube with Qt

GPU selection

GPU selection

Integrate Pygfx in Qt

Integrate Pygfx in Qt

Two Canvases

Two Canvases

Performance of drawing many Lines

Performance of drawing many Lines

Fullscreen Postprocessing 2

Fullscreen Postprocessing 2

Sponza Scene

Sponza Scene

Reactive rendering loop

Reactive rendering loop

Full-Screen Post Processing 1

Full-Screen Post Processing 1

Light Effects

Light Effects

Pytorch Integration

Pytorch Integration

Gallery generated by Sphinx-Gallery