Skip to main content

A simple, lightweight PBR render pipeline for Panda3D

Project description

Build Status Panda3D Versions


This is a simple, basic, lightweight, no-frills PBR render pipeline for Panda3D. It is currently intended to be used with panda3d-gltf, which will output textures in the right order. The PBR shader is heavily inspired by the Khronos glTF Sample Viewer. Note: this project does not make an attempt to match a reference renderer.


  • Supports running on a wide range of hardware with an easy OpenGL 2.1+ requirement
  • Forward rendered metal-rough PBR
  • All Panda3D light types (point, directional, spot, and ambient)
  • Filmic tonemapping
  • Normal maps
  • Emission maps
  • Occlusion maps
  • Basic shadow mapping for DirectionalLight and Spotlight

Notable Todos

There are a few big things still missing and are planned to be implemented:

  • Shadow mapping for PointLight
  • IBL Diffuse
  • IBL Specular

Other missing features

The goal is to keep this simple and lightweight. As such, the following missing features are not currently on the roadmap:

  • Something to deal with many lights (e.g., deferred, forward+, tiling, clustering, etc.)
  • Fancy post-process effects (temporal anti-aliasing, ambient occlusion, screen-space reflections)
  • Environment probes


Use pip to install the panda3d-simplepbr package:

pip install panda3d-simplepbr

To grab the latest development build, use:

pip install git+


Just add simplepbr.init() to your ShowBase instance:

from direct.showbase.ShowBase import ShowBase

import simplepbr

class App(ShowBase):
    def __init__(self):


The init() function will choose typical defaults, but the following can be modified via keyword arguments:

render_node : The node to attach the shader too, defaults to base.render if None

window : The window to attach the framebuffer too, defaults to if None

camera_node : The NodePath of the camera to use when rendering the scene, defaults to if None

msaa_samples : The number of samples to use for multisample anti-aliasing, defaults to 4

max_lights : The maximum number of lights to render, defaults to 8

use_normal_maps : Use normal maps to modify fragment normals, defaults to False (NOTE: Requires models with appropriate tangents defined)

use_emission_maps Use emission maps, defaults to True

use_occlusion_maps Use occlusion maps, defaults to False (NOTE: Requires occlusion channel in metal-roughness map)

enable_shadows : Enable shadow map support (breaks with point lights), defaults to False

enable_fog : Enable exponential fog, defaults to False

exposure : a value used to multiply the screen-space color value prior to tonemapping, defaults to 1.0

Those parameters can also be modified later on by setting the related attribute of the simplepbr pipeline returned by the init() function:

        pipeline = simplepbr.init()


        pipeline.use_normals_map = True


The shader currently assumes that the following textures are in these slots:

  1. BaseColor
  2. MetalRoughness
  3. Normals
  4. Emission


For an example application using panda3d-simplepbr check out the viewer in the panda3d-gltf repo.


When using Panda3D's build_apps the data files (i.e., shader files) will not be copied by default. Options are being explored to make this more automatic, but for the time being, add the following to

    # ...
    'package_data_dirs': {
        'simplepbr': [
            ('simplepbr/shaders*', '', {}),
     # ...

Running tests

python test


B3D 3-Clause

Project details

Download files

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

Source Distributions

No source distribution files available for this release. See tutorial on generating distribution archives.

Built Distribution

panda3d_simplepbr-0.7-py3-none-any.whl (11.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page