This is a multi-part message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
I ran into an answer while scouring messageboards.  It was a solution that had 
sort of crossed my mind, but didn't seem like a very good way of doing it so I 
kept looking for proper way of precaching.  The other thing mentioned in the 
thread was that this broke on one of the recent source updates, and it seems to 
make sense because I swear it just started doing this a week or two ago.  I'm 
also glad that I'm not the only one who couldn't get it working with simple 
PrecacheMaterial calls.

Anyway, add these two lines somewhere in one of the precaching calls (or 
anywhere else that gets initialized while still loading/precaching):

materials->FindMaterial( "frontbuffer", TEXTURE_GROUP_OTHER, true );
GetMoBlurTex0();

Well, this is assuming you have garry's motion blur, but the idea is the same.

Here's the thread: 
http://www.chatbear.com/board.plm?a=viewthread&t=448,1128370834,14527&id=910574&b=4991&v=flatold


----- Original Message -----
From: Adam "amckern" Mckern
To: [email protected]
Sent: Tuesday, October 04, 2005 11:16 PM
Subject: Re: [hlcoders] Having trouble with material precaching


Yeah i would also love to see a precache page at the
dev wiki, i precache it, but it has the same effect -
any help would be wonderful!



Here is an exmaple of one of the precache and calls
i'm trying to do




//-----------------------------------------------------------------------------
// Nightfall - amckern - [EMAIL PROTECTED]
//-----------------------------------------------------------------------------
// Purpose: Disables AI, for sneek mode
//-----------------------------------------------------------------------------

class CTriggerNoAI : public CBaseTrigger
{
DECLARE_CLASS( CTriggerNoAI, CBaseTrigger );
public:
void Spawn( void );
void StartTouch( CBaseEntity *pOther );
void EndTouch( CBaseEntity *pOther );
void Precache();
};

LINK_ENTITY_TO_CLASS( trigger_noai, CTriggerNoAI );

void CTriggerNoAI::Spawn( void )
{
BaseClass::Spawn();
InitTrigger();
Precache();
}

void CTriggerNoAI::Precache()
{
PrecacheMaterial( "HUDoverlays/sneak" );
PrecacheMaterial( "HUDoverlays/null" );
}

void CTriggerNoAI::StartTouch( CBaseEntity *pOther )
{
if ( !pOther->IsPlayer() )
return;

pOther->ToggleFlag( FL_NOTARGET );
engine->ServerCommand( "r_screenoverlay
HUDoverlays/sneak\n" );
}






Adam






--- Gnolfo <[EMAIL PROTECTED]> wrote:

> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> I have a material essentially used as an overlay for
> when a player gets damaged, and I'm having a heck of
> a time finding a place to precache it.  I've added
> PreacacheMaterial calls in places like CBasePlayer's
> precache, I've tried adding it to the
> CLIENTEFFECT_REGISTER macros at the top of
> view_scene.cpp (where it gets used), as well as a
> few other places.  However every time I start up the
> game, the first time I hurt myself the game chunks
> for a second or two while it loads up the texture,
> then after that it's fine.  I'm not sure why it's
> not ready to go from the start, and I think it might
> stem a little from my (lack of) knowledge about the
> precaching system.
>
> Let me see if I have this right:  The precache
> functions seem to be part of the server dll and not
> client, however the clients are certainly going to
> want to precache as well.  My guess at what's
> happening is the server engine keeps track of
> everything that's been precached and tells the
> client engines what they need to precache as one big
> list.  Is that roughly how it's handled?  It's a bit
> tricky to follow since most of these calls sink into
> the engine pretty quickly.
>
> This is a part of the engine that I'm still fairly
> unfamiliar with, so any input of how you'd precache
> a material like that (my next step is to try and
> include it in the HUD), or even general info of how
> the precaching system works would be very helpful.
> For instance, I noticed the CLIENTEFECT stuff just
> artifically increases the refcount, though I can't
> find any code to see how that would end up
> precaching the material so am not entirely sure how
> that factors in.
>
> Thanks in advance,
>
> -Matt
> --
>
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view
> the list archives, please visit:
>
http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>


--------

My Website http://www.ammahls.com
   Lead Programer NightFall http://www.nightfallmod.net/
      Developer of CST and ZHLT 3.0 http://www.zhlt.tk

This email has been sent from Adam McKern, and is not one of the many spam bots 
that use my email address.

If you receive an email that has not got this signature line, please delate the 
email, and not respond in any way to it.



__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders
--


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to