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 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.