Panda3D SimplePBR

0.13.1 · active · verified Fri Apr 17

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.

Common errors

Warnings

Install

Imports

Quickstart

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()

view raw JSON →