All Products
Search
Document Center

PolarDB:ST_CombineTextures

Last Updated:Jun 08, 2023

This topic describes the ST_CombineTextures function. This function merges multiple texture images in a 3D model into a texture image of a specified pixel size.

Syntax

scene ST_CombineTextures(scene sc, int4 expected_size);

Parameters

Parameter

Description

sc

The scene object.

expected_size

The size of the texture image after the merge. The value must be greater than 0.

Unit: pixel.

For example, if this parameter is set to 256, the pixel size of the texture image after the merge is 256 × 256.

Description

This function merges multiple texture images in a 3D model into a texture image of a specified pixel size.

  • If the sc parameter is not specified, NULL is returned.

  • If the value of the expected_size parameter is less than or equal to 0, an error is reported.

Multiple images with a pixel size is 256 × 256 need to be merged. The following example shows one of the images.

image.png

Multiple images with a pixel size of 256 × 256 are merged into one image. The pixel size of the image after the merge is 4,096 × 4,096.

image..png

Examples

SELECT ST_AsText(ST_CombineTextures(scene, 4096)) from t;
--------
{"type" : "gltf", "content" : {"accessors":[{"bufferView":0,......