I hate the material system so here
PHP Code:
if( !g_pClientMode )
{
DWORD dwCHLModeManagerInit = gApp.FindPattern(
(DWORD)GetModuleHandle("client.dll"),
0x1E0000,
"\xC7\x05\x08\x8E\x3F\x24\x54\x8F\x3F\x24\xE8\x31\x46\xF4\xFF\x8B\x10\x68\xAC\x70\x33\x24\x8B\xC8\xFF\x12\xC3\xCC\xCC\xCC\xCC\xCC",
"xx????????x????xxx????xxxxxxxxxx" );
LOG_VARIABLE( dwCHLModeManagerInit );
if( dwCHLModeManagerInit )
{
DWORD *dwClientModeNormal = (DWORD *)( dwCHLModeManagerInit + 0x6 );
g_pClientMode = (IClientMode *)*dwClientModeNormal;
LOG_OFFSET( g_pClientMode );
}
}
now u can do stuff like
PHP Code:
void __stdcall nSceneBegin( void )
{
C_BaseEntity *pLocal = g_Players.GetLocalBaseEntity();
if( pLocal )
{
if( g_Cvar.GetBoolean( "flash" ) )
{
float *flFlashMaxAlpha = (float *)((DWORD)pLocal + 0xFD4);
float *flFlashDuration = (float *)((DWORD)pLocal + 0xFD8);
*flFlashMaxAlpha = 0;
*flFlashDuration = 0;
}
if( g_pClientMode && (*(int *)((DWORD)pLocal + 0x87) == LIFE_ALIVE) )
{
if( g_pClientMode->GetViewport() )
{
if( g_Cvar.GetBoolean( "scope" ) )
{
vgui::Panel *scope = g_pClientMode->GetViewport()->FindChildByName( "HudZoom" );
if( scope )
{
scope->SetVisible( g_Cvar.GetBoolean( "scope" ) );
}
}
}
}
}
gRenderView.SceneBegin();
}
bool __stdcall nShouldDrawParticles( )
{
if( g_Cvar.GetBoolean( "smoke" ) )
return false;
return gClientMode.ShouldDrawParticles();
}
bool __stdcall nShouldDrawFog()
{
if( g_Cvar.GetBoolean( "smoke" ) )
return false;
return gClientMode.ShouldDrawFog();
}
If you hook ShouldDrawParticles and return, you won't be able to see most particles (i.e. muzzle flash, fire displays fine) this can be fixed by _ReturnAddress
bonus points if you can IClientMode without FindPattern 
Credits: wav (for flash crap), HL2 SDK