Registry / ai-ml / panda3d-simplepbr

panda3d-simplepbr

JSON →
library0.13.1pypypi✓ verified 84d ago

Panda3D SimplePBR (version 0.13.1) is a lightweight, drop-in Physically Based Rendering (PBR) shader system for Panda3D. It provides a visual upgrade over Panda3D's default auto shader with minimal code changes, making it easy to integrate PBR workflows. The project is actively maintained with a steady release cadence addressing bug fixes and feature enhancements.

pip install panda3d-simplepbr
INSTALL
IMPORT
SIG · PANDA3D-SIMPLEPBR
P
panda3d-simplepbr
ai-mlpythonv0.13.1
Install
4.6s avg
Import
157ms
Disk
189MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.13.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 4.6s · import 0.157s · 188MB
189MB installed
● package 189MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

simplepbr
import simplepbr
from panda3d.simplepbr import init
simplepbr is a top-level package, not part of panda3d's namespace.
init
simplepbr.init()
from simplepbr import create_simplepbr
`create_simplepbr` was an older function name; `init()` is the current and recommended entry point.

This quickstart initializes a basic Panda3D scene, loads a default model, and then enables SimplePBR with `simplepbr.init()`. It also sets up minimal lighting required for PBR to function, demonstrating how SimplePBR integrates seamlessly with Panda3D's existing lighting system.

from direct.showbase.ShowBase import ShowBase from panda3d.core import DirectionalLight, AmbientLight, VBase4 import simplepbr # Standard Panda3D ShowBase setup base = ShowBase() base.camLens.setNearFar(0.1, 1000.0) # Initialize SimplePBR - this is the core step simplepbr.init() # Load a test model (Panda3D's default smiley) smiley = base.loader.loadModel('smiley') smiley.reparentTo(base.render) smiley.setPos(0, 5, 0) smiley.setHpr(0, 90, 0) # Add a directional light dlight = DirectionalLight('dlight') dlight.setColor(VBase4(0.8, 0.8, 0.8, 1)) dlnp = base.render.attachNewNode(dlight) dlnp.setHpr(0, -60, 0) base.render.setLight(dlnp) # Add some ambient light alight = AmbientLight('alight') alight.setColor(VBase4(0.2, 0.2, 0.2, 1)) alnp = base.render.attachNewNode(alight) base.render.setLight(alnp) base.run()
Debug
Known issues
breakingThe `simplepbr.get_shader()` function was removed. The shader is now applied globally to `base.render` by `simplepbr.init()`.
fix
Replace `shader = simplepbr.get_shader()` followed by `np.setShader(shader)` with a single call to `simplepbr.init()` after `ShowBase` is initialized. Shader inputs should now be set on the `NodePath`s directly or `base.render`.
affects: 0.12.0 and newer
breakingShader input names for PBR textures changed from snake_case to camelCase (e.g., `metallic_map` became `metallicMap`).
fix
Update any custom `NodePath.setShaderInput()` calls to use the new camelCase naming convention for PBR texture inputs (e.g., `np.setShaderInput('metallicMap', texture)`).
affects: 0.8.0 and newer
gotchaSimplePBR requires Python 3.9 or newer and Panda3D 1.10.13 or newer. Using older versions will lead to installation errors or runtime issues.
fix
Ensure your Python environment is `Python >= 3.9` and your Panda3D installation is `Panda3D >= 1.10.13`. Upgrade Panda3D with `pip install --upgrade panda3d` if necessary.
affects: All versions 0.9.0 and newer
gotchaApplying other shaders to `base.render` or its ancestors after `simplepbr.init()` can lead to conflicts or unexpected rendering results, as SimplePBR sets a global shader.
fix
If you need to apply different shaders to specific objects, apply them directly to those objects' `NodePath`s rather than to `base.render`. For global post-processing effects, consider using Panda3D's post-processing framework or integrating it carefully with SimplePBR's setup.
affects: All versions
Errors
Common errors & fixes
AttributeError: module 'simplepbr' has no attribute 'get_shader'
Attempting to call `simplepbr.get_shader()` in SimplePBR versions 0.12.0 or newer.
fix
Remove the call to `get_shader()`. Instead, call `simplepbr.init()` once after initializing `ShowBase`. SimplePBR will automatically apply its shader to `base.render`.
TypeError: 'NodePath' object is not callable
This often occurs if `simplepbr.init()` is called before the Panda3D `ShowBase` instance (usually `base`) is fully set up, or if `base` is not accessible.
fix
Ensure `base = ShowBase()` is executed and `base` is in scope before calling `simplepbr.init()`.
Shader compilation error: GLSL: '...' : undeclared identifier
A generic shader error indicating an issue with the GLSL code. This can be due to an outdated Panda3D version, unsupported graphics drivers, or incorrect shader inputs.
fix
Update your Panda3D installation (`pip install --upgrade panda3d`). Ensure your graphics drivers are up to date. Verify that any custom `setShaderInput` calls use the correct input names as expected by SimplePBR (refer to documentation for specific versions).
KeyError: 'metallic_map' (or 'roughness_map', 'normal_map', etc.)
You are using old shader input names (snake_case) with SimplePBR versions 0.8.0 or newer, which expect camelCase input names.
fix
Change the shader input names from snake_case to camelCase. For example, `setShaderInput('metallic_map', texture)` should become `setShaderInput('metallicMap', texture)`.
Upgrade
Version history
0.13.1latest on PyPI · released Mar 30, 2025
Audit
Dependencies
panda3drequiredCore rendering engine; SimplePBR is a shader system built on Panda3D.
Agent activity
23 hits · last 30 days
node
20
Bingbot
3
Resources
panda3d-simplepbr — pip install panda3d-simplepbr · libregistry