ReadTextureSubBuffer Data Member Function

Reads a sub-section of an <Image> back from the GPU.

Prototype

int32 ReadTextureSubBuffer( Image p_oImage, Texture p_oTex, int32 p_nLevel, Int32Vector p_nOffset, Int32Vector p_nDims )

Parameters

Parameter Type Parameter Name Documentation
<Image>p_oImageA pointer to the destination <Image>.
<Texture>p_oTexA pointer to the <Texture> that has been bound to the GPU.
int32p_nLevelThe MIP map level to read.
<Int32Vector>p_nOffsetA pointer to a <Int32Vector> object where components 0, 1, and 2 store the read offset along X, Y, and Z. For example: to read a 64×64 sub-image of a 256×256 <Texture> starting at the pixel (3, 4), set the [0] and [1] component of this vector to (3, 4). Then set the set the [0] and [1] components of the dimension vector to (64, 64). The [3] component of this vector is not used.
<Int32Vector>p_nDimsA pointer to a <Int32Vector> object where components 0, 1, and 2 store the width, height, and depth of the read. The depth value, which is stored in component [2], should usually be 1. For example: to read a 64×64 sub-image of a 256×256 <Texture> starting at the pixel (3, 4), set the [0] and [1] component of the offset vector to (3, 4). Then set the set the [0], [1], and [2] component of this vector to (64, 64, 1). The [3] component of this vector is not used.

Examples

Copy Text To Clipboard

None published. Please look for an example in the Scenome Scripting Language code base.