Skip to main content

filly

filly is a Python 3D renderer for glTF scenes, built on Google Filament.

Filly can load a glTF model, light it, pose it, and render it. You get the result as a NumPy image, or filly draws it into an OpenGL texture that your own window shows. Your program keeps control of the window and of frame timing, so filly fits into applications that already own a display loop, such as PsychoPy experiments or pyglet, moderngl, and zengl programs.

A wooden playground horse rocking on its spring, rendered with filly

"Wooden Playground Horse" by Batuhan13, CC BY 4.0. See attribution.

Install

filly is not on PyPI yet. Build it from source.

It needs Python 3.10 or later, Windows or Linux on x86_64, and an OpenGL 4.1 driver. On Linux, offscreen rendering works without a display. macOS is not supported at this time.

Render an image

import filly
from PIL import Image  # only to save the image

with filly.Renderer() as renderer:
    scene = renderer.create_scene()
    horse = scene.load("examples/assets/wooden_playground_horse.glb")
    horse.apply_animation(0, 1.25) # a pose from its spring animation

    camera = scene.create_camera()
    camera.set_perspective(fov_y=30, near=0.1, far=100)
    camera.frame(horse, direction=(-1, -0.3, -1), aspect=800 / 600)
    scene.camera = camera
    scene.add_directional_light(direction=(-1, -1, -2), intensity=100_000)

    target = renderer.create_render_target(width=800, height=600)
    renderer.render(scene, target)
    Image.fromarray(target.read()).save("horse.png") # (600, 800, 4) uint8 RGBA

Draw in a PsychoPy window

filly renders into a texture that PsychoPy draws directly, with no copy through the CPU.

from psychopy import core, visual
from filly.integrations.psychopy import SharedTarget, create_renderer

win = visual.Window((1024, 768), units="pix")
renderer = create_renderer(win) # shares the window's OpenGL context
scene = renderer.create_scene()
horse = scene.load("examples/assets/wooden_playground_horse.glb")
camera = scene.create_camera()
camera.set_perspective(fov_y=30, near=0.1, far=100)
camera.frame(horse, aspect=1)
scene.camera = camera
scene.add_directional_light(direction=(-1, -1, -2), intensity=100_000)

target = SharedTarget(renderer, win, 512, 512)
stim = target.as_psychopy_texture() # an ImageStim
clock = core.Clock()
while clock.getTime() < 3:
    horse.apply_animation(0, clock.getTime())
    renderer.render(scene, target)
    stim.draw()
    win.flip()

target.close()
renderer.close()
win.close()

Close the target, then the renderer, then the window. The same pattern works with a pyglet, moderngl, or zengl window.

Features

  • glTF 2.0: GLB and glTF files, skinning, morph targets, animation, material variants, and the common material extensions, such as clearcoat, sheen, transmission, and iridescence. See asset compatibility.
  • Cameras and lights: perspective and orthographic cameras, camera framing, and directional, sun, point, and spot lights with optional shadows. Image-based lighting comes from an HDR panorama or prefiltered KTX files.
  • Stimuli from arrays: textures and meshes from NumPy arrays, updated in place each frame, for gratings, noise, or deforming shapes.
  • Predictable output: sRGB (default) or linear. Effects such as antialiasing, fog, and bloom are off until you enable them. With default settings, the same scene gives the same pixels on every frame.
  • Several views per frame: each render() call can take its own camera and viewport, for example for side-by-side stereo.
  • Browsers: the same core compiles to WebAssembly for WebGL2. It renders into a texture that the page's own renderer draws, such as PIXI in PsychoJS. See the web build.

Examples

See the examples/ folder.

Example Shows
screenshot.py The animation above (--gif), or a still image, rendered offscreen.
psychopy_shared.py A model in a PsychoPy window. Pass your own GLB path.
pyglet_shared.py, moderngl_shared.py, zengl_shared.py The same in other OpenGL hosts.
drifting_grating.py A texture updated every frame on a tilted plane.
stereo.py Two cameras side by side in one window.
shapes.py Generated and deforming meshes.

Documentation

License

filly is released under the MIT License.

It links Filament (Apache 2.0), meshoptimizer (MIT), libwebp (BSD), and cgltf (MIT). Their licenses are installed with the package. The sample model filly.samples.SUZANNE is modified from Suzanne by Norbert Nopper (UX3D), from the Khronos glTF Sample Assets, under CC0 1.0.

Metadata

Release files for filly 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for filly 0.1.0
File Size Uploaded
filly-0.1.0.tar.gz 5.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for filly 0.1.0
File
filly-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
filly-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 abi3 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
filly-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
filly-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
filly-0.1.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
filly-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details

Total release size: 22.9 MB

Release files / filly-0.1.0.tar.gz

Download URL filly-0.1.0.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
f919c6874f271d55044aea92c13d0a909185ce0cec15d1a54bd7d98f49ad824b
BLAKE2b-256 checksum
How to use checksums
1936191ab7012cee67cf802a051c59109dda0cdaee96de79a8ca54a608adaa51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp312-abi3-win_amd64.whl

Download URL filly-0.1.0-cp312-abi3-win_amd64.whl
Size 3.1 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
aa341090a0f7ac33ed0fa437a116349e55fa494f8c96af38b775f10cdbe7255e
BLAKE2b-256 checksum
How to use checksums
7205fca0c24c814c0406271ad148e4d241a31e1e4cbb83021964259882b257b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL filly-0.1.0-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
baa0a37fa00ae01ad6ba7f90ab2a2832189d4c9073d826189900cccc25cc7f7b
BLAKE2b-256 checksum
How to use checksums
efe3896efd180543f6441fcc64e264f26df4ef325d6861b8680694fbdd52ecc9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp311-cp311-win_amd64.whl

Download URL filly-0.1.0-cp311-cp311-win_amd64.whl
Size 3.1 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
705a25123c12911bbfc50b21dc2d4504f25188193e71cdb88cedece093e76a9b
BLAKE2b-256 checksum
How to use checksums
c4601c67461f85ee0858a1474f18824875ea15a9c3b391cbd39476a28d76a523
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL filly-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
eabe6e47a65543e3f9d81b575ee8aafe9fc3472c2e9f8daee08398fb5b11f700
BLAKE2b-256 checksum
How to use checksums
52fd53eee622717c8c256309315702b183b88686f536c45ca83cf121b4114206
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp310-cp310-win_amd64.whl

Download URL filly-0.1.0-cp310-cp310-win_amd64.whl
Size 3.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
da28e26c693ff86127d05f85b7f87ca9d738f76fda1b9c8474157744abfc5e5b
BLAKE2b-256 checksum
How to use checksums
13461f69da4f4184e4d418e48453d23e3fac5770669cda6ea7fea2691591fe95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release files / filly-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL filly-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c5952054d4a277e12fcb65120395cdcc5f42035df4124f2b9a33026c058f540d
BLAKE2b-256 checksum
How to use checksums
8df6c93b5abc62ee9e4dced5d51a1f4a3ca36f0a39726cf59a00c3871009fb14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

7 release files

This release

0.1.0 This release

7 release 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