The virtual reality (VR) market has seen massive expansion since Meta Platforms acquired Oculus in 2014. The purchase led to advances in the technology and decreases in headset prices, making them accessible to the mass market. Interest in VR subsequently increased. However, companies still have a long way to go before VR is adopted by consumers on a more widespread basis, suggesting the industry is still in its infancy. 

This sentiment aligns with data from GlobeNewswire, which states the virtual reality market hit $17 billion in 2022, and it's projected to expand at a compound annual growth rate of 45% through 2029. As a result, now is a compelling time to consider investing in the burgeoning industry before it's too late.

Here are two stocks to invest in virtual reality. 

1. Apple

The VR market looks likely to receive another big boost with Apple (AAPL -1.14%) reportedly making moves to venture into the industry this year. The iPhone maker is expected to debut a brand-new headset in June, featuring virtual and augmented reality (AR) capabilities. 

A Bloomberg piece from last month revealed the coming device would likely use an iOS-like interface to offer activities such as gaming, watching sports and other entertainment, reading, and more. Apple's long-term plans for the device are unclear, but some reports say the company hopes to eventually replace the iPhone with a future iteration of the AR/VR product. 

Apple's step into the market is favorable for VR investors given the company's past success when entering new product categories. Smartphones, tablets, Bluetooth headphones, and smartwatches all saw consumer adoption skyrocket once Apple launched its own versions.

The biggest players in VR are currently Meta and Sony with their respective headsets. However, it's not out of the realm of possibility that Apple's immense brand loyalty could help it trounce the competition in the long term. As a result, an investment in Apple could be an investment in the future leader of VR. 

Looking closer at its stock, Apple's price-to-earnings ratio of 29 makes it seem like a slightly expensive investment right now, as an optimal figure would be below 20. However, with share-price gains of about 267% since 2018 and 988% since 2013, the company is a reliable option likely to offer substantial returns over the long term, no matter its current position.

2. Nvidia

While it's wise to invest in the companies producing fully formed virtual reality headsets, it's also a good idea to consider backing businesses behind the chips that make the technology possible. Nvidia (NVDA 10.98%) has made a lot of waves this year for its growing position in artificial intelligence. However, the company also has promising prospects in VR thanks to its dominance in graphics processing units (GPUs), which are necessary for heavy VR workloads. 

Nvidia has integrated VR-focused designs in its line of GeForce RTX GPUs, which are offered alongside its software developer kit called VRWorks. The kit is an excellent way for the company to attract developers to its chips by helping users create top-of-the-line VR programs.

Moreover, Nvidia held an 88% market share in consumer GPUs as of the third quarter of 2022, according to Jon Peddie Research. The company's massive presence in the industry could easily see it become the go-to for developers and consumers seeking VR-compatible hardware for their PCs.

Nvidia's stock soared around 94% in 2023 yet remains an attractive investment, with a forward PEG ratio of 0.4. The metric suggests projected growth has not been priced into its shares, making Nvidia an increasingly compelling way to invest in the VR market.