Light and Post Effects

Wikis > Game engine manual > Light and Post Effects


Rendering pipeline

Nebula uses a deferred rendering pipeline, reverting to forward rendering only for special cases, such as transparency. (This means that there is generally a rather low performance cost associated with dense geometry and the number of lights, although deforming meshes and lights with dynamic shadows are quite expensive.) To augment direct lighting from sources such as the global directional light, point and spot lights, you can (and should) assign environment and irradiance maps to a model’s material in the Content Browser. After all standard light is evaluated against the materials in the scene, additional post effects are applied to the image. These include optional effects like HDRI bloom/glare and Depth of Field, but also a Tone Mapping done to scale the HDR linear image outputted by the render to a LDR sRGB image to be viewed on the monitor.

The strength of a directional light, as well as the environment and irradiance maps, is defined simply as a brightness multiplier. If the strength of the directional light is 1, a diffuse surface exactly perpendicular to the light with an albedo of 0.5 will be exactly that when rendered: 0.5. Tone mapping will, however, adjust the brightness of the image afterwards. (The strength of point and spot lights, however, is a bit more involved and should be simplified.)

The tone mapping in Nebula is based on Reinhard tone mapping. Put simply, it means that the HDR (high dynamic range) images rendered by Nebula are first scaled based on the average luminance in the image, and then fit into a LDR (low dynamic range) 0-1 space. The effect is that one can use more realistic contrasts in lighting in a level (sunlight is several hundred times brighter than an indoor environment, measured in lux) while avoiding too over-exposed images. (Reinhard tone mapping primarily affects very bright images and scales them down.)



Light types

Directional (global)

The default directional light is controlled from the Post Effects window, except for its rotation which in the Level Editor is controlled by the Global Light object in the scene. In the Content Browser, the global light is by default constrained to the camera but can be detached with a menu option and controlled by CTRL+dragging in the viewport.

See the post effect settings for more details.


Point and Spot lights

Point and spot lights are created in the Level Editor from the Light Entities window. Their settings should be familiar to anyone with previous experience with 3D lighting.


Environment and Irradiance maps

Environment and irradiance maps constitute Nebula’s IBL system. They should usually be created as a pair from a source material – a lit and rendered 3D scene, a HDR image, or (when implemented) from within Nebula itself. They are read as cube maps and can be created with Modified CubeMapGen. Environment maps represent the specular component of lighting and should be mipmapped in levels corresponding to Nebula’s roughness parameter. Irradiance maps represent the diffuse light. For now, they are assigned on a per-model basis – but all models (especially reflective/metallic ones) should use them.

See the texture import pipeline for more details.



Post Effects

Post effects are a series of effects that can applied to the rendered image, after all lighting has been computed.


Post Effects Bubbles

The Post Effects window, described in more detail below, controls the settings for the entire level. However, one can also place post effect “bubbles” into the scene, in the form of geometric volumes, which override the global settings when the player enters its area of influence. Post Effects Bubbles can be placed from the Game Entities menu in the Level Editor.


Post Effects Window

The Post Effects settings control various effects in the viewport, such as the global light, the sky dome, tone mapping, etc.



This controls settings for the default global light in the scene. There’s a lot that will be revised here:

Ambient color – the color of an ambient term that can be applied to everything in the scene.

Diffuse color – the color of the actual directional light

Backlight color – the color of an optional “fake” light which is applied to grazing angles from the directional light. Sort of like a faked Fresnel effect, but bound to the directional light’s direction.

Light intensity – scales all of the above light terms. (The slider should go from 0 to 2, currently.)



This controls the sky backdrop in the scene. This is purely a backdrop and does not influence the lighting in the scene.


Ambient Occlusion

Controls the real-time screen-space ambient occlusion effect.



This controls the bloom/glare/glow effect in the scene for overexposed values.


Fog (offline?)

This adds depth fog to the scene.


Depth of Field (offline?)

Controls depth of field effect.



This controls the tone mapping and post color correction in the scene.

Luminance – these values should generally not be touched.

Skip to toolbar