The virtual reality (VR) market has yet to come into its own, but as more and more technology companies shift their attention to it, a massive $21 billion (by 2025) market is being created.

Because we're still toward the beginning of this expanding market, investors have an opportunity not only to buy shares of companies that are betting big on VR but also benefit from their growth as VR comes into its own.

Two such companies that could end up being good long-term VR investments are Apple (AAPL 0.52%) and Nvidia (NVDA 3.71%). Here's why.

A person wearing a VR headset.

Image source: Getty Images.

Apple

It's true that Apple doesn't have a VR device on the market yet. But rumors have surfaced lately that the company is only a year away from launching an augmented (AR) and VR headset.

Apple has reportedly already shown the device to its board members, which would indicate that the headset is nearly ready to launch. Apple could have a unique opportunity with such a device because the tech giant is rather adept at pairing hardware and software in ways its peers aren't.

Apple CEO Tim Cook has hinted at the potential for the company to enter the VR market, saying last month, "I couldn't be more excited about the opportunities we've seen in this space. And sort of stay tuned and you'll see what we have to offer." Those comments came on the heels of an accidental reveal in Apple's open source code showing that the company is working on what it calls realityOS, likely an operating system for AR/VR.

Launching such a device would be a major step into an entirely new revenue segment for Apple. Some analysts estimate Apple's new headset could generate $18 billion in sales after its fifth year on the market.

Beyond device sales, Apple's strength in pairing hardware and software makes it likely that the company could eventually sell an entirely new set of services for the devices, just like it does now for its iPhones.

Apple already has more than 14,000 AR apps in its App Store, indicating a mixed reality headset could already have a slew of uses when it debuts.

Nvidia

Another way to tap into the growing potential of VR is to look at companies that make the technology that makes VR possible. And you'd be hard-pressed to find a company that's more fundamental to the future of VR hardware than Nvidia.

That's because Nvidia makes some of the best gaming processors on the market. Its gaming graphics processing units (GPUs) allow game developers to develop some of the most detailed virtual worlds and enable gamers to immerse themselves in them.

And just as importantly, Nvidia's GPUs have become an integral part of high-powered data center processing as well. All this is important for the VR market because GPUs will power VR hardware and likely be used for cloud-based VR applications and services as well.

The potential here for Nvidia is to sell more GPUs into an expanding market.

The global GPU market is expected to get a boost from AR and VR devices and services in the coming years and will help the graphics chip market grow to a $200 billion market by 2027.

Patience is the key

VR could take longer to take off than investors may want. Plenty of companies are working to build this market, but it's going to take time. So, investors will need to remain patient while it grows. The good news is that both Nvidia and Apple have lots of potential in other markets beyond VR, which helps round out their opportunities to grow in the coming years.