bw logo

Chapter 29. .ppchain

PPChain files are saved from the World Editor's Post Processing editor panel. They describe an entire chain, or a partial chain. By default they are located in the <res>/system/post_processing/chains folder. A .ppchain file has the grammar described below:

<file_name>

  +<Effect>
    +<bypass>           Vector4          </bypass>

    *<PyPhase>
      <name>           string            </name>
      <clearRenderTarget> [true|false]   </clearRenderTarget>
      <material>       material section  </material>
      <renderTarget>   string            </renderTarget>
      <filterQuad>
        [ <PyFilterQuad>
            *<filterTap> Vector4         </filterTap>
          </PyFilterQuad>

        | <PyPointSpriteTransferMesh> </PyPointSpriteTransferMesh>

        | <PyTransferQuad> </PyTransferQuad>

        | <PyVisualTransferMesh>
             <resourceID> string         </resourceID>
          </PyVisualTransferMesh>
        ]
      </filterQuad>
     </PyPhase>

    *<PyCopyBackBuffer>
       <name>           string            </name>
       <renderTarget>   string            </renderTarget>
     </PyCopyBackBuffer>

    *<PlayerFader>
       <name>           string            </name>
       <renderTarget>   string            </renderTarget>
     </PlayerFader>

   </Effect>

</file_name>

Grammar of ppchain file

The list below describes the tags in the ppchain file:

  • Effect

    A .ppchain file consists solely of a list of Effects.

  • bypass

    Set to (0,0,0,0) to bypass an effect, or any non-negative value to enable. This bypass value is often overriden for dynamic control by Python game scripts.

  • PyPhase

    Tag for PyPhase style phase section. A PyPhase is a generic post-processing phase that is used in the majority of circumstances.

    • name

      String identifier for this phase.

    • renderTarget

      The string identifier of the render target to which this phase will render.

    • clearRenderTarget

      Whether or not the render target should be cleared before rendering this phase.

    • material

      Effect Material section, see EffectMaterial section

    • filterQuad

      The filter quad geometry that will be used to render with. See available Filter Quad sections below

  • PyCopyBackBuffer

    Tag for PyCopyBackBuffer style phase section. This type of phase performs a StretchRect copy of the device's back buffer into the render target. When making a copy of the device's back buffer it is preferable to use this phase rather than a generic transfer phase, as the StretchRect operation resolves any hardware antialiasing at this time. Additionally, this phase knows when the back buffer surface has not yet been modified by another phase and will temporarily bypass the operation in this case.

    • name

      String identifier for this phase.

    • renderTarget

      The string identifier of the render target to which this phase will render.

  • PlayerFader

    Tag for PlayerFader style phase section. The PlayerFader works in conjunction with the CursorCamera to fade out the player model when the camera moves forward and intersects with the player's bounding box due to the camera colliding with scene geometry.

    • name

      String identifier for this phase.

    • renderTarget

      The string identifier of the render target to which this phase will render.

  • PyFilterQuad

    Tag for PyFilterQuad style filter quad. This filter quad has an arbitrary number of filter taps, and draws in multiple passes doing 4 taps per pass.

    • filterTap

      Vector4 (uOffset, vOffset, weight, unused).

  • PyPointSpriteTransferMesh

    Tag for PyPointSpriteTransferMesh style filter quad.

  • PyTransferQuad

    Tag for PyTransferQuad style filter quad.

  • PyVisualTransferMesh

    Tag for PyVisualTransferMesh style filter quad.

    • resourceID

      The string identifier of the .visual file with which this phase will render.