acron.pbr

Physically based shading for a game, in one call.

A thin layer over the engine’s native module (acron.shading; the manual is acron/src/shading/doc/index.rst):

from acron import hdri, pbr
from acron.shading import PhysicalCamera

pipeline = pbr.init(physical_camera=PhysicalCamera(16, 1 / 125, 100),
                    ibl=hdri.load_env("sky.hdr"), tonemap="shoulder")

# lit by acron.sky's Environment (and, made after its FramePipeline,
# drawn into the pipeline's targets):
pipeline = pbr.init(environment=env)

init() installs a PbrShaderGenerator on the window’s GSG and turns the auto shader on below the scene root, and – unless an acron.pipeline.FramePipeline already draws the camera, or post_process=False – builds a PbrPipeline: the camera draws into a half-float buffer and a full-screen pass tonemaps, sRGB-encodes and dithers it into the window. It returns a Pipeline.

The laws simplepbr was patched for are the native shader’s own: the windowed inverse-square falloff, ambient light through the diffuse lobe only, and the frame pipeline’s tonemappers (pbr_tonemap.glsl). Light cookies (simplepbr’s light_projector patch) come after the first native release. simplepbr’s init keywords raise a TypeError naming their replacement (REMOVED).