Red Bull are in a bit of a mess - that much has been clear for some time - and the situation is coming to a head as Formula 1 heads to Singapore for this weekend's Grand Prix.

The former constructors world champions threatened to quit Formula 1 earlier this year if they could not get a competitive engine, and now appear to be on the verge of splitting with current supplier Renault - a situation they engineered without having a fall-back option in place.

Mercedes have turned them down, and Red Bull are set to turn to Ferrari for 2016 - returning to a partnership they had during the team's early years in Formula 1 in the mid 2000s.

So how did a team who dominated F1 during the first part of this decade end up in this situation? And what happens now?

Media playback is not supported on this device Archive: What is going wrong at Red Bull?

How did it come to this?

Red Bull became so used to winning between 2010 and 2013, when they won four drivers' and constructors' championship doubles in a row.

Renault supplied the engine that powered the team to that success. But the French company has struggled since the new turbo hybrid engines were introduced into F1 in 2014, and Red Bull has run out of patience.

Some would argue that, as partners, Red Bull should have been more supportive. But Red Bull would almost certainly counter with an outline of what has happened at Renault over the last 18 months or so.

The team won three races last year - admittedly when Mercedes had problems of one kind or another - and they were generally there or thereabouts. And it was clear the Red Bull chassis was still pretty good.

Red Bull's best result this season was at the Hunagrian Grand Prix, when Danill Kvyat (left) was second and Daniel Ricciardo (right) third to Ferrari's Sebastian Vettel

That, combined with Renault's promises that a big improvement was coming over the winter, kept the lid on tensions. You could see frustration building, but there was always the idea that this year would be better.

But at the beginning of this season, the revamped Renault engine was no more powerful than in 2014. To make matters worse, it was less driveable and less reliable.

Ferrari, who were in a similar situation to Renault last year, zoomed past Red Bull as they made a big step forward with their engine.

Red Bull had had enough - and very public criticisms of Renault quickly followed from both the team and the drivers.

Ideally, you would keep your dirty washing private, but sometimes that does not happen because of the high pressures of F1.

Media playback is not supported on this device Daniil Kvyat: Formula 1's book worm

And if, as in Red Bull's case, you don't feel as if the other partner is pulling their weight, or reacting quickly enough, you feel obliged to speak out.

The criticisms made by Red Bull were almost certainly aimed at the board of Renault, rather than the engineering staff at the races. Red Bull feel Renault had not committed enough resources to F1 to be able to compete with Mercedes and Ferrari.

That, of course, is a dangerous game to play, because it can only go one of two ways - either they respond, or they walk away. And it does look as if Red Bull have engineered - deliberately or not - their own divorce.

Is it all Renault's fault?

It took Red Bull quite a few races to acknowledge that their performance deficit to Mercedes this year was not all down to Renault.

Media playback is not supported on this device Highlights: Hamilton cruises to victory in Canada

The car had problems, too, most of them rooted in the change to rules over the winter governing the nose and front floor. That stopped Red Bull running their car the way they had for the previous five years.

I remember watching out on track in Canada in June and the front of the Red Bull looked so lazy through the final chicane. It just did not react to the drivers' inputs - and that was the race at which Daniel Ricciardo, who took all Red Bull's wins last year, said he just could not find the rhythm in the car.

At that point, Renault started to turn around and say: "Hang on, this is not all about us." And when two sides are against each other in public like that, the cracks really start to grow.

It was only when Red Bull got to Silverstone, and made a significant change to the front-end aerodynamics, that the car came alive.

But by then, relations with Renault were so bad that they were already starting to look at other options.

What are Red Bull's options?

Media playback is not supported on this device Hungarian GP 2015 highlights: Chaos and drama as Vettel wins

Red Bull did approach manufacturers who are not currently in F1 to see if they were interested in joining forces.

But if you could pick any F1 engine, the one you would want go with is Mercedes - and that was Red Bull's number one choice.

For Mercedes, though, supplying Red Bull would be a big risk.

Firstly, they know Red Bull are a well-resourced team who can react quickly, be very competitive and be very aggressive with it. So Mercedes might end up being beaten by their own engine in another car.

If that happened, it could raise questions about the future of Mercedes' own team - because if they get beaten by a customer, then the board could start to question why they are pouring so many millions into running their own team.

Red Bull won the first of four straight drivers' and constructors' championship doubles in 2010 - with Sebastian Vettel and Christian Horner collecting the trophies

So for Mercedes, it was a lose-lose situation. Did they need to supply Red Bull? No. Did they need the money it would bring in? No. Was there a risk it could damage them in one way or another? Yes. So why take the risk?

So it is no surprise that Mercedes have rejected Red Bull's advances.

Where does that leave Renault? Well, no-one has said it definitively yet, but it looks very much as if the relationship with Renault will end this season, despite the two having a contract until the end of next year.

We know Red Bull have written to Renault requesting a termination of their contract on the basis the engine does not meet performance criteria.

That leaves Red Bull with only one option - Ferrari. And they have said they would supply Red Bull if necessary.

So why would Ferrari be happy to step in where Mercedes and Renault are not?

Media playback is not supported on this device Tom Clarkson's F1 News

Ferrari has a status both inside and outside F1 that makes it less of a risk for them.

One of Renault's complaints about their relationship with Red Bull was that it got virtually no publicity for winning eight world titles and becoming one of the most successful engine manufacturers in the history of F1.

That is because of the power of the Red Bull brand from a marketing perspective.

Of course, if Red Bull beat Ferrari with their own engine, that does not look great for the Italian team. But it is a more than big enough name for that not to be a major issue.

What effect will the split have on Red Bull?

Team principal Christian Horner is facing a testing time, with Red Bull fourth in the constructors' championship

Red Bull look set to finish fourth in the constructors' championship this year, which is a two-place drop on 2014. That in itself is damaging - it means a loss of in the region of $20m (£13m) in terms of prize money.

Splitting from Renault is going to hit Red Bull in other ways, too.

The team's title sponsor at the moment is Infiniti, a deal worth a reputed $30m (£19.5m) a year. But Infiniti is Nissan's luxury brand. Nissan and Renault are part of the same global car group. That deal clearly cannot carry on.

Equally, Red Bull receive sponsorship money from French oil company Total, which is a long-time supporter and technical partner of Renault, so you would imagine it would also make an exit.

It may be that Red Bull would have to end up paying money to break the Renault contract. If so, that would run into millions.

And they will also have to pay - in the region of $20m (£13m) - for their Ferrari engines, whereas the Renault bill was covered - and more - by the Infiniti money.

So there is a major financial hit for Red Bull. The fact that they are still willing to go ahead shows how keen they are to split.

However, there is another key factor in their decision - Renault are trying hard to put together a deal to buy Lotus and become a constructor in their own right again. That would remove Red Bull's priority status with Renault.

So, financial hit or not, there is some clear logic in Red Bull's thinking.

The here and now

Red Bull and Renault still have seven races to get through together, and the irony is that the next one - in Singapore this weekend - could be their best of the year.

Since the Silverstone upgrade, the Red Bull has moved on to another level. It was particularly improved in low-speed corners - which make up most of the 23 corners on Singapore's Marina Bay street circuit.

Media playback is not supported on this device Why were Mercedes not punished?

It is the sort of track where the Red Bull should excel - low grip, lots of 90-degree bends that require precise initial turn-in. It requires agility in the car, which the Red Bull now has.

At the same time, the straights are mostly quite short, so Renault's power deficit to the Mercedes will not be as much of a handicap.

Mercedes will still be out in front, but you would expect Red Bull to be right in the mix with Ferrari as the next best team. And they could even split the two Mercedes cars in qualifying if Lewis Hamilton or Nico Rosberg drop the ball.

Allan McNish was talking to BBC Sport's Andrew Benson