Ped texture overlay lifecycle: _REQUEST_TEXTURE returns -1 on fail; must _UPDATE_PED_TEXTURE (else black) + _RELEASE_TEXTURE (32-handle cap)
Context
RDR3 ped texture overlays use a request/validate/apply/update/release lifecycle. Skipping steps gives black textures or leaks the global texture-handle budget (~32 handles).
The lifecycle
local tex = _REQUEST_TEXTURE(...) -- 0xC5E7204F322E49EB ; returns -1 on failure
-- validate BEFORE adding layers:
if not _IS_TEXTURE_VALID(tex) then ... end -- 0x31DC8D3F216D8509
_ADD_TEXTURE_LAYER(tex, ...)
-- the handle can go invalid AFTER adding layers — validate again, retry up to ~5x
_APPLY_TEXTURE_ON_PED(ped, GetHashFromString(category), tex)
_UPDATE_PED_TEXTURE(tex) -- 0x92DAABA2C1C10B0E ; skip => textures render BLACK
-- once the ped is ready to render:
_RELEASE_TEXTURE(tex) -- 0x6BEFAA907B076859 ; skip => handle leak (32-handle global cap)
Traps
_REQUEST_TEXTUREreturns -1 on failure — check it.- The texture handle can become invalid after
_ADD_TEXTURE_LAYER; validate twice and retry. - Forgetting
_UPDATE_PED_TEXTURE= black overlay. Forgetting_RELEASE_TEXTURE(jo does it afterIsPedReadyToRender) leaks handles until overlays stop working globally.
Verified
ped-texture/g_client.lua:453-507.
Linked natives
_IS_TEXTURE_VALID(0x31DC8D3F216D8509)_RELEASE_TEXTURE(0x6BEFAA907B076859)_REQUEST_TEXTURE(0xC5E7204F322E49EB)_UPDATE_PED_TEXTURE(0x92DAABA2C1C10B0E)
Tags: ped, texture, lifecycle, releasetexture, updatepedtexture, handle-leak
Category: natives
Source: jo_libs-fleet
Created: 2026-05-31T09:43:15.178Z