Pass:blit
EditCopies data between textures. Similar to Pass:copy
, except the source and destination sizes can be different. The pixels from the source texture will be scaled to the destination size. This can only be called on a transfer pass, which can be created with lovr.graphics.getPass
.
Pass:blit(src, dst, srcx, srcy, srcz, dstx, dsty, dstz, srcw, srch, srcd, dstw, dsth, dstd, srclevel, dstlevel, filter)
Arguments
Name | Type | Default | Description |
src | Texture | The texture to copy from. | |
dst | Texture | The texture to copy to. | |
srcx | number | 0 | The x offset from the left of the source texture to blit from, in pixels. |
srcy | number | 0 | The y offset from the top of the source texture to blit from, in pixels. |
srcz | number | 1 | The index of the first layer in the source texture to blit from. |
dstx | number | 0 | The x offset from the left of the destination texture to blit to, in pixels. |
dsty | number | 0 | The y offset from the top of the destination texture to blit to, in pixels. |
dstz | number | 1 | The index of the first layer in the destination texture to blit to. |
srcw | number | nil | The width of the region in the source texture to blit. If nil, the region will extend to the right side of the texture. |
srch | number | nil | The height of the region in the source texture to blit. If nil, the region will extend to the bottom of the texture. |
srcd | number | nil | The number of layers in the source texture to blit. |
dstw | number | nil | The width of the region in the destination texture to blit to. If nil, the region will extend to the right side of the texture. |
dsth | number | nil | The height of the region in the destination texture to blit to. If nil, the region will extend to the bottom of the texture. |
dstd | number | nil | The number of the layers in the destination texture to blit to. |
srclevel | number | 1 | The index of the mipmap level in the source texture to blit from. |
dstlevel | number | 1 | The index of the mipmap level in the destination texture to blit to. |
filter | FilterMode | linear | The filtering algorithm used when rescaling. |
Returns
Nothing
Notes
When blitting between 3D textures, the layer counts do not need to match, and the layers will be treated as a continuous axis (i.e. pixels will be smoothed between layers).
When blitting between array textures, the layer counts must match, and the blit occurs as a sequence of distinct 2D blits layer-by-layer.
See also
Pass