Oxygen Reference

Environment Probes

Oxygen will capture environment probes (stored as HDR cubemaps) from any Unity scene. To get good (and realistic looking) probes you will need a substantial amount of dynamic range, so be sure to have really bright spots in your scene - think of what it'll be doing to the lighting in addition to how it looks in a tonemapped camera.

  1. Open your Unity scene to begin adding environment probes! We'll use a simple example scene here.


  2. Create a new GameObject and add the Oxygen Environment Probe component to it.

  3. Place the probe somewhere near the objects you want to appear in the reflection. Click "Recalculate Cubemap" in the inspector to update the probe's cubemap. "High Q" also recalculates the cubemap, but takes slightly longer.


    At this point with the probe selected, you can preview the captured cubemap in the scene. You can also preview subsequent convolved levels by dragging the "Preview LOD" slider.


  4. Environment probes have a Parallax correction option which is used by the Oxygen shaders to approximate parallax-correct reflections. The default parallax correction option is None, which simulates reflecting objects which are infinitely far away.

    Select the "Box" parallax correction option, and then tweak the box in the scene view to tell oxygen the projected box it should use.


  5. If you use the Oxygen sky shader for your sky (or indeed any of your own shaders with a _BrightnessMultiplier float variable), you can get it to boost them whilst rendering the environment probes by setting the "Skydome Boost" parameter. This is particularly useful for indoor scenes. The image below demonstrates the very marked difference between low and high dynamic range cubemaps at low specular powers.


Inheriting Probes

When building a large level / scene the sizes of probes in memory will become a bottleneck. Oxygen allows you to share probes or indeed use any cubemap anywhere else.

Click on the "Save" buttton next to Capture Settings to save a HDR cubemap into your project. You can use this cubemap anywhere else in Unity that requires a cubemap (check technical details for the format of this cubemap). You can also use this cubemap in Marmoset Skyshop.

Change the "Source" parameter on the Environment probe to "External" to tell it exactly which cubemap to use. You can drop another probe into the slot below, or any cubemap (even specular convolved cubemaps from Skyshop) into the slot. You can use parallax correction as you see fit for this particular probe without affecting any others.

Environment Setters

Environment setters in Oxygen are bound to a particular probe. The probe settings are assigned to all children under the hierarchy of the environment setter.

Technical details

The Oxygen probes are convolved using fixed Phong specular powers (infinity, 128, 64, 32, 16, 8) and saved out into an RGBM encoded gamma space Unity cubemap, giving you a range of approximately 0..51.5. The convolution is performed in floating point, so even if you have points that exceed that range clamped at full resolution, the convolution should be correct at the lower specular powers.

Using the cubemaps in your own shaders is pretty simple. Refer to one of the Oxygen shaders for more details. If you need to speed up the shaders further, drop the geometry factor (geomfac) and perhaps the fresnel as well.