b3dBakeMesh

Bakes surface-based mesh textures into atlas in-runtime, replacing multi-material with single texture. Takes meshHandle (surface-based mesh entity), uvPadding (pixels between atlas regions, 0-8), atlasSize (atlas dimensions, power of 2). Returns texture handle of created atlas, or -1 on failure.

3D Graphics

Parameters & Returns

Parameters

meshHandle Int
uvPadding Int
atlasSize Int

Returns

Int

Quick Summary

Bakes surface-based mesh textures into atlas in-runtime, replacing multi-material with single texture. Takes meshHandle (surface-based mesh entity), uvPadding (pixels between atlas regions, 0-8), atlasSize (atlas dimensions, power of 2). Returns texture handle of created atlas, or -1 on failure.

Technical Exegesis...

Bakes surface-based mesh textures into atlas in-runtime, replacing multi-material with single texture. Takes meshHandle (surface-based mesh entity), uvPadding (pixels between atlas regions, 0-8), atlasSize (atlas dimensions, power of 2). Returns texture handle of created atlas, or -1 on failure. Only works with surface-based meshes (created with b3dCreateMesh). Analyzes all surfaces to determine texture sizes and solid colors.

Example

Example.bam
; No example implemented yet