Skip to content

Quilt

The quilt is the format Looking Glass uses to store light fields in sets of views as common 2D images.

Views start in the lower left corner, with view 0 being the leftmost view. The views are then added to the right and then up, in a grid, like so:

In some cases the views do not fill up the entirety of the quilt; for example, you might need a quilt size that is a power of two, but have an odd number of rows or columns. The resulting empty space pads out the top and right of the quilt image, as shown in gray above.

The HoloPlay API creates a quilt texture in hp_initialize(). View textures are added to the quilt by calling hp_copyViewToQuilt(). After the views have all been copied to the quilt, use hp_drawLightfield() to process the quilt into a light field image and draw it to the Looking Glass.

Common Formats

There are two formats commonly used: standard and hires. Standard is smaller and easier to record and stream. Hires is used for mostly for realtime rendering. Custom quilt formats can be used as well with hp_setupCustomQuiltSettings().

Standard
- width: 2048
- height: 2048
- viewWidth: 512
- viewHeight: 256
- columns: 4
- rows: 8
- numViews: 32

Hires
- width: 4096
- height: 4096
- viewWidth: 819
- viewHeight: 455
- columns: 5
- rows: 9
- numViews: 45

Properties

Name Type Description
qs_width unsigned int Total width of the quilt texture
qs_height unsigned int Total height of the quilt texture
qs_viewWidth unsigned int Width of each individual view
qs_viewHeight unsigned int Height of each individual view
qs_columns unsigned int Number of columns in the quilt
qs_rows unsigned int Number of rows in the quilt
qs_numViews unsigned int The total number of views in the quilt. Note that this number might be lower than rows * columns
hp_quiltTexture unsigned int The OpenGL texture of the HoloPlay API's internal quilt. This is the texture that is bound and drawn by hp_drawLightfield()

Functions

Name Description
hp_setupQuiltSettings Sets up the HoloPlay API's internal quilt settings according to the preset passed, and passes the quilt settings to the light field shader
hp_setupCustomQuiltSettings Sets up the HoloPlay API's internal quilt settings with custom values passed as args, and passes the quilt settings to the light field shader
hp_setupQuiltTexture Sets up the HoloPlay API's internal quilt settings with custom values passed as args, and passes the quilt settings to the light field shader
hp_copyViewToQuilt Copies the currently bound glTexture to the specified view on the quilt