Skip to main content

Cubemaps, Cubelights and Lighting your level

Cubemaps

A cubemap is a six-sided texture used for reflective surfaces to reflect stuff. Here's an example:

This looks wrong! Why are there buildings in the reflection even though we are indoors?

That's because diesel does not support realtime reflections, so map makers have to create cubemaps manually ​ To do so you will need to spawn a cubemap_gizmo from the editors spawn menu. Position it however you want. Then head over to the env manager and press "Build Cubemaps" (this will fail if you dont have python3 and PIL module installed) If successful, the editor will tell you the path to the cubemap relative to your map's directory. Remember this path! ​ Reload the map, click on the env tab in the upper menu and find your cubemap texture in the cubemap dialog box. Once selected, the global cubemap will change: ​ Eh, not too good looking, but it will do! ​ The game will keep track of changes to the cubemap texture so you won't have to reload the map each time you build cubemaps for the gizmo you're working with. Keep in mind that you will have to reload the map every time a new gizmo is added to the map! ​

This cubemap is global, how can i make certain areas have different cubemaps?

For that you'd need to create a separate env area, tick the cubemap option and include an environment file with a different cubemap texture. You'd need to do this for every area ​

Why are reflections unchanged for some units?

That's because these units override the global cubemap. To fix that you need to extract the unit, change the global_texture parameter to the path of your cubemap in the seq_manager and load it from extract. That way you can have per-unit local cubemaps! ​

Cubelights

Cubelights are a six-sided texture used for projecting static shadows from lightsources onto the environment Here's an example: ​ You can do that too! All you have to do is to spawn a light_omni_shadow_projection in the spawnmenu. All lights with a shadow_projection prefix can build projection textures. Now just select the light, head over to the env manager and press "Build Projection Lights" (this will fail if you dont have python3 and PIL module installed)

Same as with cubemaps, the projection texture will only start working after a reload. Let's compare the two: Before: After:

Building projection lights can also fix light leaking through map geometry

Projection lights don't build for a specific light unit!

If your light unit does not have options such as shadow resolution or doesn't have any light settings at all you would need to extract it to build projection lights