Improve Backtrack Glow/Chams

This commit is contained in:
LightCat 2019-04-13 20:05:56 +02:00
parent 08eb5fc0f8
commit a74234d532

View File

@ -96,14 +96,14 @@ DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_, const DrawMod
// Sort // Sort
std::sort(usable.begin(), usable.end(), [](hacks::shared::backtrack::BacktrackData &a, hacks::shared::backtrack::BacktrackData &b) { return a.tickcount < b.tickcount; }); std::sort(usable.begin(), usable.end(), [](hacks::shared::backtrack::BacktrackData &a, hacks::shared::backtrack::BacktrackData &b) { return a.tickcount < b.tickcount; });
// Make our own Chamsish Material // Make our own Chamsish Material
static CMaterialReference mat_lit; static CMaterialReference mat_unlit;
static bool init = false; static bool init = false;
if (!init) if (!init)
{ {
KeyValues *kv = new KeyValues("VertexLitGeneric"); KeyValues *kv = new KeyValues("UnlitGeneric");
kv->SetString("$basetexture", "vgui/white_additive"); kv->SetString("$basetexture", "vgui/white_additive");
kv->SetInt("$ignorez", 0); kv->SetInt("$ignorez", 0);
mat_lit.Init("__cathook_dme_lit", kv); mat_unlit.Init("__cathook_dme_unlit", kv);
init = true; init = true;
} }
// Render Chams/Glow stuff // Render Chams/Glow stuff
@ -115,7 +115,7 @@ DEFINE_HOOKED_METHOD(DrawModelExecute, void, IVModelRender *this_, const DrawMod
// Important for Depth // Important for Depth
ptr->DepthRange(0.0f, 1.0f); ptr->DepthRange(0.0f, 1.0f);
// Apply our material // Apply our material
g_IVModelRender->ForcedMaterialOverride(mat_lit); g_IVModelRender->ForcedMaterialOverride(mat_unlit);
// Run Original // Run Original
original::DrawModelExecute(this_, state, info, usable[0].bones); original::DrawModelExecute(this_, state, info, usable[0].bones);
// Revert // Revert