Mesh warping

Since 3.5.0

It is possible to apply an arbitrary warping mesh to distort the final image using a PFM (portable float map) file.

The file format is rather simple, and is described here. The file contains an array of NxM 3-component pixels in RGB (grayscale not supported). Each position contains the mapped resulting location in UV, in the R and G components respectively, in [0,1]. The geometry warp format is the same as in the MPCDI v2.0 specification, section 3.6.2 (see here).

This file is read and converted into a mesh by Gaia Sky. The mesh is used to distort the final image at the end of the rendering pipeline.

In order to specify a PFM warping mesh file, you need to edit the configuration file of Gaia Sky and add a few lines in the postprocess section:

postprocess:
  [...]
  warpingMesh:
    pfmFile: /path/to/your/warping-mesh.pfm

A few warping mesh examples (big endian) are provided below:

  • Identitywarp-identity.pfm – identity function, x=x,y=y.

  • Flip Xwarp-invert-x.pfm – flips the X coordinate, x=1x,y=y.

  • Flip Ywarp-invert-y.pfm – flips the Y coordinate, x=x,y=1y.

  • Flip XYwarp-invert-xy.pfm – flips the X and Y coordinates, x=1x,y=1y.

  • X^2warp-x2.pfm – applies a square function to X, x=x2,y=y.

  • X^2, Y^2warp-x2y2.pfm – applies a square function to X and Y, x=x2,y=y2.