Skip to main content

Rendering Animations

This workflow assumes that you have already set up a project ready for rendering, and that you have read the article about the rendering window.

For rendering animations, it is recommended that you use the Pragma renderer. Using a raytracing renderer like Cycles X is possible, but even with top-of-the-line hardware it can take days, weeks or even months to render a full animation. Additionally, some rendering effects (like Motion Blur) are currently only supported for the Pragma renderer.

This workflow assumes that you're going to use the Pragma renderer, and describes the recommended steps. Setting up a reflection probe and lightmap baking in particular are essential to get good-looking results.

Reflection Probe

A reflection probe contains a cubemap image of the scene, which contains lighting information used by reflective objects. Without a reflection probe, reflective objects will look unnatural. Luckily setting up a reflection probe is very simple.

You can create a new reflection probe via the actor editor:

add_reflection_probe.png

In most cases one reflection probe will suffice. During rendering, whichever probe is closest to the camera will be used, and all others will be ignored.

Placement

Reflection probes are not visible in the viewport, but you can see its location by selecting it in the actor editor, and entering move mode by pressing the pragma_2022-07-16_20-26-30.png button:

probe_location.png

Move the probe somewhere near the center of your scene, but not too far from the camera. Make sure the probe is not obstructed by any objects and not too close to any walls and that most of your scene is visible from the reflection probe's position. The rotation of the probe does not matter. Once your probe is in place, you're ready to bake it:

Baking

To bake a reflection probe select the reflection_probe component from the component list, and press the Bake reflection probe button:

bake_refl_probe_button.png

The baking process may take a minute or more, make sure not to deselect the component while this is happening or the process will be cancelled.

Once baking is complete, a window like this should pop up:

refl_probe_window.png

All of the static actors in your scene should be visible. The image will probably look very blurry, but that's okay. You can now close this window and save the project. The effect of the probe may not be immediately noticeable, but it can subtly improve the overall quality of the scene a fair bit.

The reflection probe will have to be re-baked if you move any of the static actors, add any new static actors to the scene or move the probe itself. For this reason it's best to do it right before you're about to do the final render of your scene.

Example

Here is an example video on how to set up a reflection probe. The purpose of the golden cube is to highlight the effect that the probe has on the scene (and on reflective/metallic objects in particular):

Lightmaps

lightmap_comparison.png

(Left = With Lightmaps, Right = Without Lightmaps)

Lightmaps are the most important step to improving the rendering quality of your scene. Lightmap baking is a way of pre-calculating lighting information for your scene before the actual render. If your scene only consists of dynamic actors (i.e. actors that are moving or animated), you can skip this step, but if you have any static actors at all, it is highly recommended that you take the time to setup lightmap baking.

Lightmap baking is a one-time process (once per scene/project), however this process can also take some time. To get high-quality lightmaps, several hours of rendering time may be required, depending on your GPU and your desired lightmap quality. However, once the lightmaps have been baked, rendering the actual animation will be very fast (and still significantly faster than using a raytracing renderer altogether).

Setup

Map

Lightmap baking only works with scene builds. If you're using a map that isn't completely empty (i.e. has visible geometry), you will have to convert it to a scene build first. To do so, simply select Tools > Convert Map to Actors from the menu bar. This will convert the map and its props to actors in your project. Please note that since the map is now part of the project itself, you should not load the map anymore the next time you want to use the project. Instead, load an empty map instead.

If your project is a pure scene build and does not use a map as a base, you can skip this step.

Static Actors

First of all you have to specify which actors should be included in the baked lightmaps. This should be all static props (and only the static props) in your scene. To do so, simply add the light_map_receiver component to those actors:

light_map_receiver_component.png

Depending on how the actor was created, the component may already be there and you can skip this step entirely. If the component doesn't exist, you can add it manually. Only actors with this component will considered. Do not add this component to any actors that move around in the scene or that are otherwise visibly animated (e.g. with skeletal or facial animations).

Light Sources

Next up, you will have to place some point light sources in your scene. Place as many as you like, but do not animate them in any way. These lights will be baked using the Cycles renderer, you can can render a preview image of your scene in the Render window to get an idea of what it will look like after the baking process. These light sources will only be used for the baking process and will only affect static actors with the light_map_receiver component once it's all done.

Do not check the castShadows property for these light sources. Baked light sources always cast shadows and enabling this property would put a significant strain on your GPU resources for no reason.

You can also use other light types (e.g. spot-lights) for baking, but point lights are usually the easiest way to evenly light a large scene.

Once you're satisfied with the result, make sure to check the baked property of all of the light sources you've placed. You'll notice they disappear from the viewport, which is intentional.

Lightmapper

Once you've got it all set up, you will also have to place a Lightmapper actor in your scene:

lightmapper_actor.png

Lightmap Area Bounds

lightmap_area_bounds.png

The lightmap area bounds (shown in blue in the screenshot above) define the 3D space for which the lightmaps should be build. Anything outside of these bounds will not be included. This is important because the smaller the area, the higher quality the lightmaps will be, which means the area should fit around the visible scene as tightly as possible.

If your scene is a scenebuild where all actors are visible, then you can skip this step. By default the area bounds will encompass the entirety of the scene.

On the other hand, if your scene is part of a larger map (like in the screenshot above), and only a small portion is actually visible through the camera, then this step becomes more important.

To define the bounds, select the pfm_cuboid_bounds component of the Lightmapper actor. Make sure the showDebugBounds property is checked to enable the blue cube visualization of the bounds. Since the bounds are initially 0 0 0, you will not see anything right away.

Next, select the minBounds property and select the Move-Tool (translation_tool.png) tool in the viewport window. Move the arrows in the widget to one corner of the scene:

lightmap_area_bounds_corner.png

Then do the same with maxBounds and move the arrows to the opposite corner of the scene. You should see a cube forming around it.

Once the scene is encompassed, you can uncheck the showDebugBounds property.

Baking

The final step is to actually initiate the baking process. To do so, select the pfm_baked_lighting component of the Lightmapper actor and click the Bake lightmaps button. Please note that this can take a significant amount of time (i.e. several hours, depending on the scene complexity and your GPU). Do not deselect the component in the actor editor during this process, or the render will be cancelled.

Once the baking is complete, a window such as this will appear:

lightmap_atlas.png

This means the baking was successful. Make sure to save the project, or the lightmap data will be lost. If you move around the viewport, you should see the updated lighting right away. If you're not satisfied with the lightmap quality (e.g. very blurry shadows), you can increase the resolution property of the pfm_baked_lighting component. The resolution always has to be a power of two (e.g. 1024x1024, 2048x2048, 4096x4096, etc.), and higher resolutions will increase render times significantly, as well as require much more VRAM.

If you make any changes to the scene in the future, such as moving, deleting or adding new static actors, you will have to bake the lighting again. For this reason, this step should be reserved for when you're about to do the final render of the scene.

Ambient Occlusion

 

actor_edit_material.png

mated_compose_rma.png

mated_generate_ao.png

 

ao_map.png

COMPOSE RMA

Shadowed Light Sources

By default all light sources you place in PFM do not cast shadows so save on rendering resources. To enable shadow casting for a light source, simply select the light component of the light source actor in the actor editor and check the castShadows property. If the shadows don't become visible right away, try moving the light source slightly.

Shadowed Light Sources are very expensive in terms of GPU resources, so use them sparingly. This applies to point and directional light sources especially, try to avoid using them if possible and stick to shadowed spot-lights, otherwise you may run out of available VRAM very quickly.

 

Motion Blur

If your animation is set up for 30 FPS or less, enabling Motion Blur is highly recommended. At higher resolutions it may not be as effective, but should still be considered, as the setup is very simple. Check out this article for more information on how to enable Motion Blur.

Fog

Spot-light beams

Spot-light shadows