Book Image

Mastering Oculus Rift Development

By : Jack Donovan
Book Image

Mastering Oculus Rift Development

By: Jack Donovan

Overview of this book

Virtual reality (VR) is changing the world of gaming and entertainment as we know it. VR headsets such as the Oculus Rift immerse players in a virtual world by tracking their head movements and simulating depth, giving them the feeling that they are actually present in the environment. We will first use the Oculus SDK in the book and will then move on to the widely popular Unity Engine, showing you how you can add that extra edge to your VR games using the power of Unity. In this book, you’ll learn how to take advantage of this new medium by designing around each of its unique features. This book will demonstrate the Unity 5 game engine, one of most widely-used engines for VR development, and will take you through a comprehensive project that covers everything necessary to create and publish a complete VR experience for the Oculus Rift. You will also be able to identify the common perils and pitfalls of VR development to ensure that your audience has the most comfortable experience possible. By the end of the book, you will be able to create an advanced VR game for the Oculus Rift, and you’ll have everything you need to bring your ideas into a new reality.
Table of Contents (17 chapters)
Mastering Oculus Rift Development
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Keeping a handle on memory allocation


The last major topic we'll cover in this chapter is memory allocation and deallocation. The material we cover in this section gets relatively complex and you won't need to know it right away, so feel free to revisit this section later if you'd rather get a stronger handle on the basics first.

C# is a garbage-collected language, which means the actual process of allocation and deallocation is done by a garbage collector automatically according to an algorithm, but there are ways to manage your data to make sure you avoid common memory issues (even in a garbage-collected language) and keep everything optimized.

Stack and heap memory

To understand optimization of memory, first you have to understand the different types: stack memory and heap memory.

Imagine stack memory as a neatly organized stack of books you're going to read. You set the order, but you need to read through the books on top before you can access the books in the middle.

Heap memory, by contrast...