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

ParameterDescription
scThe scene object.
expected_sizeThe target pixel size of the merged texture image. Must be greater than 0. Unit: pixel. For example, setting this to 256 produces a merged texture image of 256 × 256 pixels.

Usage notes

  • Returns NULL if sc is not specified.

  • Returns an error if expected_size is less than or equal to 0.

Example

The following example merges all texture images in the scene column into a single 4,096 × 4,096 pixel texture image.

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

Output:

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

The following images illustrate the merge result. The input consists of multiple 256 × 256 pixel texture images:

image.png

After merging, all input images are combined into a single 4,096 × 4,096 pixel texture image:

image..png