lovr.graphics.newPass

Edit

Creates and returns a new Pass object. The canvas (the set of textures the Pass renders to) can be specified when creating the Pass, or later using Pass:setCanvas.




Create a pass that renders to a set of textures.

Arguments

NameTypeDescription
...texturesTexture One or more textures the pass will render to. This can be changed later using Pass:setCanvas.

Returns

NameTypeDescription
passPass The new Pass.

Create a pass, with extra canvas settings.

Arguments

NameTypeDefaultDescription
canvastable Render target configuration. Up to 4 textures can be provided in table keys 1 through 4, as well as the following keys:
.depthtable Depth/stencil buffer settings. In addition to a table, it can be a Texture, a TextureFormat, or false to disable the depth buffer.
.formatTextureFormat'd32f' The format of the depth buffer texture, which must be a depth format (the ones that start with d). LÖVR will create or reuse an internal depth buffer with this format.
.textureTexture A Texture to use as the depth buffer. Takes precedence over format.
.samplesnumber4 The number of multisamples to use. Can be 4 for antialiasing, or 1 to disable antialiasing.

Returns

NameTypeDescription
passPass The new Pass.

Create an empty Pass without a canvas.

Arguments

None

Returns

NameTypeDescription
passPass The new Pass.

Notes

Fun facts about render passes:

See also