Package: panda3d-simplepbr
panda3d-simplepbrA straight-forward, easy-to-use PBR render pipeline forPanda3D.
This project aims to be a drop-in replacement for Panda3D's auto-shader.
The PBR shader is heavily inspired by theKhronos glTF Sample Viewer.Note:this project does not make an attempt to match a reference renderer.FeaturesSupports running on a wide range of hardware with an easy OpenGL 2.1+ requirementForward rendered metal-rough PBRAll Panda3D light types (point, directional, spot, and ambient)Filmic tonemappingNormal mapsEmission mapsOcclusion mapsBasic shadow mapping for DirectionalLight and SpotlightPost-tonemapping color transform via a lookup table (LUT) textureIBL diffuse and specularInstallationUse pip to install thepanda3d-simplepbrpackage:pipinstallpanda3d-simplepbrTo grab the latest development build, use:pipinstallgit+https://github.com/Moguri/panda3d-simplepbr.gitUsageJust addsimplepbr.init()to yourShowBaseinstance:fromdirect.showbase.ShowBaseimportShowBaseimportsimplepbrclassApp(ShowBase):def__init__(self):super().__init__()simplepbr.init()Theinit()function will choose typical defaults, but the following can be modified via keyword arguments:render_node: The node to attach the shader too, defaults tobase.renderifNonewindow: The window to attach the framebuffer too, defaults tobase.winifNonecamera_node: The NodePath of the camera to use when rendering the scene, defaults tobase.camifNonemsaa_samples: The number of samples to use for multisample anti-aliasing, defaults to 4max_lights: The maximum number of lights to render, defaults to 8use_normal_maps: Use normal maps to modify fragment normals, defaults toFalse(NOTE: Requires models with appropriate tangents defined)use_emission_maps: Use emission maps, defaults toTrueuse_occlusion_maps: Use occlusion maps, defaults toFalse(NOTE: Requires occlusion channel in metal-roughness map)enable_shadows: Enable shadow map support, defaults toTrueenable_fog: Enable exponential fog, defaults to Falseexposure: a value used to multiply the screen-space color value prior to tonemapping, defaults to 1.0use_330: Force shaders to use GLSL version 330 (ifTrue) or 120 (ifFalse) or auto-detect ifNone, defaults toNoneuse_hardware_skinning: Force usage of hardware skinning for skeleton animations or auto-detect ifNone, defaults toNonesdr_lut: Color LUT to use post-tonemappingsdr_lut_factor: Factor (from 0.0 to 1.0) for how much of the LUT color to mix in, defaults to 1.0env_map: AnEnvMapor cubemap texture path to use for IBL, defaults toNoneThose parameters can also be modified later on by setting the related attribute of the simplepbr Ripeline returned by the init() function:pipeline=simplepbr.init()...pipeline.use_normals_map=TrueTexturessimplepbr expects the following textures are assigned to the following texture stages:BaseColor - ModulateMetalRoughness - SelectorNormals - NormalEmission - EmissionExampleFor an example application usingpanda3d-simplepbrcheck out theviewerin thepanda3d-gltf repo.Running TestsFirst installpanda3d-simplepbrin editable mode along withtestextras:pipinstall-e.[test]Then run the test suite withpytest:pytestBuilding WheelsInstallbuild:pipinstall--upgradebuildand run:python-mbuildLicenseB3D 3-Clause