Oxygen Tutorial

Environment Probes

Environment probes generate cubemaps, which are used to display reflections on objects. By default, all objects in Oxygen uses the OxygenDefaultEnvironment probe in your scene. This contains a cubemap that can be overriden. You can create your own environment probes to override the default one assigned by Oxygen.

  1. Create an empty game object in the scene, and attach the EnvironmentProbe script, and rename it "RoomA Probe".

  2. Position it in the middle of the room, slightly higher than the center. This is to avoid the desk or the floor dominating the reflection. We set the position to -3.6, 1.9, -3.

  3. Click on Recalculate Cubemap to render the cubemap. You will see a progress bar on screen while the cubemap is rendered. Once that is complete, the probe icon will be replaced by a mirror ball reflecting the room. This is only visible while the environment probe is selected and is a useful debugging tool.

Assigning the probe to the environment.

  1. We will now tell the room to use this environment probe. Create an empty game object in the scene, and call it "RoomA". Attach Room2x2.5U, LightFittingOn, DeskTeak, Art and Whiteboard to this object. Your hierarchy should now look like this:

  2. Select the RoomA object. Add an "Environment Setter" component, then drag the "RoomA Probe" object into the environment probe slot on the component.

  3. By default the probe reflects an infinitely far away environment. This can (and most likely will) cause parallax errors in your scene, as can be seen below.

  4. We can improve the quality and reduce parallax errors by telling the environment probe the dimensions of the room its reflecting. Select "RoomA Probe" and set parallax correction to "Box".

  5. Using the two corner handles, resize the box to fit the inside of the room.

  6. Objects in the room should now reflect the backgrounds much more accurately, as can be seen in the image below.