Metallic Chams — CS:GO

DREDD

Administrator
Administrator
Administrator
Administrator
Status
Offline
Joined
Apr 18, 2019
Messages
147
Reaction score
249
Since it looks pretty cool, I decided to share chams with you


C++:
static IMaterial* pMatGloss = g_pMaterialSystem->FindMaterial("models/inventory_items/trophy_majors/gloss", TEXTURE_GROUP_OTHER); //you can create your own material to really make it shiny, but i like this subtle one

After appling regular chams and BEFORE setting ForcedMaterialOverride to nullptr:
C++:
if (g_Settings.bChamsGloss) {
 
                Color col = g_Settings.cChamsGloss;
 
                bool bFound = false;
                auto pVar = pMatGloss->FindVar("$envmaptint", &bFound);
                if (bFound)
                    (*(void(__thiscall **)(int, float, float, float))(*(DWORD *)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f); //tfw no IMaterialVar class
                
                g_pModelRender->ForcedMaterialOverride(pMatGloss);
                oDrawModelExecute(g_pModelRender, ctx, state, info, matrix);
 
            }
 

Ozelotick

Member
Member
Member
Member
Status
Offline
Joined
Mar 21, 2019
Messages
171
Reaction score
798
Code:
if (bFound)
                    (*(void(__thiscall **)(int, float, float, float))(*(DWORD *)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
m3m3
pVar->SetVecValue(col.r / 255.f, col.g / 255.f, col.b / 255.f);
Code:
void SetVecValue(float x, float y, float z)
{
    typedef void(__thiscall* SetVecValueFn)(void*, float, float, float);
    GetMethod<SetVecValueFn>(this, 11)(this, x, y, z);
}
 
Last edited:

DREDD

Administrator
Administrator
Administrator
Administrator
Status
Offline
Joined
Apr 18, 2019
Messages
147
Reaction score
249
Code:
if (bFound)
                    (*(void(__thiscall **)(int, float, float, float))(*(DWORD *)pVar + 44))((uintptr_t)pVar, col.red / 255.f, col.green / 255.f, col.blue / 255.f);
m3m3
pVar->ColorModulate(col); or pVar->ColorModulate(col.red / 255.f, col.green / 255.f, col.blue / 255.f);
If you consider it bad realization, then show us as it is necessary.
 
Top