How to Render a 180/ 360 Projection with a Custom Mask in Unreal Engine

How to render a 180/ 360 projection output from a custom mask in Unreal Engine, rendering the exact pixels you need for faster render times and smaller file sizes.

Last updated 2 days ago

Overview

The OWL 360 Camera/ Component lets you render to a custom mask so you can only output the pixels you need, significantly reducing render times and file sizes.

This is currently available for Equirectangular, 180 Equirectangular, VR 180 and VR 360 projection types.

You can use with feature with Movie Render Queue and when live-rendering from the 360 Camera via a Render Target.

Creating a PNG Mask

When working with unusual projection surfaces, most venues will have access to a UV unwrap image.

This can be used to create a black and white png image where black pixels are omitted and white pixels are rendered.

Creating your Own Mask

If starting from scratch, 3D editing software like Blender can be used to create a Digital Twin of your venue from which you can generate your own UV unwrap image as explained below using the example of a dome:

  1. Create a UV sphere that matches the measurements of the real world Dome.

  2. With the shape selected, press Tab to go in to edit mode, 1 to view vertices, then Alt+Z to use x-ray view followed by Delete > Vertices:

  3. Use Alt+Middle Mouse drag up to view the bottom of the sphere, then A to select all, then press U > Project from view (Bounds) to create a sphere that is perfectly mapped to the resolution of a texture:

  4. Use Export UV layout to create a PNG image.

  5. Set the Fill Opacity to 1, and ensure the export size matches the final output resolution for accuracy.

  6. Import the PNG in to an image editing software:

  7. Double click the image and set the Color Overlay to white:

  8. Add a background layer and set this to black:

  9. Export this image as a PNG for use in Unreal Engine as your Output Mask.

Adding Mask in Unreal

  1. Select your Projection Type in the OWL 360 Camera/ Capture Component.

  2. InDetails> Advanced, go to Output Mask, and in the drop down to select a mask for your output.

    1. The mask should be the same resolution and aspect ratio as your target output.

    2. If you are adding your own mask you should drag it into your Content Browser and it will show in this list:

  3. Now in your Preview and Render Target you will see your projection rendering only to your mask:

Optimising Rendered Pixels

  1. Click Show Debug Face Colors to show how the cube faces from your projection currently are aligned inside your mask:

  2. Now begin to adjust the Custom Horizontal and Vertical FOV values to constrain the pixels in your projection to only those needed by your mask:

    1. When you reduce these values, will see cube faces grow in your preview because they are occupying a larger proportion of the FOV you are rendering.

    2. For example, if you have a hemisphere, you only need a Horizontal FOV of 180 (not 360)

    3. In the mask example here, the below values are correct:

  3. Now you can go to the Face Control section and when you press Auto-Calculate, it will automatically reduce the size of the cube faces being rendered to match the Horizontal and Vertical FOV values you have input:

Rendering in Movie Render Queue

  1. In Movie Render Queue, all your Projection settings (type, FOV) are automatically inherited from your 360 Camera/ Component, but you need to add the mask again:

    1. In Output> Mask> Output Mask Path, select the mask you added to the 360 Camera:

    2. You have an option to choose a Relative Path here if you want to share your project with other artists:

  2. Now when you render, you will render to the mask and you will only render the pixels required by your FOV settings.