PbrPipeline

from acron.shading import PbrPipeline
class PbrPipeline

Bases:

Bases: TypedReferenceCount

The smallest complete PBR frame, for a game without the frame pipeline: the scene drawn by PbrShaderGenerator into a half-float buffer that follows the window’s size, then a full-screen pass that tonemaps it, encodes it as sRGB (unless the window’s framebuffer does) and dithers.

pipeline = PbrPipeline(base.win, base.cam, render) pipeline.tonemap = PbrPipeline.T_neutral

The constructor installs a PbrShaderGenerator on the window’s GSG (unless it has one), turns on the auto shader below the scene root, and moves every display region of the window that shows the camera onto the post pass; cleanup() (or the destructor) undoes it. The exposure is the PBR shader’s (PhysicalCamera::apply on the scene); the tonemappers are the frame pipeline’s (pbr_tonemap.glsl).

Inheritance diagram

digraph inheritance41aa9b4de5 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PbrPipeline" [URL="acron.shading.PbrPipeline.html#acron.shading.PbrPipeline",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "PbrPipeline" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }
enum Tonemap
enumerator T_clamp = 0
enumerator T_shoulder = 1
enumerator T_neutral = 2
enumerator T_aces = 3
enumerator T_reinhard = 4
__init__()

Sets the pipeline up on a window for the scene below scene, as seen by camera (a Camera’s NodePath). Check is_valid(): without float render targets nothing changes.

property buffer → GraphicsOutput

The buffer the scene is drawn into (RGBA16F colour and depth, the size of the window).

cleanup()

Gives the window’s display regions back to the camera and removes the scene buffer and the post pass. The shader generator stays installed.

property dither → bool
Getter

Whether the post pass adds half an output step of noise against banding (true by default).

Setter

Turns the post pass’s dither on or off.

property generator → PbrShaderGenerator

The PBR shader generator on the window’s GSG.

get_buffer()

The buffer the scene is drawn into (RGBA16F colour and depth, the size of the window).

static get_class_type()
get_dither()

Whether the post pass adds half an output step of noise against banding (true by default).

get_generator()

The PBR shader generator on the window’s GSG.

get_post_camera()

The camera of the post pass, which the window’s display regions show.

get_scene_texture()

The scene’s linear, pre-exposed colour, before the post pass.

get_tonemap()

The display transform of the post pass; T_shoulder by default.

is_valid()

False when the scene buffer could not be made (the driver has no float render targets), or after cleanup().

property post_camera → NodePath

The camera of the post pass, which the window’s display regions show.

property scene_texture → Texture

The scene’s linear, pre-exposed colour, before the post pass.

set_dither()

Turns the post pass’s dither on or off.

set_tonemap()

Picks the display transform of the post pass.

property tonemap → Tonemap
Getter

The display transform of the post pass; T_shoulder by default.

Setter

Picks the display transform of the post pass.

property valid → bool

False when the scene buffer could not be made (the driver has no float render targets), or after cleanup().