Using some deep Google AI trickery and a virtual reality headset, scientists have built a device they're calling the Hallucination Machine – an experience a lot like tripping out, but without any of the actual drugs.

This mind-bending immersive experience, several years in the making, has been put together to try and help experts understand exactly how the brain processes what we're perceiving, and how that might differ between reality and hallucinations.

Or is reality just one particular type of hallucination? That's what researchers from Sussex University's Sackler Centre for Consciousness Science in the UK want to know, and they've now got some crazy, computer-generated visuals to help answer the question.

The research is still a work in progress, though some initial results have appeared in a newly published paper that compares the effect of the Hallucination Machine to taking classic psychedelic drugs.

"We're hallucinating all the time," the Sackler Centre co-director, Anil Seth, said in a recent TED talk. "It's just that when we agree about our hallucinations, we call that reality."

Hallucinations are actually really useful in studying the brain, because they show us the mechanisms that cause the brain to go off the rails.

However, putting people on LSD or magic mushrooms in the name of science isn't particularly useful in this case, because it alters the chemical composition of the brain, which makes it hard to isolate just the visual effects.

Enter Google's Deep Dream system, which uses a neural network approach to try and identify patterns and features in images. You can actually try it out for yourself online.

Simply put, Deep Dream over-emphasises pattern recognition, or puts the way our brain interprets the world into overdrive, so much so that it starts to imagine stuff that isn't actually there.

It just so happens that Deep Dream was initially trained on a huge sample of dog images, which is why it often thinks it's seeing canine features in whatever photos or videos are fed through as inputs.

"One thing people always ask us is why there are so many dogs," one of the Sackler team, cognitive neuroscientist David Schwartzman, told Oliver Moody at The Times.

The researchers used a modified version of Deep Dream to process a panoramic video of the university campus. Then they showed it to 12 volunteers, finding that the visual hallucinations were similar to those brought on by psilocybin, the active ingredient in magic mushrooms.

The volunteers were asked questions like whether they felt a loss of control or a loss of their sense of self, and whether they saw patterns and colours. Their answers matched up closely with the results of a 2013 study into the experience of taking psilocybin.

In a second experiment, 22 participants were asked whether they felt any sense of temporal distortion, or a warped sense of time. In this case the responses were similar to those recorded after watching control videos.

That would seem to suggest the researchers' machine can replicate some, but not all, the effects of being high on psychedelic drugs. However, only a few volunteers have been tested so far, and they were a different group to those quizzed on psilocybin back in 2013.

This is just the beginning for the technology – the system is very flexible and can be tweaked in all kinds of ways. In the future, participants could even get to adjust the parameters of the experience themselves.

The scientists think the levels at which the Hallucination Machine can be set – from low to high distortion – might match levels of visual processing in the brain, but all this is still to be determined in future research.

It's also another example of one of the ways virtual reality can help science: being able to immersively mimic reality so closely, where we can be placed inside a fully enclosed, 360-degree virtual world, just hasn't been possible until the last few years.

Tech is getting better at tricking our brains, which should help reveal more of their secrets.

"Overall, the Hallucination Machine provides a powerful new tool to complement the resurgence of research into altered states of consciousness," conclude the researchers.

The findings have been published in Scientific Reports.