bool CMaterialEffects::ExecuteEffect(TMFXEffectId effectId, SMFXRunTimeEffectParams& params)
{
  FUNCTION_PROFILER(gEnv->pSystem, PROFILE_ACTION);
	
  if (!CMaterialEffectsCVars::Get().mfx_Enable)
		return false;

	bool success = false;
	TMFXContainerPtr pEffectContainer = InternalGetEffect(effectId);
	if (pEffectContainer)
	{
		const float delay = pEffectContainer->GetParams().delay;
		if ((delay > 0.0f) && !(params.playflags & eMFXPF_Disable_Delay))
		{
			TimedEffect(pEffectContainer, params);
		}
		else
		{
			pEffectContainer->Execute(params);
		}
		success = true;

#ifdef MATERIAL_EFFECTS_DEBUG
		if (CMaterialEffectsCVars::Get().mfx_DebugVisual)
		{
			if (effectId != InvalidEffectId)
			{
				m_pVisualDebug->AddEffectDebugVisual(effectId, params);
			}
		}
#endif

	}

	return success;
}