Mathieu Vaillancourt

View Original

How to create Pre rendered Backgrounds with Unreal Engine

I’ve been developing my RPG with Unreal Engine for over a year now, incorporating fixed camera angles, tank controls, and pre-rendered backgrounds. Drawing inspiration from classics like Resident Evil, Jade Cocoon and Final Fantasy , to name a few, I’m blending nostalgic design with modern tools. In this post, I’ll explain how I create pre-rendered backgrounds and integrate them into my game.

Why Pre-rendered Backgrounds?

Pre-rendered backgrounds allow for rich, detailed environments without the performance cost of real-time rendering. They provide a visually striking experience while keeping the game’s performance smooth and add an old school visual and gameplay.


1. Main Level and Temporary Streaming Level: I use two levels for creating each pre-rendered scene:

- Main Level: This contains all the essential gameplay elements, including the characters, interactive items, and blockages (which determine where the player can and cannot go).

- Streaming Level (temporary): This level contains all the high-quality meshes, lighting, vegetation, and detailed assets that will be visible in the pre-rendered backgrounds. It is always loaded only for the purpose of taking screenshots. Once the screenshots are taken, this streaming level is disabled or removed.

2. Setting Up the Scene: I populate the streaming level with all the visual details that will be part of the final background, such as buildings, environmental props, lighting,foliages and any other decorative elements. These are carefully placed to align perfectly with the blockages in the main level. The sun, shadows, and any other visual effects are also added to the scene.



3. Capturing the Screenshots: Once the scene is ready and the cameras are positioned, I take a high-resolution screenshot of the environment for each camera view. Before capturing, I hide all characters, interactive objects and blockages from the main level, ensuring the screenshots only includes the background elements from the streaming level.

4. Disabling the Streaming Level: After all the screenshots are taken, the streaming level is no longer needed, so it is disabled or removed. The game will only use the main level for gameplay, while the screenshots from the streaming level becomes the pre-rendered background.

Now having all the pre rendered backgrounds, we can create the post process material for showing them on screen. But before this, we must enable in the project settings the stencils.

Then, we create a new material.

The Post Process Material must be set to Before Tonemapping if you do not have materials with any kind of transparency in your game.

If you have materials with transparency, instead set the Blendable Location to Before translucency, otherwise even if the meshes with transparency have a value of 1 for their stencil they will not be displayed.

All meshes that have the Custom depth value set at 1 will appear in front of the pre rendered backgrounds.


The Texture Name variable will be use for naming the screenshots taken, the variable Pre Rendered BG variable is the texture that we need to be set for each Camera Switching actor. Both if these are Instance Editable variable.

At every Camera Switcher we must set a camera actor, and a Texture name and a pre rendered background.

This function is created in the Construction Script of yourr Player Controller

The function in details, We will have to set our Post process volume settings here. This function create a dnynamic material of the Pre rendered Background material that we created earlier.

We must add this somewhere after Beginning play of the Player Controller. It takes all the Camera Switchers in the level and create an array of them. This is just for creating the screenshots for the pre rendered backgrounds. before packaging the game, we’ll erase this.

Assign this function to an input of your choice, open YourProjectName > Saved > Screenshots folder, play your game, press the input you chose for taking the screenshots and enjoy seeing a new pre rendered background everytime you press the button. The screenshots will stop when all the cameras from the camera switchers are all used.


If you share this small tutorial put a link to this blog, it is helping me to spread my art.

Also if you have questions, ask in the comments below.