b3dGetBaseTexture

Retrieves the base color texture handle from an entity's material. Takes entityHandle (mesh, terrain, or other entity with material). Returns texture handle (non-negative integer) or -1 on failure.

3D Graphics

Parameters & Returns

Parameters

entityHandle Int

Returns

Int

Quick Summary

Retrieves the base color texture handle from an entity's material. Takes entityHandle (mesh, terrain, or other entity with material). Returns texture handle (non-negative integer) or -1 on failure.

Technical Exegesis...

Retrieves the base color texture handle from an entity's material. Takes entityHandle (mesh, terrain, or other entity with material). Returns texture handle (non-negative integer) or -1 on failure. Validates entity exists. Determines entity type (ENTITY_MESH, ENTITY_TERRAIN, etc.). For meshes: if surface-based, gets material from first surface (surfaces[0].materialIndex); otherwise gets material from mesh->materialIndex. For terrain: gets material from terrain data. Looks up material in g_materials array.

Example

Example.bam
; No example implemented yet