All Products
Search
Document Center

PolarDB:ST_CombineTextures

Last Updated:Mar 28, 2026

Merges multiple texture images in a 3D model into a single texture image of a specified pixel size.

Syntax

scene ST_CombineTextures(scene sc, int4 expected_size);

Parameters

ParameterTypeDescription
scsceneThe scene object. If not specified, the function returns NULL.
expected_sizeint4The pixel size of the merged texture image. Must be greater than 0. The output image is square—for example, setting this to 256 produces a 256 x 256 pixel image.

Description

ST_CombineTextures combines all texture images in a 3D model into one square texture image. The pixel dimensions of the merged image are determined by expected_size.

Error behavior:

  • If sc is not specified, the function returns NULL.

  • If expected_size is less than or equal to 0, the function reports an error.

Examples

The following example merges multiple 256 x 256 pixel texture images from a scene into a single 4,096 x 4,096 pixel texture image.

SELECT ST_AsText(ST_CombineTextures(scene, 4096)) from t;

The function returns a scene object in glTF format:

{"type" : "gltf", "content" : {"accessors":[{"bufferView":0,......

One of the source texture images (256 x 256):

image.png

Merged texture image (4,096 x 4,096):

image..png