{"id":10018,"library":"panda3d-simplepbr","title":"Panda3D SimplePBR","description":"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.","status":"active","version":"0.13.1","language":"en","source_language":"en","source_url":"https://github.com/Moguri/panda3d-simplepbr","tags":["panda3d","pbr","shader","rendering","graphics"],"install":[{"cmd":"pip install panda3d-simplepbr","lang":"bash","label":"Install stable release"}],"dependencies":[{"reason":"Core rendering engine; SimplePBR is a shader system built on Panda3D.","package":"panda3d","optional":false}],"imports":[{"note":"simplepbr is a top-level package, not part of panda3d's namespace.","wrong":"from panda3d.simplepbr import init","symbol":"simplepbr","correct":"import simplepbr"},{"note":"`create_simplepbr` was an older function name; `init()` is the current and recommended entry point.","wrong":"from simplepbr import create_simplepbr","symbol":"init","correct":"simplepbr.init()"}],"quickstart":{"code":"from direct.showbase.ShowBase import ShowBase\nfrom panda3d.core import DirectionalLight, AmbientLight, VBase4\nimport simplepbr\n\n# Standard Panda3D ShowBase setup\nbase = ShowBase()\nbase.camLens.setNearFar(0.1, 1000.0)\n\n# Initialize SimplePBR - this is the core step\nsimplepbr.init()\n\n# Load a test model (Panda3D's default smiley)\nsmiley = base.loader.loadModel('smiley')\nsmiley.reparentTo(base.render)\nsmiley.setPos(0, 5, 0)\nsmiley.setHpr(0, 90, 0)\n\n# Add a directional light\ndlight = DirectionalLight('dlight')\ndlight.setColor(VBase4(0.8, 0.8, 0.8, 1))\ndlnp = base.render.attachNewNode(dlight)\ndlnp.setHpr(0, -60, 0)\nbase.render.setLight(dlnp)\n\n# Add some ambient light\nalight = AmbientLight('alight')\nalight.setColor(VBase4(0.2, 0.2, 0.2, 1))\nalnp = base.render.attachNewNode(alight)\nbase.render.setLight(alnp)\n\nbase.run()","lang":"python","description":"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."},"warnings":[{"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`.","message":"The `simplepbr.get_shader()` function was removed. The shader is now applied globally to `base.render` by `simplepbr.init()`.","severity":"breaking","affected_versions":"0.12.0 and newer"},{"fix":"Update any custom `NodePath.setShaderInput()` calls to use the new camelCase naming convention for PBR texture inputs (e.g., `np.setShaderInput('metallicMap', texture)`).","message":"Shader input names for PBR textures changed from snake_case to camelCase (e.g., `metallic_map` became `metallicMap`).","severity":"breaking","affected_versions":"0.8.0 and newer"},{"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.","message":"SimplePBR requires Python 3.9 or newer and Panda3D 1.10.13 or newer. Using older versions will lead to installation errors or runtime issues.","severity":"gotcha","affected_versions":"All versions 0.9.0 and newer"},{"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.","message":"Applying 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Remove the call to `get_shader()`. Instead, call `simplepbr.init()` once after initializing `ShowBase`. SimplePBR will automatically apply its shader to `base.render`.","cause":"Attempting to call `simplepbr.get_shader()` in SimplePBR versions 0.12.0 or newer.","error":"AttributeError: module 'simplepbr' has no attribute 'get_shader'"},{"fix":"Ensure `base = ShowBase()` is executed and `base` is in scope before calling `simplepbr.init()`.","cause":"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.","error":"TypeError: 'NodePath' object is not callable"},{"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).","cause":"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.","error":"Shader compilation error: GLSL: '...' : undeclared identifier"},{"fix":"Change the shader input names from snake_case to camelCase. For example, `setShaderInput('metallic_map', texture)` should become `setShaderInput('metallicMap', texture)`.","cause":"You are using old shader input names (snake_case) with SimplePBR versions 0.8.0 or newer, which expect camelCase input names.","error":"KeyError: 'metallic_map' (or 'roughness_map', 'normal_map', etc.)"}]}