Pass:blit

Copies 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.

Pass:blit(src, dst, srcx, srcy, srcz, dstx, dsty, dstz, srcw, srch, srcd, dstw, dsth, dstd, srclevel, dstlevel, filter)

Arguments

NameTypeDefaultDescription
srcTexture The texture to copy from.
dstTexture The texture to copy to.
srcxnumber0 The x offset from the left of the source texture to blit from, in pixels.
srcynumber0 The y offset from the top of the source texture to blit from, in pixels.
srcznumber1 The index of the first layer in the source texture to blit from.
dstxnumber0 The x offset from the left of the destination texture to blit to, in pixels.
dstynumber0 The y offset from the top of the destination texture to blit to, in pixels.
dstznumber1 The index of the first layer in the destination texture to blit to.
srcwnumbernil The width of the region in the source texture to blit. If nil, the region will extend to the right side of the texture.
srchnumbernil The height of the region in the source texture to blit. If nil, the region will extend to the bottom of the texture.
srcdnumbernil The number of layers in the source texture to blit.
dstwnumbernil 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.
dsthnumbernil The height of the region in the destination texture to blit to. If nil, the region will extend to the bottom of the texture.
dstdnumbernil The number of the layers in the destination texture to blit to.
srclevelnumber1 The index of the mipmap level in the source texture to blit from.
dstlevelnumber1 The index of the mipmap level in the destination texture to blit to.
filterFilterModelinear 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