Skip to content

Instantly share code, notes, and snippets.

@Disquse
Last active September 25, 2020 20:15
Show Gist options
  • Save Disquse/1d0aa00ce20ef99213d3f9af65e95092 to your computer and use it in GitHub Desktop.
Save Disquse/1d0aa00ce20ef99213d3f9af65e95092 to your computer and use it in GitHub Desktop.
```cpp
// 0xC5E7204F322E49EB
int _REQUEST_TEXTURE_OVERRIDE(Hash albedoHash, Hash normalHash, Hash unkHash);
/*
Creates a texture override data for ped and returns it's index.
So you can replace any texture of any ped's component.
Also, you can add overlays on it, such as ageing, lipstick and etc.
Textures can be reused by multiple peds at once.
You can keep only 32 textures at once (including other peds).
Material hash list:
https://raw.githubusercontent.com/femga/rdr3_discoveries/master/clothes/cloth_drawable_albedo_normal_material_TEMPORARY.lua
*/
```
Usage example:
```js
const albedoHash = GetHashKey("mp_head_mr1_sc05_c0_000_ab");
const normalHash = GetHashKey("mp_head_mr1_012_nm");
const unkHash = 0x50A4BBA9;
const textureId = RequestPedTexture(albedoHash, normalHash, unkHash);
if (textureId === -1) {
console.log("bad!");
}
```
```cpp
// 0x0B46E25761519058
void _APPLY_TEXTURE_OVERRIDE_ON_PED(Ped ped, Hash componentHash, int textureId);
/*
Applying a texture on a ped's component.
Make sure your table index is valid (<< 16), otherwise a component will be textured wrongly.
Don't forget to refresh ped components after it (0xCC8CA3E88256E58F).
*/
```
```cpp
// 0x6BEFAA907B076859
void _RELEASE_TEXTURE_OVERRIDE(int textureId);
/*
Removes a texture created by 0xC5E7204F322E49EB.
*/
```cpp
// 0x92DAABA2C1C10B0E
void _RELOAD_TEXTURE_OVERRIDE(int textureId);
/*
Should be called at least once for any new texture override.
Unless component's texture will be just black.
Also needs to be called for updating any ped overlays to apply the changes.
*/
```
```cpp
// 0x8472A1789478F82F
void _RESET_TEXTURE_OVERRIDE(int textureId);
/*
Clearing texture's data: setting params to default values, but keep overlays.
*/
```
```cpp
// 0x31DC8D3F216D8509
BOOL _IS_TEXTURE_OVERRIDE_UNK6(int textureId);
/*
Returns true if a texture by handle is invalid? Is loading check?
*/
```
```cpp
// 0x86BB5FF45F193A02
int _ADD_TEXTURE_OVERRIDE_OVERLAY(int textureId, Hash albedoHash, Hash normalHash, Hash unkHash, int colorType, float opacity);
/*
Creates ped overlay in texture override data and returns it's index.
This index are used for further overlay editing.
albedoHash: a hash of overlay's albedo texture
colorType: a color type (from 0 to 2). 0 is used for overlays with RGB colors usually.
*/
```
```cpp
// 0x96C349DE04C49011
void _REMOVE_TEXTURE_OVERRIDE(int textureId, int overlayId);
```
```cpp
// 0x3329AAE2882FC8E4
void _SET_TEXTURE_OVERLAY_VARIANT(int textureId, int overlayId, int variant);
```
```cpp
// 0x6C76BC24F8BB709A
void _SET_TEXTURE_OVERLAY_OPACITY(int textureId, int overlayId, float opacity);
```
```cpp
// 0x057C4F092E2298BE
void _SET_TEXTURE_OVERLAY_UNK11(int textureId, int overlayId, float unk1);
```
```cpp
// 0x1ED8588524AC9BE1
void _SET_TEXTURE_OVERLAY_PALETTE(int textureId, int overlayId, Hash paletteHash);
/*
Sets a palette hash to ped's overlay.
Palettes list:
https://raw.githubusercontent.com/femga/rdr3_discoveries/master/clothes/cloth_color_palletes.lua
*/
```
```cpp
// 0x2DF59FFE6FFD6044
void _SET_TEXTURE_OVERLAY_COLOUR(int textureId, int overlayId, int first, int second, int third);
/*
Applies a color from palette on overlay.
*/
```
```cpp
// 0xF2EA041F1146D75B
void _SET_TEXTURE_OVERLAY_UNK14(int textureId, int overlayId, Hash unk1, float unk2, BOOL unk3);
```
```cpp
// 0x253A63B5BADBC398
void _SET_TEXTURE_OVERLAY_MATERIALS(int textureId, int overlayId, Hash albedoHash, Hash normalHash, Hash unkHash);
```
```cpp
// 0xB63B9178D0F58D82
void _CLEAR_TEXTURE_OVERRIDE_OVERLAYS(int textureId);
```
```cpp
struct TextureOverride
{
uint64_t unkType; // +0
uint32_t albedoHash; // +8
uint32_t normalHash; // +12
uint32_t unkHash; // +16
uint32_t unk1; // +20 (0xF2EA041F1146D75B)
uint32_t paletteHash; // +24
char unkStruct1[12]; // +28
char unkStruct2[12]; // +40
char unkStruct3[12]; // +52
char unkStruct4[12]; // +64 (0xF2EA041F1146D75B)
uint8_t colorType; // +76
char pad1[3]; // +77
float unk2; // +80 (0x057C4F092E2298BE)
float unk3; // +84 (0x6C76BC24F8BB709A)
float unk4; // +88 (0xF2EA041F1146D75B)
BYTE unk5; // +92 (0xF2EA041F1146D75B)
BYTE colorR; // +93
BYTE colorG; // +94
BYTE colorB; // +95
BYTE albedoTextureIndex; // +96
BYTE unk6; // +97 (0x3329AAE2882FC8E4)
char pad2[6]; // +98
} // 104
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment