Hello,
I want to create a "overlay"-effect with the ForcedMaterialOverride
function for a specific entity.
The entity is derived from CBaseEntity and mapped over network. The
client class is very simple (network variable is stripped out):
class C_TestEntity : public C_BaseEntity
{
public:
DECLARE_CLASS(C_TestEntity , C_BaseEntity);
DECLARE_CLIENTCLASS();
virtual int DrawModel(int flags);
};
IMPLEMENT_CLIENTCLASS_DT(C_TestEntity, DT_TestEntity, CTestEntity)
END_RECV_TABLE()
int C_TestEntity ::DrawModel(int flags)
{
int retVal = BaseClass::DrawModel(flags);
modelrender->ForcedMaterialOverride( materials->FindMaterial(
"dev/dev_blendmeasure", TEXTURE_GROUP_CLIENT_EFFECTS ) );
BaseClass::DrawModel(STUDIO_RENDER|STUDIO_TRANSPARENCY);
modelrender->ForcedMaterialOverride(NULL);
DevMsg("%.2f drawing\n", gpGlobals->curtime);
return retVal;
}
I know that the draw model function is executed, but there is no effect
on the model.
I have places the entity as a brush entity on a block in hammer.
Is there any requirement for my entity in order to get
ForcedMaterialOverride working. There must be something, as it seems to
work on player models.
BRW, the spawn method for the entity on server side is:
void CTestEntity ::Spawn()
{
SetSolid(SOLID_VPHYSICS);
SetModel(STRING(GetModelName()));
}
I would appreciate your help and don't hesitate to ask me if something
is missing.
Christian
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders